Ignore:
Timestamp:
08/05/04 15:03:07 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/msql/MSQLServer.cc

    r3415 r4513  
    3131//  many features usefull working with relational tables.
    3232//
     33//  Use it like TSQlServer:
     34//    new MSQLServer("mysql://localhost:3306", "hercules", "stdmagicpassword");
     35//    // now start your TBrowser
     36//    new TBrowser;
     37//
    3338////////////////////////////////////////////////////////////////////////
    3439#include "MSQLServer.h"
     
    7277    const TString desc((*row)[1]);
    7378
    74     //cout << "Column Type: " << desc << endl;
     79    delete res;
    7580
    7681    const Bool_t isnum =
     
    119124        num++;
    120125    }
     126
     127    delete res;
    121128
    122129    if (!isnum)
     
    297304    TSQLResult *res = fServ->Query(query);
    298305    if (res)
     306    {
    299307        PrintTable(res);
     308        delete res;
     309    }
    300310    else
    301311        cout << "Query failed: " << query << endl;
     
    519529
    520530    if (res->GetFieldCount()!=1)
     531    {
     532        delete res;
    521533        return (PrintError("GetEntry - Number of columns != 1", query), "");
     534    }
    522535
    523536    if (res->GetRowCount()>1)
     537    {
     538        delete res;
    524539        return (PrintError("GetEntry - Number of rows > 1", query), "");
     540    }
    525541
    526542    if (res->GetRowCount()==0)
     543    {
     544        delete res;
    527545        return "";
     546    }
    528547
    529548    const char *fld = res->Next()->GetField(0);
    530549    if (!fld)
     550    {
     551        delete res;
    531552        return (PrintError("GetEntry - Entry is empty", query), "");
    532 
    533     return TString(fld);
    534 }
     553    }
     554
     555    const TString rc(fld);
     556    delete res;
     557    return rc;
     558}
Note: See TracChangeset for help on using the changeset viewer.