Changeset 4513 for trunk/MagicSoft/Mars/msql
- Timestamp:
- 08/05/04 15:03:07 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/msql/MSQLServer.cc
r3415 r4513 31 31 // many features usefull working with relational tables. 32 32 // 33 // Use it like TSQlServer: 34 // new MSQLServer("mysql://localhost:3306", "hercules", "stdmagicpassword"); 35 // // now start your TBrowser 36 // new TBrowser; 37 // 33 38 //////////////////////////////////////////////////////////////////////// 34 39 #include "MSQLServer.h" … … 72 77 const TString desc((*row)[1]); 73 78 74 //cout << "Column Type: " << desc << endl;79 delete res; 75 80 76 81 const Bool_t isnum = … … 119 124 num++; 120 125 } 126 127 delete res; 121 128 122 129 if (!isnum) … … 297 304 TSQLResult *res = fServ->Query(query); 298 305 if (res) 306 { 299 307 PrintTable(res); 308 delete res; 309 } 300 310 else 301 311 cout << "Query failed: " << query << endl; … … 519 529 520 530 if (res->GetFieldCount()!=1) 531 { 532 delete res; 521 533 return (PrintError("GetEntry - Number of columns != 1", query), ""); 534 } 522 535 523 536 if (res->GetRowCount()>1) 537 { 538 delete res; 524 539 return (PrintError("GetEntry - Number of rows > 1", query), ""); 540 } 525 541 526 542 if (res->GetRowCount()==0) 543 { 544 delete res; 527 545 return ""; 546 } 528 547 529 548 const char *fld = res->Next()->GetField(0); 530 549 if (!fld) 550 { 551 delete res; 531 552 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.