// @(#)root/net:$Id$
// Author: Sergey Linev   6/02/2006

/*************************************************************************
 * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

////////////////////////////////////////////////////////////////////////////////
//
// TSQLStatement
//
// Abstract base class defining SQL statements, which can be submitted
// in bulk to DB server.
//
// This is alternative to TSQLServer::Query() method, which allows only pure
// text queries and pure text result in TSQLResult classes.
// TSQLStatement is designed to support following features:
//   - usage of basic data types (like int or double) as parameters
//     in SQL statements
//   - bulk operation when inserting/updating/selecting data in database
//   - uasge of basic data types when accessing result set of executed query
//
//
// 1. Creation of statement
// ======================================
// To create an instance of the TSQLStatement class, the TSQLServer::Statement() method
// should be used. Depending on the driver used for an ODBC connection,
// the appropriate object instance will be created. For the moment there are
// six different implementations of the TSQLStatement class: for MySQL,
// Oracle, SAPDB, PostgreSQL, SQLite3 and ODBC. Hopefully, support of ODBC will allow usage of
// statements for most existing RDBMS.
//
//   // first, connect to the database
//   TSQLServer* serv = TSQLServer::Connect("mysql://hostname.domain:3306/test",
//                                          "user", "pass");
//   // check if connection is ok
//   if ((serv!=0) && serv->IsConnected()) {
//       // create instance of sql-statement
//       TSQLStatement* stmt = serv->Statement("CREATE TABLE TESTTABLE (ID1 INT, ID2 INT, FFIELD VARCHAR(255), FVALUE VARCHAR(255))";
//       // process statement
//       stmt->Process();
//       // destroy object
//       delete stmt;
//   }
//   delete serv;
//
//
// 2. Insert data to data base
// ===============================================
// There is a special syntax of SQL queries which allows to use values
// provided as parameters. For instance, to insert one row into the TESTTABLE created
// with the previous example, one can simply execute a query like:
//
//    serv->Query("INSERT INTO TESTTABLE VALUES (1, 2, \"name1\", \"value1\"");
//
// However, when many (100-1000) rows should be inserted, each call of
// TSQLServer::Query() method will cause communication loop with database
// server, and the statement has to be evaluated each time instead of using a prepared statement.
// As a result, insertion of data takes too much time.
//
// TSQLStatement provides a mechanism to insert many rows at once.
// First of all, an appropriate statement should be created:
//
//    TSQLStatement* stmt = serv->Statement("INSERT INTO TESTTABLE (ID1, ID2, FFIELD, FVALUE) VALUES (?, ?, ?, ?)", 100);
//
// Here question marks "?" indicate where statement parameters can be inserted.
// To specify values of parameters, SetInt(), SetDouble(), SetString() and other
// methods of the TSQLStatement class should be used. Before parameters values
// can be specified, the NextIteration() method of statement class should be called.
// For each new row,  NextIteration() has to be called first, then parameters values are
// specified. There is one limitation for most type-aware DBMS - once a parameter is set as integer via
// SetInt(), all other rows should be specified as integer. At the end,
// TSQLStatement::Process() should be called. Here a small example:
//
//    // first, create statement
//    TSQLStatement* stmt = serv->Statement("INSERT INTO TESTTABLE (ID1, ID2, FFIELD, FVALUE) VALUES (?, ?, ?, ?)", 100);
//
//    for (int n=0;n<357;n++)
//       if (stmt->NextIteration()) {
//          stmt->SetInt(0, 123);
//          stmt->SetUInt(1, n+10);
//          stmt->SetString(2, Form("name %d",n), 200);
//          stmt->SetString(3, Form("value %d", n+10), 200);
//      }
//
//     stmt->Process();
//     delete stmt;
//
// The second argument in the TSQLServer::Statement() method specifies the depth of
// of buffers which are used to keep parameter values (100 in the example). It is not
// a limitation of the number of rows which can be inserted with the statement.
// When buffers are filled, they will be submitted to database and can be
// reused again. This happens transparent to the user in the NextIteration()
// method.
//
// Oracle and some ODBC drivers support buffering of parameter values and,
// as a result, bulk insert (update) operation. MySQL (native driver and
// MyODBC 3) does not support such a mode of operation, therefore adding
// new rows will result in communication loop to database.
//
// Local databases (SQLite3) do not use any buffering at all in the TSQLStatement
// implementation (but inside the library). They still profit from the
// usage of prepared statements. When inserting many rows into a SQLite3 database,
// consider using a transaction via the methods StartTransaction() and Commit()
// of the TSQLServer, as autocommit is active by default and causes a sync to disk
// after each single insert.
//
// One should also mention differences between Oracle and ODBC SQL syntax for
// parameters. ODBC (and MySQL) use question marks to specify the position
// where parameters should be inserted (as shown in the example). Oracle uses
// :1, :2 and so on as marks to specify the position of parameter 0, 1, and so on.
// Therefore, similar to the example, a query will look like:
//
//    TSQLStatement* stmt = serv->Statement("INSERT INTO TESTTABLE (ID1, ID2, FFIELD, FVALUE) VALUES (:1, :2, :3, :4)", 100);
//
// SQLite3 supports both these syntaxes and some more.
//
// There is a possibility to set a parameter value to NULL with the SetNull() method.
// If this method is to be called for the first iteration, one should first call another Set...
// method to identify the actual type which will be used for the parameter later.
//
//
// 3. Getting data from database
// =============================
// To request data from a database, the SELECT statement should be used.
// After a SELECT statement is created, it must be processed
// with the TSQLStatement::Process() method and the result of statement
// should be stored in internal buffers with the method TSQLStatement::StoreResult().
// Information about selected fields (columns)
// can be obtained with GetNumFields() and GetFieldName() methods.
// To receive data for the next result row, NextResultRow() method should be called.
// Value from each column can be retrieved with the GetInt(), GetDouble(),
// GetString() and other methods.
//
// There are no strict limitations on which method should be used
// to get column values. GetString() can be used as a generic method,
// which should always return correct result, but also conversions between most
// basic data types are supported. For instance, if a column contains integer
// values, GetInt(), GetLong64(), GetDouble() and GetString() methods can be used.
// If column has floating point format, GetDouble() and GetString() methods can
// be used without loss of precision while GetInt() or GetLong64() will return
// only the integer part of the value. One also can test whether
// a value is NULL with the IsNull() method.
//
// The buffer length specified for a statement in the TSQLServer::Statement() call
// will also be used to allocate buffers for column values. Usage of these
// buffers is transparent for users and does not limit the number of rows
// which can be accessed with one statement. Again, local databases do not work
// with buffers inside TSQLStatement at all and ignore this value.
// Example of select query:
//
//    stmt = serv->Statement("SELECT * FROM TESTTABLE", 100);
//    // process statement
//    if (stmt->Process()) {
//       // store result of statement in buffer
//       stmt->StoreResult();
//
//       // display info about selected field
//       std::cout << "NumFields = " << stmt->GetNumFields() << std::endl;
//       for (int n=0;n<stmt->GetNumFields();n++)
//          std::cout << "Field " << n << "  = " << stmt->GetFieldName(n) << std::endl;
//
//       // extract rows one after another
//       while (stmt->NextResultRow()) {
//          Double_t id1 = stmt->GetDouble(0);
//          UInt_t id2 = stmt->GetUInt(1);
//          const char* name1 = stmt->GetString(2);
//          const char* name2 = stmt->GetString(3);
//          std::cout << id1 << " - " << id2 << "  " << name1 << "  " << name2 << std::endl;
//       }
//    }
//
// 4. Working with date/time parameters
// ====================================
// The current implementation supports date, time, date&time and timestamp
// data (all time intervals are not supported yet). To set or get date/time values,
// the following methods should be used:
//   SetTime()/GetTime() - only time (hour:min:sec),
//   SetDate()/GetDate() - only date (year-month-day),
//   SetDatime()/GetDatime() - date and time
//   SetTimestamp()/GetTimestamp() - timestamp with seconds fraction
// For some of these methods TDatime type can be used as parameter / return value.
// Be aware that TDatime supports only dates after 1995-01-01.
// There are also methods to get year, month, day, hour, minutes and seconds separately.
//
// Note that different SQL databases treat date/time types differently.
// For instance, MySQL has all correspondent types (TIME, DATE, DATETIME and TIMESTAMP),
// Oracle native driver supports only DATE (which is actually date and time) and TIMESTAMP
// ODBC interface provides access for time, date and timestamps,
// for PostgreSQL, TIMESTAMP is available and can be retrieved via all methods,
// the implementation for SQLite interprets the column content as
// a timestamp with second fraction.
// Due to these differences, one should use correct methods to access such data.
// For instance, in MySQL SQL type 'DATE' is only date (one should use GetDate() to
// access such data), while in Oracle it is date and time. Therefore,
// to get complete data from a 'DATE' column in Oracle, one should use the GetDatime() method.
//
// The only difference between timestamp and date/time is that timestamp has a fractional
// seconds part. Be aware that the fractional part has different meanings
// (actual value) in different SQL plugins.
// For PostgreSQL, it is given back as microseconds, while for SQLite3,
// milliseconds correspond to the fraction (similar to the DATETIME-functions
// implemented in the SQLite3 language).
//
// 5. Binary data
// ==============
// Most modern data bases support just binary data, which is
// typically has SQL type name 'BLOB'. To access data in such
// columns, GetBinary()/SetBinary() methods should be used.
// The current implementation implies that the complete content of the
// column must be retrieved at once. Therefore, very big data of
// gigabytes size may cause a problem.
//
// In addition, for PostgresSQL, the methods GetLargeObject()/SetLargeObject()
// are implemented with similar syntax. They retrieve a large object for the OID
// given in the column of the statement. For non-PostgreSQL databases,
// calling GetLargeObject()/SetLargeObject() is redirected to GetBinary()/SetBinary().
//
////////////////////////////////////////////////////////////////////////////////

#include "TSQLStatement.h"

ClassImp(TSQLStatement)

//______________________________________________________________________________
Int_t TSQLStatement::GetErrorCode() const
{
   // returns error code of last operation
   // if res==0, no error
   // Each specific implementation of TSQLStatement provides its own error coding

   return fErrorCode;
}

//______________________________________________________________________________
const char* TSQLStatement::GetErrorMsg() const
{
   //  returns error message of last operation
   // if no errors, return 0
   // Each specific implementation of TSQLStatement provides its own error messages

   return GetErrorCode()==0 ? 0 : fErrorMsg.Data();
}

//______________________________________________________________________________
void TSQLStatement::ClearError()
{
   // reset error fields

   fErrorCode = 0;
   fErrorMsg = "";
}

//______________________________________________________________________________
void TSQLStatement::SetError(Int_t code, const char* msg, const char* method)
{
   // set new values for error fields
   // if method specified, displays error message

   fErrorCode = code;
   fErrorMsg = msg;
   if ((method!=0) && fErrorOut)
      Error(method,"Code: %d  Msg: %s", code, (msg ? msg : "No message"));
}

//______________________________________________________________________________
Bool_t TSQLStatement::SetDate(Int_t npar, const TDatime& tm)
{
   // set only date value for specified parameter from TDatime object

   return SetDate(npar, tm.GetYear(), tm.GetMonth(), tm.GetDay());
}

//______________________________________________________________________________
Bool_t TSQLStatement::SetTime(Int_t npar, const TDatime& tm)
{
   // set only time value for specified parameter from TDatime object

   return SetTime(npar, tm.GetHour(), tm.GetMinute(), tm.GetSecond());
}

//______________________________________________________________________________
Bool_t TSQLStatement::SetDatime(Int_t npar, const TDatime& tm)
{
   // set date & time value for specified parameter from TDatime object

   return SetDatime(npar, tm.GetYear(), tm.GetMonth(), tm.GetDay(),
                          tm.GetHour(), tm.GetMinute(), tm.GetSecond());
}

//______________________________________________________________________________
Bool_t TSQLStatement::SetTimestamp(Int_t npar, const TDatime& tm)
{
   // set timestamp value for specified parameter from TDatime object

   return SetTimestamp(npar, tm.GetYear(), tm.GetMonth(), tm.GetDay(),
                             tm.GetHour(), tm.GetMinute(), tm.GetSecond(), 0);
}

//______________________________________________________________________________
TDatime TSQLStatement::GetDatime(Int_t npar)
{
   // return value of parameter in form of TDatime
   // Be aware, that TDatime does not allow dates before 1995-01-01

   Int_t year, month, day, hour, min, sec;

   if (!GetDatime(npar, year, month, day, hour, min, sec))
     return TDatime();

   if (year<1995) {
      SetError(-1, "Date before year 1995 does not supported by TDatime type", "GetDatime");
      return TDatime();
   }

   return TDatime(year, month, day, hour, min, sec);
}

//______________________________________________________________________________
Int_t TSQLStatement::GetYear(Int_t npar)
{
   // return year value for parameter (if applicable)

   Int_t year, month, day, hour, min, sec, frac;
   if (GetDate(npar, year, month, day)) return year;
   if (GetTimestamp(npar, year, month, day, hour, min, sec, frac)) return year;
   return 0;
}

//______________________________________________________________________________
Int_t TSQLStatement::GetMonth(Int_t npar)
{
   // return month value for parameter (if applicable)

   Int_t year, month, day, hour, min, sec, frac;
   if (GetDate(npar, year, month, day)) return month;
   if (GetTimestamp(npar, year, month, day, hour, min, sec, frac)) return month;
   return 0;
}

//______________________________________________________________________________
Int_t TSQLStatement::GetDay(Int_t npar)
{
   // return day value for parameter (if applicable)

   Int_t year, month, day, hour, min, sec, frac;
   if (GetDate(npar, year, month, day)) return day;
   if (GetTimestamp(npar, year, month, day, hour, min, sec, frac)) return day;
   return 0;
}

//______________________________________________________________________________
Int_t TSQLStatement::GetHour(Int_t npar)
{
   // return hours value for parameter (if applicable)

   Int_t year, month, day, hour, min, sec, frac;
   if (GetTime(npar, hour, min, sec)) return hour;
   if (GetTimestamp(npar, year, month, day, hour, min, sec, frac)) return hour;
   return 0;
}

//______________________________________________________________________________
Int_t TSQLStatement::GetMinute(Int_t npar)
{
   // return minutes value for parameter (if applicable)

   Int_t year, month, day, hour, min, sec, frac;
   if (GetTime(npar, hour, min, sec)) return min;
   if (GetTimestamp(npar, year, month, day, hour, min, sec, frac)) return min;
   return 0;
}

//______________________________________________________________________________
Int_t TSQLStatement::GetSecond(Int_t npar)
{
   // return seconds value for parameter (if applicable)

   Int_t year, month, day, hour, min, sec, frac;
   if (GetTime(npar, hour, min, sec)) return sec;
   if (GetTimestamp(npar, year, month, day, hour, min, sec, frac)) return sec;
   return 0;
}

//______________________________________________________________________________
TDatime TSQLStatement::GetTimestamp(Int_t npar)
{
   // return value of parameter in form of TDatime
   // Be aware, that TDatime does not allow dates before 1995-01-01

   Int_t year, month, day, hour, min, sec, frac;

   if (!GetTimestamp(npar, year, month, day, hour, min, sec, frac))
     return TDatime();

   if (year<1995) {
      SetError(-1, "Date before year 1995 does not supported by TDatime type", "GetTimestamp");
      return TDatime();
   }

   return TDatime(year, month, day, hour, min, sec);
}

 TSQLStatement.cxx:1
 TSQLStatement.cxx:2
 TSQLStatement.cxx:3
 TSQLStatement.cxx:4
 TSQLStatement.cxx:5
 TSQLStatement.cxx:6
 TSQLStatement.cxx:7
 TSQLStatement.cxx:8
 TSQLStatement.cxx:9
 TSQLStatement.cxx:10
 TSQLStatement.cxx:11
 TSQLStatement.cxx:12
 TSQLStatement.cxx:13
 TSQLStatement.cxx:14
 TSQLStatement.cxx:15
 TSQLStatement.cxx:16
 TSQLStatement.cxx:17
 TSQLStatement.cxx:18
 TSQLStatement.cxx:19
 TSQLStatement.cxx:20
 TSQLStatement.cxx:21
 TSQLStatement.cxx:22
 TSQLStatement.cxx:23
 TSQLStatement.cxx:24
 TSQLStatement.cxx:25
 TSQLStatement.cxx:26
 TSQLStatement.cxx:27
 TSQLStatement.cxx:28
 TSQLStatement.cxx:29
 TSQLStatement.cxx:30
 TSQLStatement.cxx:31
 TSQLStatement.cxx:32
 TSQLStatement.cxx:33
 TSQLStatement.cxx:34
 TSQLStatement.cxx:35
 TSQLStatement.cxx:36
 TSQLStatement.cxx:37
 TSQLStatement.cxx:38
 TSQLStatement.cxx:39
 TSQLStatement.cxx:40
 TSQLStatement.cxx:41
 TSQLStatement.cxx:42
 TSQLStatement.cxx:43
 TSQLStatement.cxx:44
 TSQLStatement.cxx:45
 TSQLStatement.cxx:46
 TSQLStatement.cxx:47
 TSQLStatement.cxx:48
 TSQLStatement.cxx:49
 TSQLStatement.cxx:50
 TSQLStatement.cxx:51
 TSQLStatement.cxx:52
 TSQLStatement.cxx:53
 TSQLStatement.cxx:54
 TSQLStatement.cxx:55
 TSQLStatement.cxx:56
 TSQLStatement.cxx:57
 TSQLStatement.cxx:58
 TSQLStatement.cxx:59
 TSQLStatement.cxx:60
 TSQLStatement.cxx:61
 TSQLStatement.cxx:62
 TSQLStatement.cxx:63
 TSQLStatement.cxx:64
 TSQLStatement.cxx:65
 TSQLStatement.cxx:66
 TSQLStatement.cxx:67
 TSQLStatement.cxx:68
 TSQLStatement.cxx:69
 TSQLStatement.cxx:70
 TSQLStatement.cxx:71
 TSQLStatement.cxx:72
 TSQLStatement.cxx:73
 TSQLStatement.cxx:74
 TSQLStatement.cxx:75
 TSQLStatement.cxx:76
 TSQLStatement.cxx:77
 TSQLStatement.cxx:78
 TSQLStatement.cxx:79
 TSQLStatement.cxx:80
 TSQLStatement.cxx:81
 TSQLStatement.cxx:82
 TSQLStatement.cxx:83
 TSQLStatement.cxx:84
 TSQLStatement.cxx:85
 TSQLStatement.cxx:86
 TSQLStatement.cxx:87
 TSQLStatement.cxx:88
 TSQLStatement.cxx:89
 TSQLStatement.cxx:90
 TSQLStatement.cxx:91
 TSQLStatement.cxx:92
 TSQLStatement.cxx:93
 TSQLStatement.cxx:94
 TSQLStatement.cxx:95
 TSQLStatement.cxx:96
 TSQLStatement.cxx:97
 TSQLStatement.cxx:98
 TSQLStatement.cxx:99
 TSQLStatement.cxx:100
 TSQLStatement.cxx:101
 TSQLStatement.cxx:102
 TSQLStatement.cxx:103
 TSQLStatement.cxx:104
 TSQLStatement.cxx:105
 TSQLStatement.cxx:106
 TSQLStatement.cxx:107
 TSQLStatement.cxx:108
 TSQLStatement.cxx:109
 TSQLStatement.cxx:110
 TSQLStatement.cxx:111
 TSQLStatement.cxx:112
 TSQLStatement.cxx:113
 TSQLStatement.cxx:114
 TSQLStatement.cxx:115
 TSQLStatement.cxx:116
 TSQLStatement.cxx:117
 TSQLStatement.cxx:118
 TSQLStatement.cxx:119
 TSQLStatement.cxx:120
 TSQLStatement.cxx:121
 TSQLStatement.cxx:122
 TSQLStatement.cxx:123
 TSQLStatement.cxx:124
 TSQLStatement.cxx:125
 TSQLStatement.cxx:126
 TSQLStatement.cxx:127
 TSQLStatement.cxx:128
 TSQLStatement.cxx:129
 TSQLStatement.cxx:130
 TSQLStatement.cxx:131
 TSQLStatement.cxx:132
 TSQLStatement.cxx:133
 TSQLStatement.cxx:134
 TSQLStatement.cxx:135
 TSQLStatement.cxx:136
 TSQLStatement.cxx:137
 TSQLStatement.cxx:138
 TSQLStatement.cxx:139
 TSQLStatement.cxx:140
 TSQLStatement.cxx:141
 TSQLStatement.cxx:142
 TSQLStatement.cxx:143
 TSQLStatement.cxx:144
 TSQLStatement.cxx:145
 TSQLStatement.cxx:146
 TSQLStatement.cxx:147
 TSQLStatement.cxx:148
 TSQLStatement.cxx:149
 TSQLStatement.cxx:150
 TSQLStatement.cxx:151
 TSQLStatement.cxx:152
 TSQLStatement.cxx:153
 TSQLStatement.cxx:154
 TSQLStatement.cxx:155
 TSQLStatement.cxx:156
 TSQLStatement.cxx:157
 TSQLStatement.cxx:158
 TSQLStatement.cxx:159
 TSQLStatement.cxx:160
 TSQLStatement.cxx:161
 TSQLStatement.cxx:162
 TSQLStatement.cxx:163
 TSQLStatement.cxx:164
 TSQLStatement.cxx:165
 TSQLStatement.cxx:166
 TSQLStatement.cxx:167
 TSQLStatement.cxx:168
 TSQLStatement.cxx:169
 TSQLStatement.cxx:170
 TSQLStatement.cxx:171
 TSQLStatement.cxx:172
 TSQLStatement.cxx:173
 TSQLStatement.cxx:174
 TSQLStatement.cxx:175
 TSQLStatement.cxx:176
 TSQLStatement.cxx:177
 TSQLStatement.cxx:178
 TSQLStatement.cxx:179
 TSQLStatement.cxx:180
 TSQLStatement.cxx:181
 TSQLStatement.cxx:182
 TSQLStatement.cxx:183
 TSQLStatement.cxx:184
 TSQLStatement.cxx:185
 TSQLStatement.cxx:186
 TSQLStatement.cxx:187
 TSQLStatement.cxx:188
 TSQLStatement.cxx:189
 TSQLStatement.cxx:190
 TSQLStatement.cxx:191
 TSQLStatement.cxx:192
 TSQLStatement.cxx:193
 TSQLStatement.cxx:194
 TSQLStatement.cxx:195
 TSQLStatement.cxx:196
 TSQLStatement.cxx:197
 TSQLStatement.cxx:198
 TSQLStatement.cxx:199
 TSQLStatement.cxx:200
 TSQLStatement.cxx:201
 TSQLStatement.cxx:202
 TSQLStatement.cxx:203
 TSQLStatement.cxx:204
 TSQLStatement.cxx:205
 TSQLStatement.cxx:206
 TSQLStatement.cxx:207
 TSQLStatement.cxx:208
 TSQLStatement.cxx:209
 TSQLStatement.cxx:210
 TSQLStatement.cxx:211
 TSQLStatement.cxx:212
 TSQLStatement.cxx:213
 TSQLStatement.cxx:214
 TSQLStatement.cxx:215
 TSQLStatement.cxx:216
 TSQLStatement.cxx:217
 TSQLStatement.cxx:218
 TSQLStatement.cxx:219
 TSQLStatement.cxx:220
 TSQLStatement.cxx:221
 TSQLStatement.cxx:222
 TSQLStatement.cxx:223
 TSQLStatement.cxx:224
 TSQLStatement.cxx:225
 TSQLStatement.cxx:226
 TSQLStatement.cxx:227
 TSQLStatement.cxx:228
 TSQLStatement.cxx:229
 TSQLStatement.cxx:230
 TSQLStatement.cxx:231
 TSQLStatement.cxx:232
 TSQLStatement.cxx:233
 TSQLStatement.cxx:234
 TSQLStatement.cxx:235
 TSQLStatement.cxx:236
 TSQLStatement.cxx:237
 TSQLStatement.cxx:238
 TSQLStatement.cxx:239
 TSQLStatement.cxx:240
 TSQLStatement.cxx:241
 TSQLStatement.cxx:242
 TSQLStatement.cxx:243
 TSQLStatement.cxx:244
 TSQLStatement.cxx:245
 TSQLStatement.cxx:246
 TSQLStatement.cxx:247
 TSQLStatement.cxx:248
 TSQLStatement.cxx:249
 TSQLStatement.cxx:250
 TSQLStatement.cxx:251
 TSQLStatement.cxx:252
 TSQLStatement.cxx:253
 TSQLStatement.cxx:254
 TSQLStatement.cxx:255
 TSQLStatement.cxx:256
 TSQLStatement.cxx:257
 TSQLStatement.cxx:258
 TSQLStatement.cxx:259
 TSQLStatement.cxx:260
 TSQLStatement.cxx:261
 TSQLStatement.cxx:262
 TSQLStatement.cxx:263
 TSQLStatement.cxx:264
 TSQLStatement.cxx:265
 TSQLStatement.cxx:266
 TSQLStatement.cxx:267
 TSQLStatement.cxx:268
 TSQLStatement.cxx:269
 TSQLStatement.cxx:270
 TSQLStatement.cxx:271
 TSQLStatement.cxx:272
 TSQLStatement.cxx:273
 TSQLStatement.cxx:274
 TSQLStatement.cxx:275
 TSQLStatement.cxx:276
 TSQLStatement.cxx:277
 TSQLStatement.cxx:278
 TSQLStatement.cxx:279
 TSQLStatement.cxx:280
 TSQLStatement.cxx:281
 TSQLStatement.cxx:282
 TSQLStatement.cxx:283
 TSQLStatement.cxx:284
 TSQLStatement.cxx:285
 TSQLStatement.cxx:286
 TSQLStatement.cxx:287
 TSQLStatement.cxx:288
 TSQLStatement.cxx:289
 TSQLStatement.cxx:290
 TSQLStatement.cxx:291
 TSQLStatement.cxx:292
 TSQLStatement.cxx:293
 TSQLStatement.cxx:294
 TSQLStatement.cxx:295
 TSQLStatement.cxx:296
 TSQLStatement.cxx:297
 TSQLStatement.cxx:298
 TSQLStatement.cxx:299
 TSQLStatement.cxx:300
 TSQLStatement.cxx:301
 TSQLStatement.cxx:302
 TSQLStatement.cxx:303
 TSQLStatement.cxx:304
 TSQLStatement.cxx:305
 TSQLStatement.cxx:306
 TSQLStatement.cxx:307
 TSQLStatement.cxx:308
 TSQLStatement.cxx:309
 TSQLStatement.cxx:310
 TSQLStatement.cxx:311
 TSQLStatement.cxx:312
 TSQLStatement.cxx:313
 TSQLStatement.cxx:314
 TSQLStatement.cxx:315
 TSQLStatement.cxx:316
 TSQLStatement.cxx:317
 TSQLStatement.cxx:318
 TSQLStatement.cxx:319
 TSQLStatement.cxx:320
 TSQLStatement.cxx:321
 TSQLStatement.cxx:322
 TSQLStatement.cxx:323
 TSQLStatement.cxx:324
 TSQLStatement.cxx:325
 TSQLStatement.cxx:326
 TSQLStatement.cxx:327
 TSQLStatement.cxx:328
 TSQLStatement.cxx:329
 TSQLStatement.cxx:330
 TSQLStatement.cxx:331
 TSQLStatement.cxx:332
 TSQLStatement.cxx:333
 TSQLStatement.cxx:334
 TSQLStatement.cxx:335
 TSQLStatement.cxx:336
 TSQLStatement.cxx:337
 TSQLStatement.cxx:338
 TSQLStatement.cxx:339
 TSQLStatement.cxx:340
 TSQLStatement.cxx:341
 TSQLStatement.cxx:342
 TSQLStatement.cxx:343
 TSQLStatement.cxx:344
 TSQLStatement.cxx:345
 TSQLStatement.cxx:346
 TSQLStatement.cxx:347
 TSQLStatement.cxx:348
 TSQLStatement.cxx:349
 TSQLStatement.cxx:350
 TSQLStatement.cxx:351
 TSQLStatement.cxx:352
 TSQLStatement.cxx:353
 TSQLStatement.cxx:354
 TSQLStatement.cxx:355
 TSQLStatement.cxx:356
 TSQLStatement.cxx:357
 TSQLStatement.cxx:358
 TSQLStatement.cxx:359
 TSQLStatement.cxx:360
 TSQLStatement.cxx:361
 TSQLStatement.cxx:362
 TSQLStatement.cxx:363
 TSQLStatement.cxx:364
 TSQLStatement.cxx:365
 TSQLStatement.cxx:366
 TSQLStatement.cxx:367
 TSQLStatement.cxx:368
 TSQLStatement.cxx:369
 TSQLStatement.cxx:370
 TSQLStatement.cxx:371
 TSQLStatement.cxx:372
 TSQLStatement.cxx:373
 TSQLStatement.cxx:374
 TSQLStatement.cxx:375
 TSQLStatement.cxx:376
 TSQLStatement.cxx:377
 TSQLStatement.cxx:378
 TSQLStatement.cxx:379
 TSQLStatement.cxx:380
 TSQLStatement.cxx:381
 TSQLStatement.cxx:382
 TSQLStatement.cxx:383
 TSQLStatement.cxx:384
 TSQLStatement.cxx:385
 TSQLStatement.cxx:386
 TSQLStatement.cxx:387
 TSQLStatement.cxx:388
 TSQLStatement.cxx:389
 TSQLStatement.cxx:390
 TSQLStatement.cxx:391
 TSQLStatement.cxx:392
 TSQLStatement.cxx:393
 TSQLStatement.cxx:394
 TSQLStatement.cxx:395
 TSQLStatement.cxx:396
 TSQLStatement.cxx:397
 TSQLStatement.cxx:398
 TSQLStatement.cxx:399
 TSQLStatement.cxx:400
 TSQLStatement.cxx:401
 TSQLStatement.cxx:402
 TSQLStatement.cxx:403
 TSQLStatement.cxx:404
 TSQLStatement.cxx:405
 TSQLStatement.cxx:406
 TSQLStatement.cxx:407