Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:22:05

0001 // $Id: ODBCDatabaseMetaData.cxx,v 1.1.1.1 2004/02/18 20:58:02 dave Exp $
0002 //*-- Author : Valeriy Onuchin 14/02/2000 
0003 //
0004 
0005 /**************************************************************************
0006 
0007    ROOT wrappers of libodbc++ library
0008     
0009    Copyright (C) 1999-2000 Manush Dodunekov <manush@stendahls.net>
0010    
0011    This library is free software; you can redistribute it and/or
0012    modify it under the terms of the GNU Library General Public
0013    License as published by the Free Software Foundation; either
0014    version 2 of the License, or (at your option) any later version.
0015    
0016    This library is distributed in the hope that it will be useful,
0017    but WITHOUT ANY WARRANTY; without even the implied warranty of
0018    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0019    Library General Public License for more details.
0020    
0021    You should have received a copy of the GNU Library General Public License
0022    along with this library; see the file COPYING.  If not, write to
0023    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
0024    Boston, MA 02111-1307, USA.
0025 
0026 **************************************************************************/
0027 
0028 /////////////////////////////////////////////////////////////////////
0029 //
0030 // Comprehensive information about the database as a whole. 
0031 //
0032 // Many of the methods here return lists of information in the form 
0033 // of TSQLResultSet objects. You can use the normal TSQLResultSet 
0034 // methods  such as TSQLResultSet::GetString() and 
0035 // TSQLResultSet::GetInt() to retrieve the data from 
0036 // these  TSQLResultSet s. If a given form of metadata is not available, 
0037 // these methods should throw an TSQLException. 
0038 //
0039 // Some of these methods take arguments that are string patterns. 
0040 // These arguments all have names such as fooPattern. Within a 
0041 // pattern string, "%" means match any substring of 0 or more 
0042 // characters, and "_" means match any one character. Only metadata 
0043 // entries matching the search pattern are returned. If a search 
0044 // pattern argument is set to a null ref, that argument's criteria 
0045 // will be dropped from the search. 
0046 //
0047 //
0048 /////////////////////////////////////////////////////////////////////
0049 // 
0050 //       Constants:
0051 //
0052 //___________________________________________________________________
0053 // kProcedureResultUnknown
0054 //
0055 //      A possible value for column PROCEDURE_TYPE in the 
0056 //      TSQLResultSet  object returned by the method GetProcedures(). 
0057 //
0058 //      Indicates that it is not known whether the procedure 
0059 //      returns a result.
0060 //
0061 //___________________________________________________________________
0062 // kProcedureNoResult
0063 //
0064 //      A possible value for column PROCEDURE_TYPE in the 
0065 //      TSQLResultSet object returned by the  method GetProcedures(). 
0066 //
0067 //      Indicates that the procedure does not return a result.
0068 //
0069 //___________________________________________________________________
0070 // kProcedureReturnsResult
0071 //
0072 //      A possible value for column PROCEDURE_TYPE in the 
0073 //      TSQLResultSet object returned by the  method GetProcedures(). 
0074 //
0075 //      Indicates that the procedure returns a result.
0076 //
0077 //___________________________________________________________________
0078 // kProcedureColumnUnknown
0079 //
0080 //     Indicates that type of the column is unknown. A possible value 
0081 //     for the column  COLUMN_TYPE in the TSQLResultSet returned by 
0082 //     the method GetProcedureColumns().
0083 //
0084 //___________________________________________________________________
0085 //  kProcedureColumnIn
0086 //
0087 //    Indicates that the column stores IN parameters. A possible 
0088 //    value for the column  COLUMN_TYPE in the TSLQResultSet returned 
0089 //    by the method GetProcedureColumns().
0090 //
0091 //___________________________________________________________________
0092 // kProcedureColumnInOut
0093 //
0094 //     Indicates that the column stores INOUT parameters. A possible 
0095 //    value for the column COLUMN_TYPE in the TSQLResultSet returned 
0096 //    by the method GetProcedureColumns().
0097 //
0098 //___________________________________________________________________
0099 // kProcedureColumnOut
0100 //
0101 //      Indicates that the column stores OUT parameters. A possible 
0102 //      value for the column kCOLUMN_TYPE in the TSQLResultSet 
0103 //      returned by the method GetProcedureColumns().
0104 //
0105 //___________________________________________________________________
0106 // kProcedureColumnReturn
0107 //
0108 //      Indicates that the column stores return values. A possible 
0109 //      value for the column COLUMN_TYPE in the TSQLResultSet returned 
0110 //      by the method GetProcedureColumns().
0111 //
0112 //___________________________________________________________________
0113 // kProcedureColumnResult
0114 //
0115 //      Indicates that the column stores results. A possible value 
0116 //      for the column kCOLUMN_TYPE in the TSQLResultSet returned 
0117 //      by the  method GetProcedureColumns().
0118 //
0119 //___________________________________________________________________
0120 // kProcedureNoNulls
0121 //
0122 //      Indicates that NULL values are not allowed. A possible value 
0123 //      for the column NULLABLE in the TSQLResultSet returned by the 
0124 //      method GetProcedureColumns().
0125 //
0126 //___________________________________________________________________
0127 // kProcedureNullable
0128 //
0129 //      Indicates that NULL values are allowed. A possible value for 
0130 //      the column NULLABLE in  the TSQLResultSet returned by 
0131 //      the method  GetProcedureColumns().
0132 //
0133 //___________________________________________________________________
0134 // kProcedureNullableUnknown
0135 //
0136 //      Indicates that whether NULL values are allowed is unknown.
0137 //      A possible value for the column NULLABLE in the TSQLResultSet 
0138 //      returned by the method GetProcedureColumns().
0139 //
0140 //___________________________________________________________________
0141 // kColumnNoNulls
0142 //
0143 //      Indicates that the column might not allow NULL values. 
0144 //      A possible value for the column NULLABLE in the TSQLResultSet 
0145 //      returned by the method GetColumns().
0146 //
0147 //___________________________________________________________________
0148 // kColumnNullable
0149 //
0150 //      Indicates that the column definitely allows NULL values. 
0151 //      A possible value for the column NULLABLE in the TSQLResultSet 
0152 //      returned by the method GetColumns().
0153 //
0154 //___________________________________________________________________
0155 //  kColumnNullableUnknown
0156 //
0157 //      Indicates that the nullability of columns is unknown. 
0158 //      A possible value for the column NULLABLE in the TSQLResultSet 
0159 //      returned by the method GetColumns().
0160 //
0161 //___________________________________________________________________
0162 // kBestRowTemporary
0163 //
0164 //      Indicates that the scope of the best row identifier is very 
0165 //      temporary, lasting only  while the row is being used. 
0166 //      A possible  value for the column SCOPE in the TSQLResultSet 
0167 //      object returned  by the method GetBestRowIdentifier().
0168 //
0169 //___________________________________________________________________
0170 // kBestRowTransaction
0171 //
0172 //      Indicates that the scope of the best row identifier is the 
0173 //      remainder of the current  transaction. A possible value for 
0174 //      the column SCOPE in the TSQLResultSet object returned by
0175 //      the method GetBestRowIdentifier().
0176 //
0177 //___________________________________________________________________
0178 // kBestRowSession
0179 //
0180 //      Indicates that the scope of the best row identifier is the 
0181 //      remainder of the current  session. A possible value for the 
0182 //      column SCOPE in the TSQLResultSet object returned by 
0183 //      the method GetBestRowIdentifier().
0184 //
0185 //___________________________________________________________________
0186 // kBestRowUnknown
0187 //
0188 //      Indicates that the best row identifier may or may not be 
0189 //      a pseudo column. A possible value for the column 
0190 //      PSEUDO_COLUMN in the TSQLResultSet object returned by 
0191 //      the method GetBestRowIdentifier().
0192 //
0193 //___________________________________________________________________
0194 // kBestRowNotPseudo
0195 //
0196 //      Indicates that the best row identifier is NOT a pseudo 
0197 //      column. A possible value for the column PSEUDO_COLUMN in 
0198 //      the TSQLResultSet object returned by the method 
0199 //      GetBestRowIdentifier().
0200 //
0201 //___________________________________________________________________
0202 // kBestRowPseudo
0203 //
0204 //      Indicates that the best row identifier is a pseudo column. 
0205 //      A possible value for the column PSEUDO_COLUMN in the 
0206 //      TSQLResultSet object returned by the method  
0207 //      GetBestRowIdentifier().
0208 //
0209 //___________________________________________________________________
0210 // kVersionColumnUnknown
0211 //
0212 //      Indicates that this version column may or may not be a pseudo 
0213 //      column. A possible value for the column PSEUDO_COLUMN in 
0214 //      the TSQLResultSet object returned by the method 
0215 //      GetVersionColumns().
0216 //
0217 //___________________________________________________________________
0218 // kVersionColumnNotPseudo
0219 //
0220 //      Indicates that this version column is NOT a pseudo column. 
0221 //      A possible value for the column PSEUDO_COLUMN in the 
0222 //      TSQLResultSet object returned by the method GetVersionColumns().
0223 //
0224 //___________________________________________________________________
0225 // kVersionColumnPseudo
0226 //
0227 //      Indicates that this version column is a pseudo column. 
0228 //      A possible value for the column PSEUDO_COLUMN in the 
0229 //      TSQLResultSet object returned by the method GetVersionColumns().
0230 //
0231 //___________________________________________________________________
0232 // kImportedKeyCascade
0233 //
0234 //      A possible value for the columns UPDATE_RULE and 
0235 //    DELETE_RULE in the TSQLResultSet objects returned by the 
0236 //    methods GetImportedKeys(), GetExportedKeys(), 
0237 //    and GetCrossReference(). 
0238 //
0239 //      For the column UPDATE_RULE, it indicates that when the 
0240 //      primary key is updated, the foreign key (imported key) 
0241 //      is changed to agree with it. 
0242 //
0243 //      For the column DELETE_RULE, it indicates that when the 
0244 //      primary key is deleted, rows that imported that key 
0245 //      are deleted.
0246 //
0247 //___________________________________________________________________
0248 // kImportedKeyRestrict
0249 //
0250 //      A possible value for the columns UPDATE_RULE and DELETE_RULE 
0251 //    in the TSQLResultSet objects returned by the methods 
0252 //    GetImportedKeys(), GetExportedKeys(), and GetCrossReference(). 
0253 //
0254 //      For the column UPDATE_RULE, it indicates that a primary 
0255 //    key may not be updated if it has been imported by another 
0256 //    table as a foreign key. 
0257 //
0258 //      For the column DELETE_RULE, it indicates that a primary 
0259 //      key may not be deleted if it has been imported by another
0260 //     table as a foreign key.
0261 //
0262 //___________________________________________________________________
0263 // kImportedKeySetNull
0264 //
0265 //      A possible value for the columns UPDATE_RULE and DELETE_RULE 
0266 //    in the TSQLResultSet objects returned by the methods 
0267 //    GetImportedKeys(), GetExportedKeys(), and GetCrossReference(). 
0268 //
0269 //      For the columns UPDATE_RULE and DELETE_RULE, it indicates 
0270 //      that when the primary key is  updated or deleted, the 
0271 //      foreign key (imported key) is changed to NULL.
0272 //
0273 //___________________________________________________________________
0274 // kImportedKeyNoAction
0275 //
0276 //      A possible value for the columns UPDATE_RULE and DELETE_RULE 
0277 //      in the TSQLResultSet objects returned by the methods 
0278 //      GetImportedKeys(), GetExportedKeys(), and GetCrossReference(). 
0279 //
0280 //      For the columns UPDATE_RULE and DELETE_RULE, it indicates 
0281 //      that if the primary key has been imported, it cannot be 
0282 //     updated or deleted.
0283 //
0284 //___________________________________________________________________
0285 // kImportedKeySetDefault
0286 //
0287 //      A possible value for the columns UPDATE_RULE and DELETE_RULE
0288 //      in the TSQLResultSet objects returned by the methods 
0289 //      GetImportedKeys(), GetExportedKeys(), and GetCrossReference(). 
0290 //
0291 //      For the columns UPDATE_RULE and DELETE_RULE, it indicates 
0292 //      that if the primary key is updated or deleted, 
0293 //      the foreign key (imported key) is set to the default value.
0294 //
0295 //___________________________________________________________________
0296 // kImportedKeyInitiallyDeferred
0297 //
0298 //      A possible value for the column DEFERRABILITY in 
0299 //     the TSQLResultSet objects returned by the methods 
0300 //     GetImportedKeys(), GetExportedKeys(), and GetCrossReference(). 
0301 //
0302 //      Indicates deferrability. See SQL-92 for a definition.
0303 //
0304 //___________________________________________________________________
0305 // kImportedKeyInitiallyImmediate
0306 //
0307 //      A possible value for the column DEFERRABILITY in 
0308 //    the TSQLResultSet objects returned by the methods 
0309 //    GetImportedKeys(), GetExportedKeys(), and GetCrossReference(). 
0310 //
0311 //      Indicates deferrability. See SQL-92 for a definition.
0312 //
0313 //___________________________________________________________________
0314 // kImportedKeyNotDeferrable
0315 //
0316 //      A possible value for the column DEFERRABILITY in 
0317 //      the TSQLResultSet objects returned by the methods 
0318 //      GetImportedKeys(), GetExportedKeys(), and GetCrossReference(). 
0319 //
0320 //      Indicates deferrability. See SQL-92 for a definition.
0321 //
0322 //___________________________________________________________________
0323 // kTypeNoNulls
0324 //
0325 //      A possible value for column NULLABLE in the TSQLResultSet 
0326 //      object returned by the method GetTypeInfo(). 
0327 //
0328 //      Indicates that a NULL value is NOT allowed for 
0329 //      this data type.
0330 //
0331 //___________________________________________________________________
0332 // kTypeNullable
0333 //
0334 //      A possible value for column NULLABLE in the TSQLResultSet 
0335 //      object returned by the method GetTypeInfo(). 
0336 //
0337 //      Indicates that a NULL value is allowed for this data type.
0338 //
0339 //___________________________________________________________________
0340 // kTypeNullableUnknown
0341 //
0342 //      A possible value for column NULLABLE in the TSQLResultSet 
0343 //      object returned by the method GetTypeInfo(). 
0344 //
0345 //      Indicates that it is not known whether a NULL value 
0346 //      is allowed for this data type.
0347 //
0348 //___________________________________________________________________
0349 // kTypePredNone
0350 //
0351 //      A possible value for column SEARCHABLE in the TSQLResultSet 
0352 //      object returned by the method GetTypeInfo(). 
0353 //
0354 //      Indicates that WHERE search clauses are not supported 
0355 //      for this type.
0356 //
0357 //___________________________________________________________________
0358 // kTypePredChar
0359 //
0360 //      A possible value for column SEARCHABLE in the TSQLResultSet 
0361 //      object returned by the method GetTypeInfo(). 
0362 //
0363 //      Indicates that the only WHERE search clause that can be 
0364 //      based on this type is WHERE . . .LIKE.
0365 //
0366 //___________________________________________________________________
0367 // kTypePredBasic
0368 //
0369 //      A possible value for column SEARCHABLE in the TSQLResultSet 
0370 //    object returned by the method GetTypeInfo(). 
0371 //
0372 //      Indicates that one can base all WHERE search clauses 
0373 //      except WHERE . . .LIKE on this data type.
0374 //
0375 //___________________________________________________________________
0376 // kTypeSearchable
0377 //
0378 //      A possible value for column SEARCHABLE in the TSQLResultSet 
0379 //      object returned by the method GetTypeInfo(). 
0380 //
0381 //      Indicates that all WHERE search clauses can be based 
0382 //      on this type.
0383 //
0384 //___________________________________________________________________
0385 // kTableIndexStatistic
0386 //
0387 //      A possible value for column TYPE in the TSQLResultSet 
0388 //    object returned by the method GetIndexInfo(). 
0389 //
0390 //      Indicates that this column contains table statistics 
0391 //      that are returned in conjunction with a table's index 
0392 //      descriptions.
0393 //
0394 //___________________________________________________________________
0395 // kTableIndexClustered
0396 //
0397 //      A possible value for column TYPE in the TSQLResultSet object 
0398 //      returned by the method GetIndexInfo(). 
0399 //
0400 //      Indicates that this table index is a clustered index.
0401 //
0402 //___________________________________________________________________
0403 // kTableIndexHashed
0404 //
0405 //      A possible value for column TYPE in the TSQLResultSet object 
0406 //      returned by the method GetIndexInfo(). 
0407 //
0408 //      Indicates that this table index is a hashed index.
0409 //
0410 //___________________________________________________________________
0411 // kTableIndexOther
0412 //
0413 //      A possible value for column TYPE in the TSQLResultSet object 
0414 //      returned by the method GetIndexInfo(). 
0415 //
0416 //      Indicates that this table index is not a clustered index, 
0417 //      a hashed index, or table statistics; it is something 
0418 //      other than these.
0419 //
0420 //  See also:
0421 //       TSQLTypes TSQLConnection
0422 //
0423 /////////////////////////////////////////////////////////////////////
0424 
0425 #include "ODBCDatabaseMetaData.h"
0426 #include "ODBCResultSet.h"
0427 #include "ODBCConnection.h"
0428 #include <RDBC/odbc++/databasemetadata.h>
0429 #include <RDBC/odbc++/resultset.h>
0430 
0431 using namespace odbc;
0432 using namespace std;
0433 
0434 ClassImpQ(ODBCDatabaseMetaData)
0435             
0436 /////////////////////////////////////////////////////////////////////
0437 //___________________________________________________________________
0438 ODBCDatabaseMetaData::ODBCDatabaseMetaData(TSQLConnection* connection,void* imp):
0439          TSQLDatabaseMetaData(connection,imp)
0440 {
0441    // constructor
0442 
0443 }
0444 
0445 //___________________________________________________________________
0446 ODBCDatabaseMetaData::~ODBCDatabaseMetaData()
0447 {
0448    // destructor will be called when fConnection is deleted 
0449 
0450    fConnection = 0;
0451    
0452    //fImp deleted when fConnection->fImp is deleted
0453 }
0454 
0455 //___________________________________________________________________
0456 Bool_t ODBCDatabaseMetaData::AllProceduresAreCallable()
0457 {
0458    // Can all the procedures returned by GetProcedures be 
0459    // called by the current user?
0460    //
0461    //   Returns:
0462    //         kTRUE if so; kFALSE otherwise
0463    //   Throws:
0464    //         TSQLException - if a database access error occurs
0465 
0466    Bool_t return_value = kFALSE;
0467    
0468    if(!fImp) { Destroyed();   return return_value; } 
0469    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
0470      
0471    try {      
0472       return_value = imp->allProceduresAreCallable();
0473 
0474    } catch(odbc::SQLException& e) {
0475       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
0476                                 ODBCXX_STRING_CSTR(e.getSQLState()),
0477                                 e.getErrorCode()) );
0478       return kFALSE;
0479    }   
0480    return return_value;
0481 }
0482 
0483 //___________________________________________________________________
0484 Bool_t ODBCDatabaseMetaData::AllTablesAreSelectable()
0485 {
0486    // Can all the tables returned by GetTable() be SELECTed by 
0487    // the current user?
0488    //
0489    //   Returns:
0490    //         kTRUE if so; kFALSE otherwise
0491    //   Throws:
0492    //         TSQLException - if a database access error occurs
0493 
0494    Bool_t return_value = kFALSE;
0495    
0496    if(!fImp) { Destroyed();   return return_value; } 
0497    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
0498    
0499    try {      
0500       return_value = imp->allTablesAreSelectable();
0501 
0502    } catch(odbc::SQLException& e) {
0503       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
0504                                 ODBCXX_STRING_CSTR(e.getSQLState()),
0505                                 e.getErrorCode()) );
0506       return kFALSE;
0507    }   
0508    return return_value;
0509 }
0510 
0511 //___________________________________________________________________
0512 TString ODBCDatabaseMetaData::GetUserName()
0513 {
0514    // What's our user name as known to the database?
0515    //
0516    //   Returns:
0517    //        our database user name
0518    //   Throws:
0519    //         TSQLException - if a database access error occurs
0520    //
0521    // ... more comments based on  "ODBC 3.5 Developer's Guide"
0522    //
0523    // Identifies the user name in a particular database
0524    // (this name can be different from the login name)
0525    //
0526    
0527    TString str;
0528    
0529    if(!fImp) { Destroyed();   return str; } 
0530    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
0531    
0532    try {  
0533       str = ODBCXX_STRING_CSTR( imp->getUserName() );
0534 
0535    } catch(odbc::SQLException& e) {
0536       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
0537                                 ODBCXX_STRING_CSTR(e.getSQLState()),
0538                                 e.getErrorCode()) );
0539       return "";
0540    }   
0541    return str;
0542 }
0543 
0544 //___________________________________________________________________
0545 Bool_t ODBCDatabaseMetaData::IsReadOnly()
0546 {
0547    // Is the database in read-only mode?
0548    //
0549    //   Returns:
0550    //         kTRUE if so; kFALSE otherwise
0551    //   Throws:
0552    //         TSQLException - if a database access error occurs
0553    //
0554    // ... more comments based on  "ODBC 3.5 Developer's Guide"
0555    //
0556    // This characteristic pertains only to the data source itself; 
0557    // it is not a characteristic of the driver that enables access 
0558    // to the data source. A driver that is read/write can be used 
0559    // with a data source that is read-only.
0560    // 
0561    // If a driver is read-only, all its data sources must be read-only
0562    // and must return kTRUE for this method
0563    //
0564 
0565    Bool_t return_value = kTRUE;
0566    
0567    if(!fImp) { Destroyed();   return return_value; } 
0568    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
0569       
0570    try {      
0571       return_value = imp->isReadOnly();
0572 
0573    } catch(odbc::SQLException& e) {
0574       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
0575                                 ODBCXX_STRING_CSTR(e.getSQLState()),
0576                                 e.getErrorCode()) );
0577       return kTRUE;
0578    }   
0579    return return_value;
0580 }
0581 
0582 //___________________________________________________________________
0583 Bool_t ODBCDatabaseMetaData::NullsAreSortedHigh()
0584 {
0585    // Are NULL values sorted high?
0586    //
0587    //   Returns:
0588    //         kTRUE if so; kFALSE otherwise
0589    //   Throws:
0590    //         TSQLException - if a database access error occurs
0591    //
0592    // Identifies where NULL values are sorted in a result data set
0593    //
0594 
0595    Bool_t return_value = kFALSE;
0596    
0597    if(!fImp) { Destroyed();   return return_value; } 
0598    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
0599    
0600    try {
0601       return_value = imp->nullsAreSortedHigh();
0602 
0603    } catch(odbc::SQLException& e) {
0604       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
0605                                 ODBCXX_STRING_CSTR(e.getSQLState()),
0606                                 e.getErrorCode()) );
0607       return kFALSE;
0608    }   
0609    return return_value;
0610 }
0611 
0612 //___________________________________________________________________
0613 Bool_t ODBCDatabaseMetaData::NullsAreSortedLow()
0614 {
0615    // Are NULL values sorted low?
0616    //
0617    //   Returns:
0618    //         kTRUE if so; kFALSE otherwise
0619    //   Throws:
0620    //         TSQLException - if a database access error occurs
0621    //
0622    // Identifies where NULL values are sorted in a result data set
0623    //   
0624 
0625    Bool_t return_value = kFALSE;
0626    
0627    if(!fImp) { Destroyed();   return return_value; } 
0628    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
0629    
0630    try {      
0631       return_value = imp->nullsAreSortedLow();
0632 
0633    } catch(odbc::SQLException& e) {
0634       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
0635                                 ODBCXX_STRING_CSTR(e.getSQLState()),
0636                                 e.getErrorCode()) );
0637       return kFALSE;
0638    }   
0639    return return_value;
0640 }
0641 
0642 //___________________________________________________________________
0643 Bool_t ODBCDatabaseMetaData::NullsAreSortedAtStart()
0644 {
0645    // Are NULL values sorted at the start regardless of sort order?
0646    //
0647    //   Returns:
0648    //         kTRUE if so; kFALSE otherwise
0649    //   Throws:
0650    //         TSQLException - if a database access error occurs
0651    //
0652    // Identifies where NULL values are sorted in a result data set
0653    //   
0654 
0655    Bool_t return_value = kFALSE;
0656 
0657    if(!fImp) { Destroyed();   return return_value; } 
0658    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
0659       
0660    try { 
0661       return_value = imp->nullsAreSortedAtStart();
0662 
0663    } catch(odbc::SQLException& e) {
0664       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
0665                                 ODBCXX_STRING_CSTR(e.getSQLState()),
0666                                 e.getErrorCode()) );
0667       return kFALSE;
0668    }   
0669    return return_value;
0670 }
0671 
0672 //___________________________________________________________________
0673 Bool_t ODBCDatabaseMetaData::NullsAreSortedAtEnd()
0674 {
0675    // Are NULL values sorted at the end regardless of sort order?
0676    //
0677    //  Returns:
0678    //        kTRUE if so; kFALSE otherwise
0679    //  Throws:
0680    //        TSQLException - if a database access error occurs
0681    //
0682    // Identifies where NULL values are sorted in a result data set
0683    //
0684    
0685    Bool_t return_value = kFALSE;
0686    
0687    if(!fImp) { Destroyed();   return return_value; } 
0688    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;   
0689    
0690    try {      
0691       return_value = imp->nullsAreSortedAtEnd();
0692 
0693    } catch(odbc::SQLException& e) {
0694       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
0695                                 ODBCXX_STRING_CSTR(e.getSQLState()),
0696                                 e.getErrorCode()) );
0697       return kFALSE;
0698    }   
0699    return return_value;
0700 }
0701 
0702 //___________________________________________________________________
0703 TString ODBCDatabaseMetaData::GetDatabaseProductName()
0704 {
0705    // What's the name of this database product?
0706    //
0707    //   Returns:
0708    //         database product name
0709    //   Throws:
0710    //         TSQLException - if a database access error occurs
0711 
0712    TString str;
0713    
0714    if(!fImp) { Destroyed();   return str; } 
0715    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
0716       
0717    try { 
0718       str = ODBCXX_STRING_CSTR( imp->getDatabaseProductName() );
0719 
0720    } catch(odbc::SQLException& e) {
0721       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
0722                                 ODBCXX_STRING_CSTR(e.getSQLState()),
0723                                 e.getErrorCode()) );
0724       return "";
0725    }   
0726    return str;
0727 }
0728 
0729 //___________________________________________________________________
0730 TString ODBCDatabaseMetaData::GetDatabaseProductVersion()
0731 {
0732    // What's the version of this database product?
0733    //
0734    // ... more comments based on  "ODBC 3.5 Developer's Guide"
0735    //
0736    // This information returned in a string that has format
0737    // mm.vv.rrrr, where mm is the major version number,
0738    // vv is the minor version number, and rrrr is the release
0739    // virsion number. 
0740    //
0741    //   Returns:
0742    //         database version
0743    //   Throws:
0744    //         TSQLException - if a database access error occurs
0745 
0746    TString str;
0747 
0748    if(!fImp) { Destroyed();   return str; } 
0749    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
0750       
0751    try {  
0752       str = ODBCXX_STRING_CSTR( imp->getDatabaseProductVersion() );
0753 
0754    } catch(odbc::SQLException& e) {
0755       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
0756                                 ODBCXX_STRING_CSTR(e.getSQLState()),
0757                                 e.getErrorCode()) );
0758       return "";
0759    }   
0760    return str;
0761 }
0762 
0763 //___________________________________________________________________
0764 TString ODBCDatabaseMetaData::GetDriverName()
0765 {
0766    // What's the name of this ODBC driver?
0767    //
0768    //   Returns:
0769    //         driver name
0770    //   Throws:
0771    //         TSQLException - if a database access error occurs
0772 
0773    TString str;
0774    
0775    if(!fImp) { Destroyed();   return str; } 
0776    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
0777       
0778    try {  
0779       str = ODBCXX_STRING_CSTR( imp->getDriverName() );
0780 
0781    } catch(odbc::SQLException& e) {
0782       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
0783                                 ODBCXX_STRING_CSTR(e.getSQLState()),
0784                                 e.getErrorCode()) );
0785       return "";
0786    }   
0787    return str;
0788 }
0789 
0790 //___________________________________________________________________
0791 TString ODBCDatabaseMetaData::GetDriverVersion()
0792 {
0793    // What's the version of this ODBC driver?
0794    //
0795    // ... more comments based on  "ODBC 3.5 Developer's Guide"
0796    //
0797    // This information returned in a string that has format
0798    // mm.vv.rrrr, where mm is the major version number,
0799    // vv is the minor version number, and rrrr is the release
0800    // virsion number 
0801    //   
0802    //   Returns:
0803    //         driver version
0804    //   Throws:
0805    //         TSQLException - if a database access error occurs
0806 
0807    TString str;
0808    
0809    if(!fImp) { Destroyed();   return str; } 
0810    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
0811       
0812    try {  
0813       str = ODBCXX_STRING_CSTR( imp->getDriverVersion() );
0814 
0815    } catch(odbc::SQLException& e) {
0816       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
0817                                 ODBCXX_STRING_CSTR(e.getSQLState()),
0818                                 e.getErrorCode()) );
0819       return "";
0820    }   
0821    return str;
0822 }
0823 
0824 //___________________________________________________________________
0825 Int_t ODBCDatabaseMetaData::GetDriverMajorVersion()
0826 {
0827    // What's this driver's major version number?
0828    //
0829    //   Returns:
0830    //         driver major version
0831 
0832    Int_t return_value = 0;
0833    
0834    if(!fImp) { Destroyed();   return return_value; } 
0835    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
0836    
0837    try {      
0838       return_value = imp->getDriverMajorVersion();
0839 
0840    } catch(odbc::SQLException& e) {
0841       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
0842                                 ODBCXX_STRING_CSTR(e.getSQLState()),
0843                                 e.getErrorCode()) );
0844       return 0;
0845    }   
0846    return return_value;
0847 }
0848 
0849 //___________________________________________________________________
0850 Int_t ODBCDatabaseMetaData::GetDriverMinorVersion()
0851 {
0852    // What's this driver's minor version number?
0853    //
0854    //   Returns:
0855    //         driver minor version number
0856 
0857    Int_t return_value = 0;
0858    
0859    if(!fImp) { Destroyed();   return return_value; } 
0860    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
0861    
0862    try {      
0863       return_value = imp->getDriverMinorVersion();
0864 
0865    } catch(odbc::SQLException& e) {
0866       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
0867                                 ODBCXX_STRING_CSTR(e.getSQLState()),
0868                                 e.getErrorCode()) );
0869       return 0;
0870    }   
0871    return return_value;
0872 }
0873 
0874 //___________________________________________________________________
0875 Bool_t ODBCDatabaseMetaData::UsesLocalFiles()
0876 {
0877    // Does the database store tables in a local file?
0878    //
0879    //   Returns:
0880    //         kTRUE if so; kFALSE otherwise
0881    //   Throws:
0882    //         TSQLException - if a database access error occurs
0883    //
0884    // ... more comments based on  "ODBC 3.5 Developer's Guide"
0885    //
0886    // kFALSE means that driver is a not single-tier driver
0887    // thereore files are not supported
0888 
0889    Bool_t return_value = kFALSE;
0890    
0891    if(!fImp) { Destroyed();   return return_value; } 
0892    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;      
0893    
0894    try {
0895       return_value = imp->usesLocalFiles();
0896 
0897    } catch(odbc::SQLException& e) {
0898       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
0899                                 ODBCXX_STRING_CSTR(e.getSQLState()),
0900                                 e.getErrorCode()) );
0901       return kFALSE;
0902    }   
0903    return return_value;
0904 }
0905 
0906 //___________________________________________________________________
0907 Bool_t ODBCDatabaseMetaData::UsesLocalFilePerTable()
0908 {
0909    // Does the database use a file for each table?
0910    //
0911    //   Returns:
0912    //         kTRUE if the database uses a local file for each table
0913    //   Throws:
0914    //         TSQLException - if a database access error occurs
0915    //
0916    // ... more comments based on  "ODBC 3.5 Developer's Guide"
0917    //
0918    // The single-tier driver treats files in a data source as
0919    // tables
0920    //
0921 
0922    Bool_t return_value = kFALSE;
0923    
0924    if(!fImp) { Destroyed();   return return_value; } 
0925    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
0926       
0927    try {      
0928       return_value = imp->usesLocalFilePerTable();
0929 
0930    } catch(odbc::SQLException& e) {
0931       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
0932                                 ODBCXX_STRING_CSTR(e.getSQLState()),
0933                                 e.getErrorCode()) );
0934       return kFALSE;
0935    }   
0936    return return_value;
0937 }
0938 
0939 //___________________________________________________________________
0940 Bool_t ODBCDatabaseMetaData::SupportsMixedCaseIdentifiers()
0941 {
0942    // Does the database treat mixed case unquoted SQL identifiers 
0943    // as case sensitive and as a result store them in mixed case? 
0944    // A SQL-92 complient driver will always return kFALSE.
0945    //
0946    //   Returns:
0947    //         kTRUE if so; kFALSE otherwise
0948    //   Throws:
0949    //         TSQLException - if a database access error occurs
0950 
0951    Bool_t return_value = kFALSE;
0952    
0953    if(!fImp) { Destroyed();   return return_value; } 
0954    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
0955    
0956    try {      
0957       return_value = imp->supportsMixedCaseIdentifiers();
0958 
0959    } catch(odbc::SQLException& e) {
0960       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
0961                                 ODBCXX_STRING_CSTR(e.getSQLState()),
0962                                 e.getErrorCode()) );
0963       return kFALSE;
0964    }   
0965    return return_value;
0966 }
0967 
0968 //___________________________________________________________________
0969 Bool_t ODBCDatabaseMetaData::StoresUpperCaseIdentifiers()
0970 {
0971    // Does the database treat mixed case unquoted SQL identifiers 
0972    // as case insensitive and store them in upper case?
0973    //
0974    //   Returns:
0975    //         kTRUE if so; kFALSE otherwise
0976    //   Throws:
0977    //         TSQLException - if a database access error occurs
0978 
0979    Bool_t return_value = kFALSE;
0980    
0981    if(!fImp) { Destroyed();   return return_value; } 
0982    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
0983    
0984    try {      
0985       return_value = imp->storesUpperCaseIdentifiers();
0986 
0987    } catch(odbc::SQLException& e) {
0988       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
0989                                 ODBCXX_STRING_CSTR(e.getSQLState()),
0990                                 e.getErrorCode()) );
0991       return kFALSE;
0992    }   
0993    return return_value;
0994 }
0995 
0996 //___________________________________________________________________
0997 Bool_t ODBCDatabaseMetaData::StoresLowerCaseIdentifiers()
0998 {
0999    // Does the database treat mixed case unquoted SQL identifiers 
1000    // as case insensitive and store them in lower case?
1001    //
1002    //   Returns:
1003    //         kTRUE if so; kFALSE otherwise
1004    //   Throws:
1005    //         TSQLException - if a database access error occurs
1006 
1007    Bool_t return_value = kFALSE;   
1008 
1009    if(!fImp) { Destroyed();   return return_value; } 
1010    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1011    
1012    try {      
1013       return_value = imp->storesLowerCaseIdentifiers();
1014 
1015    } catch(odbc::SQLException& e) {
1016       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1017                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1018                                 e.getErrorCode()) );
1019       return kFALSE;
1020    }   
1021    return return_value;
1022 }
1023 
1024 //___________________________________________________________________
1025 Bool_t ODBCDatabaseMetaData::StoresMixedCaseIdentifiers()
1026 {
1027    // Does the database treat mixed case unquoted SQL identifiers 
1028    // as case insensitive and store them in mixed case?
1029    //
1030    //   Returns:
1031    //         kTRUE if so; kFALSE otherwise
1032    //   Throws:
1033    //         TSQLException - if a database access error occurs
1034 
1035    Bool_t return_value = kFALSE;
1036 
1037    if(!fImp) { Destroyed();   return return_value; } 
1038    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1039       
1040    try {      
1041       return_value = imp->storesMixedCaseIdentifiers();
1042 
1043    } catch(odbc::SQLException& e) {
1044       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1045                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1046                                 e.getErrorCode()) );
1047       return kFALSE;
1048    }   
1049    return return_value;
1050 }
1051 
1052 //___________________________________________________________________
1053 Bool_t ODBCDatabaseMetaData::SupportsMixedCaseQuotedIdentifiers()
1054 {
1055    // Does the database treat mixed case quoted SQL identifiers 
1056    // as case sensitive and as a result store them in mixed case? 
1057    // A SQL-92 entry level-conformant driver will always 
1058    // return kTRUE.
1059    //
1060    //   Returns:
1061    //         kTRUE if so; kFALSE otherwise
1062    //   Throws:
1063    //         TSQLException - if a database access error occurs
1064 
1065    Bool_t return_value = kFALSE;
1066 
1067    if(!fImp) { Destroyed();   return return_value; } 
1068    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1069    
1070    try {      
1071       return_value = imp->supportsMixedCaseQuotedIdentifiers();
1072 
1073    } catch(odbc::SQLException& e) {
1074       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1075                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1076                                 e.getErrorCode()) );
1077       return kFALSE;
1078    }   
1079    return return_value;
1080 }
1081 
1082 //___________________________________________________________________
1083 Bool_t ODBCDatabaseMetaData::StoresUpperCaseQuotedIdentifiers()
1084 {
1085    // Does the database treat mixed case quoted SQL identifiers 
1086    // as case insensitive and store them in upper case?
1087    //
1088    //   Returns:
1089    //         kTRUE if so; kFALSE otherwise
1090    //   Throws:
1091    //         TSQLException - if a database access error occurs
1092 
1093    Bool_t return_value = kFALSE;
1094    
1095    if(!fImp) { Destroyed();   return return_value; } 
1096    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1097    
1098    try {      
1099       return_value = imp->storesUpperCaseQuotedIdentifiers();
1100 
1101    } catch(odbc::SQLException& e) {
1102       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1103                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1104                                 e.getErrorCode()) );
1105       return kFALSE;
1106    }   
1107    return return_value;
1108 }
1109 
1110 //___________________________________________________________________
1111 Bool_t ODBCDatabaseMetaData::StoresLowerCaseQuotedIdentifiers()
1112 {
1113    // Does the database treat mixed case quoted SQL identifiers 
1114    // as case insensitive and store them in lower case?
1115    //
1116    //   Returns:
1117    //         kTRUE if so; kFALSE otherwise
1118    //   Throws:
1119    //         TSQLException - if a database access error occurs
1120 
1121    Bool_t return_value = kFALSE;
1122    
1123    if(!fImp) { Destroyed();   return return_value; } 
1124    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1125    
1126    try {      
1127       return_value = imp->storesLowerCaseQuotedIdentifiers(); 
1128 
1129    } catch(odbc::SQLException& e) {
1130       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1131                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1132                                 e.getErrorCode()) );
1133       return kFALSE;
1134    }   
1135    return return_value;
1136 }
1137 
1138 //___________________________________________________________________
1139 Bool_t ODBCDatabaseMetaData::StoresMixedCaseQuotedIdentifiers()
1140 {
1141    // Does the database treat mixed case quoted SQL identifiers 
1142    // as case insensitive and store them in mixed case?
1143    //
1144    //   Returns:
1145    //         kTRUE if so; kFALSE otherwise
1146    //   Throws:
1147    //         TSQLException - if a database access error occurs
1148 
1149    Bool_t return_value = kFALSE;
1150    
1151    if(!fImp) { Destroyed();   return return_value; } 
1152    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1153    
1154    try {      
1155       return_value = imp->storesMixedCaseQuotedIdentifiers();
1156 
1157    } catch(odbc::SQLException& e) {
1158       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1159                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1160                                 e.getErrorCode()) );
1161       return kFALSE;
1162    }   
1163    return return_value;
1164 }
1165 
1166 //___________________________________________________________________
1167 TString ODBCDatabaseMetaData::GetIdentifierQuoteString()
1168 {
1169    // What's the string used to quote SQL identifiers? 
1170    // This returns a space " " if identifier quoting isn't supported. 
1171    // A SQL-92 Full level-conformant  driver always uses a double
1172    // quote character (").
1173    //
1174    //   Returns:
1175    //         the quoting string
1176    //   Throws:
1177    //         TSQLException - if a database access error occurs
1178    //
1179    // ... more comments based on  "ODBC 3.5 Developer's Guide"
1180    //
1181    // Identifies the character tht is to be used as the starting and
1182    // ending delimeter of a quoted(delimetered) identifier in SQL
1183    // statements. (Identifiers passed in ODBC function parameters
1184    // do not need to be quoted) This character can also be used for
1185    // quoting catalog function parameters when ...
1186    // 
1187    // If the data source does not support quoted identifiers,
1188    // a blank string (" ") is returned
1189    //
1190    
1191    TString str;
1192    
1193    if(!fImp) { Destroyed();   return str; } 
1194    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1195          
1196    try { 
1197       str = ODBCXX_STRING_CSTR( imp->getIdentifierQuoteString() );
1198 
1199    } catch(odbc::SQLException& e) {
1200       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1201                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1202                                 e.getErrorCode()) );
1203       return "";
1204    }   
1205    return str;
1206 }
1207 
1208 //___________________________________________________________________
1209 TString ODBCDatabaseMetaData::GetSQLKeywords()
1210 {
1211    // Gets a comma-separated list of all a database's SQL keywords 
1212    // that are NOT also SQL92 keywords.
1213    //
1214    //   Returns:
1215    //         the list
1216    //   Throws:
1217    //         TSQLException - if a database access error occurs
1218 
1219    TString str;
1220    if(!fImp) { Destroyed();   return str; } 
1221    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1222      
1223    try {  
1224       str = ODBCXX_STRING_CSTR( imp->getSQLKeywords() );
1225 
1226    } catch(odbc::SQLException& e) {
1227       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1228                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1229                                 e.getErrorCode()) );
1230       return "";
1231    }   
1232    return str;
1233 }
1234 
1235 //___________________________________________________________________
1236 TString ODBCDatabaseMetaData::GetNumericFunctions()
1237 {
1238    // Gets a comma-separated list of math functions. 
1239    // These are the X/Open CLI math function names used in the ODBC 
1240    // function escape clause.
1241    //
1242    //   Returns:
1243    //         the list
1244    //    Throws:
1245    //         TSQLException - if a database access error occurs
1246   
1247    TString str;
1248    
1249    if(!fImp) { Destroyed();   return str; } 
1250    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1251    
1252    try {  
1253       str = ODBCXX_STRING_CSTR( imp->getNumericFunctions() );
1254 
1255    } catch(odbc::SQLException& e) {
1256       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1257                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1258                                 e.getErrorCode()) );
1259       return "";
1260    }   
1261    return str;
1262 }
1263 
1264 //___________________________________________________________________
1265 TString ODBCDatabaseMetaData::GetStringFunctions()
1266 {
1267    // Gets a comma-separated list of string functions. 
1268    // These are the X/Open CLI string function names used in the 
1269    // ODBC function escape clause.
1270    //
1271    //   Returns:
1272    //         the list
1273    //   Throws:
1274    //         TSQLException - if a database access error occurs
1275 
1276    TString str;
1277    
1278    if(!fImp) { Destroyed();   return str; } 
1279    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1280    
1281    try {  
1282       str = ODBCXX_STRING_CSTR( imp->getStringFunctions() );
1283 
1284    } catch(odbc::SQLException& e) {
1285       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1286                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1287                                 e.getErrorCode()) );
1288       return "";
1289    }   
1290    return str;
1291 }
1292 
1293 //___________________________________________________________________
1294 TString ODBCDatabaseMetaData::GetSystemFunctions()
1295 {
1296    // Gets a comma-separated list of system functions. 
1297    // These are the X/Open CLI system function names used in the 
1298    // ODBC function escape clause.
1299    //
1300    //   Returns:
1301    //         the list
1302    //   Throws:
1303    //         TSQLException - if a database access error occurs
1304 
1305    TString str;
1306    
1307    if(!fImp) { Destroyed();   return str; } 
1308    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1309       
1310    try {  
1311       str = ODBCXX_STRING_CSTR( imp->getSystemFunctions());
1312 
1313    } catch(odbc::SQLException& e) {
1314       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1315                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1316                                 e.getErrorCode()) );
1317       return "";
1318    }   
1319    return str;
1320 }
1321 
1322 //___________________________________________________________________
1323 TString ODBCDatabaseMetaData::GetTimeDateFunctions()
1324 {
1325    // Gets a comma-separated list of time and date functions.
1326    //
1327    //   Returns:
1328    //         the list
1329    //   Throws:
1330    //         TSQLException - if a database access error occurs
1331 
1332    TString str;
1333    
1334    if(!fImp) { Destroyed();   return str; } 
1335    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1336    
1337    try {  
1338       str = ODBCXX_STRING_CSTR( imp->getTimeDateFunctions() );
1339 
1340 
1341    } catch(odbc::SQLException& e) {
1342       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1343                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1344                                 e.getErrorCode()) );
1345       return "";
1346    }   
1347    return str;
1348 }
1349 
1350 //___________________________________________________________________
1351 TString ODBCDatabaseMetaData::GetSearchStringEscape()
1352 {
1353    // Gets the string that can be used to escape wildcard characters. 
1354    // This is the string that can be used to escape '_' or '%' in 
1355    // the string pattern style catalog search parameters. 
1356    //
1357    //   The '_' character represents any single character. 
1358    //
1359    //   The '%' character represents any sequence of zero or more 
1360    //    characters.
1361    //
1362    //   Returns:
1363    //         the string used to escape wildcard characters
1364    //   Throws:
1365    //         TSQLException - if a database access error occurs
1366    //
1367    // ... more comments based on  "ODBC 3.5 Developer's Guide"
1368    //
1369    // If driver does not provide a search-pattern escape character,
1370    // there is no specified limit, or if limit is unknown, an
1371    // empt string (" ") is returned.
1372    
1373    TString str;
1374    
1375    if(!fImp) { Destroyed();   return str; } 
1376    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1377       
1378    try {   
1379       str = ODBCXX_STRING_CSTR( imp->getSearchStringEscape() );
1380 
1381    } catch(odbc::SQLException& e) {
1382       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1383                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1384                                 e.getErrorCode()) );
1385       return "";
1386    }   
1387    return str;
1388 }
1389 
1390 //___________________________________________________________________
1391 TString ODBCDatabaseMetaData::GetExtraNameCharacters()
1392 {
1393    // Gets all the "extra" characters that can be used in unquoted 
1394    // identifier names ( those beyond a-z, A-Z, 0-9 and _ ),
1395    // for example, a table, column or index name.
1396    //
1397    //   Returns:
1398    //         the string containing the extra characters
1399    //   Throws:
1400    //         TSQLException - if a database access error occurs
1401 
1402    TString str;
1403    
1404    if(!fImp) { Destroyed();   return str; } 
1405    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1406    
1407    try {
1408       str = ODBCXX_STRING_CSTR( imp->getExtraNameCharacters() );
1409 
1410    } catch(odbc::SQLException& e) {
1411       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1412                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1413                                 e.getErrorCode()) );
1414       return "";
1415    }   
1416    return str;
1417 }
1418 
1419 //___________________________________________________________________
1420 Bool_t ODBCDatabaseMetaData::SupportsAlterTableWithAddColumn()
1421 {
1422    // Is "ALTER TABLE" with add column supported?
1423    //
1424    //   Returns:
1425    //         kTRUE if so; kFALSE otherwise
1426    //   Throws:
1427    //         TSQLException - if a database access error occurs
1428 
1429    Bool_t return_value = kFALSE;
1430    
1431    if(!fImp) { Destroyed();   return return_value; } 
1432    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1433    
1434    try {      
1435       return_value = imp->supportsAlterTableWithAddColumn();
1436 
1437    } catch(odbc::SQLException& e) {
1438       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1439                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1440                                 e.getErrorCode()) );
1441       return kFALSE;
1442    }   
1443    return return_value;
1444 }
1445 
1446 //___________________________________________________________________
1447 Bool_t ODBCDatabaseMetaData::SupportsAlterTableWithDropColumn()
1448 {
1449    // Is "ALTER TABLE" with drop column supported?
1450    //
1451    //   Returns:
1452    //         kTRUE if so; kFALSE otherwise
1453    //   Throws:
1454    //         TSQLException - if a database access error occurs
1455 
1456    Bool_t return_value = kFALSE;
1457    
1458    if(!fImp) { Destroyed();   return return_value; } 
1459    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1460    
1461    try {      
1462       return_value = imp->supportsAlterTableWithDropColumn();
1463 
1464    } catch(odbc::SQLException& e) {
1465       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1466                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1467                                 e.getErrorCode()) );
1468       return kFALSE;
1469    }   
1470    return return_value;
1471 }
1472 
1473 //___________________________________________________________________
1474 Bool_t ODBCDatabaseMetaData::SupportsColumnAliasing()
1475 {
1476    // Is column aliasing supported? 
1477    //
1478    //  If so, the SQL "AS" clause can be used to provide names 
1479    // for computed columns or to provide alias names for columns 
1480    // as required. A SQL-92 entry level-conformant driver always 
1481    // returns kTRUE.
1482    //
1483    //   Returns:
1484    //         kTRUE if so; kFALSE otherwise
1485    //   Throws:
1486    //         TSQLException - if a database access error occurs
1487 
1488    Bool_t return_value = kFALSE;
1489    
1490    if(!fImp) { Destroyed();   return return_value; } 
1491    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1492    
1493    try {
1494       return_value = imp->supportsColumnAliasing();
1495 
1496    } catch(odbc::SQLException& e) {
1497       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1498                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1499                                 e.getErrorCode()) );
1500       return kFALSE;
1501    }   
1502    return return_value;
1503 }
1504 
1505 //___________________________________________________________________
1506 Bool_t ODBCDatabaseMetaData::NullPlusNonNullIsNull()
1507 {
1508    // Are concatenations between NULL and non-NULL values NULL? 
1509    // A SQL-92 entry level-conformant driver always returns kTRUE.
1510    //
1511    //   Returns:
1512    //         kTRUE if so; kFALSE otherwise
1513    //   Throws:
1514    //         TSQLException - if a database access error occurs
1515 
1516    Bool_t return_value = kFALSE;
1517    
1518    if(!fImp) { Destroyed();   return return_value; } 
1519    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1520    
1521    try {
1522       return_value = imp->nullPlusNonNullIsNull();
1523 
1524    } catch(odbc::SQLException& e) {
1525       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1526                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1527                                 e.getErrorCode()) );
1528       return kFALSE;
1529    }   
1530    return return_value;
1531 }
1532 
1533 //___________________________________________________________________
1534 Bool_t ODBCDatabaseMetaData::SupportsConvert()
1535 {
1536    // Is the CONVERT function between SQL types supported?
1537    //
1538    //   Returns:
1539    //         kTRUE if so; kFALSE otherwise
1540    //   Throws:
1541    //         TSQLException - if a database access error occurs
1542 
1543    Bool_t return_value = kFALSE;
1544    
1545    if(!fImp) { Destroyed();   return return_value; } 
1546    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1547    
1548    try {
1549       return_value = imp->supportsConvert();
1550 
1551    } catch(odbc::SQLException& e) {
1552       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1553                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1554                                 e.getErrorCode()) );
1555       return kFALSE;
1556    }   
1557    return return_value;
1558 }
1559 
1560 //___________________________________________________________________
1561 Bool_t ODBCDatabaseMetaData::SupportsConvert( Int_t fromType,
1562                                               Int_t toType )
1563 {
1564    // Is CONVERT between the given SQL types supported?
1565    //
1566    //   Parameters:
1567    //         fromType - the type to convert from
1568    //         toType - the type to convert to
1569    //
1570    //   Returns:
1571    //         kTRUE if so; kFALSE otherwise
1572    //   Throws:
1573    //         TSQLException - if a database access error occurs
1574    //   See Also: 
1575    //         TSQLTypes.h
1576    //
1577    //
1578    // ... more comments based on  "ODBC 3.5 Developer's Guide"
1579    //   
1580    // Identifiers whether the specified data type conversion
1581    // is supported by the data source and the CONVERT()
1582    // scalar function. For example, to find out if a data
1583    // source supports the conversion of a SQL_INTEGER data
1584    // type to an SQL_BIGINT data type, an application calls
1585    // SupportsConvert(kINTEGER,kBIGINT)
1586    // If the resulting value is kTRUE, the data type conversion
1587    // is supported.
1588    
1589    Bool_t return_value = kFALSE;
1590    
1591    if(!fImp) { Destroyed();   return return_value; } 
1592    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;   
1593    
1594    try {
1595       return_value = imp->supportsConvert( fromType,toType);
1596 
1597    } catch(odbc::SQLException& e) {
1598       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1599                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1600                                 e.getErrorCode()) );
1601       return kFALSE;
1602    }   
1603    return return_value;
1604 }
1605 
1606 //___________________________________________________________________
1607 Bool_t ODBCDatabaseMetaData::SupportsTableCorrelationNames()
1608 {
1609    // Are table correlation names supported? 
1610    // A SQL-92 entry level-conformant driver always returns kTRUE.
1611    //
1612    //   Returns:
1613    //         kTRUE if so; kFALSE otherwise
1614    //   Throws:
1615    //         TSQLException - if a database access error occurs
1616 
1617    Bool_t return_value = kFALSE;
1618    
1619    if(!fImp) { Destroyed();   return return_value; } 
1620    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1621    
1622    try {
1623       return_value = imp->supportsTableCorrelationNames();
1624 
1625    } catch(odbc::SQLException& e) {
1626       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1627                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1628                                 e.getErrorCode()) );
1629       return kFALSE;
1630    }   
1631    return return_value;
1632 }
1633 
1634 //___________________________________________________________________
1635 Bool_t ODBCDatabaseMetaData::SupportsDifferentTableCorrelationNames()
1636 {
1637    // If table correlation names are supported, are they restricted
1638    // to be different from the names of the tables?
1639    //
1640    //   Returns:
1641    //         kTRUE if so; kFALSE otherwise
1642    //   Throws:
1643    //         TSQLException - if a database access error occurs
1644 
1645    Bool_t return_value = kFALSE;
1646    
1647    if(!fImp) { Destroyed();   return return_value; } 
1648    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1649    
1650    try {      
1651       return_value = imp->supportsDifferentTableCorrelationNames();
1652 
1653    } catch(odbc::SQLException& e) {
1654       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1655                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1656                                 e.getErrorCode()) );
1657       return kFALSE;
1658    }   
1659    return return_value;
1660 }
1661 
1662 //___________________________________________________________________
1663 Bool_t ODBCDatabaseMetaData::SupportsExpressionsInOrderBy()
1664 {
1665    // Are expressions in "ORDER BY" lists supported?
1666    //
1667    //   Returns:
1668    //         kTRUE if so; kFALSE otherwise
1669    //   Throws:
1670    //         TSQLException - if a database access error occurs
1671 
1672    Bool_t return_value = kFALSE;
1673    
1674    if(!fImp) { Destroyed();   return return_value; } 
1675    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1676    
1677    try {
1678       return_value = imp->supportsExpressionsInOrderBy(); 
1679 
1680    } catch(odbc::SQLException& e) {
1681       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1682                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1683                                 e.getErrorCode()) );
1684       return kFALSE;
1685    }   
1686    return return_value;
1687 }
1688 
1689 //___________________________________________________________________
1690 Bool_t ODBCDatabaseMetaData::SupportsOrderByUnrelated()
1691 {
1692    // Can an "ORDER BY" clause use columns not in the 
1693    // SELECT statement?
1694    //
1695    //   Returns:
1696    //         kTRUE if so; kFALSE otherwise
1697    //   Throws:
1698    //         TSQLException - if a database access error occurs
1699 
1700    Bool_t return_value = kFALSE;
1701    
1702    if(!fImp) { Destroyed();   return return_value; } 
1703    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1704    
1705    try {      
1706       return_value = imp->supportsOrderByUnrelated();
1707 
1708    } catch(odbc::SQLException& e) {
1709       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1710                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1711                                 e.getErrorCode()) );
1712       return kFALSE;
1713    }   
1714    return return_value;
1715 }
1716 
1717 //___________________________________________________________________
1718 Bool_t ODBCDatabaseMetaData::SupportsGroupBy()
1719 {
1720    // Is some form of "GROUP BY" clause supported?
1721    //
1722    //   Returns:
1723    //         kTRUE if so; kFALSE otherwise
1724    //   Throws:
1725    //         TSQLException - if a database access error occurs
1726 
1727    Bool_t return_value = kFALSE;
1728    
1729    if(!fImp) { Destroyed();   return return_value; } 
1730    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1731    
1732    try {      
1733       return_value = imp->supportsGroupBy();
1734 
1735    } catch(odbc::SQLException& e) {
1736       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1737                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1738                                 e.getErrorCode()) );
1739       return kFALSE;
1740    }   
1741    return return_value;
1742 }
1743 
1744 //___________________________________________________________________
1745 Bool_t ODBCDatabaseMetaData::SupportsGroupByUnrelated()
1746 {
1747    // Can a "GROUP BY" clause use columns not in the SELECT?
1748    //
1749    // For example, 
1750    //    SELECT DEPT,SALARY FROM EMPLOYEE GROUP BY DEPT,AGE
1751    // 
1752    //   Returns:
1753    //         kTRUE if so; kFALSE otherwise
1754    //   Throws:
1755    //         TSQLException - if a database access error occurs
1756 
1757    Bool_t return_value = kFALSE;
1758    
1759    if(!fImp) { Destroyed();   return return_value; } 
1760    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1761    
1762    try {      
1763       return_value = imp->supportsGroupByUnrelated();
1764 
1765    } catch(odbc::SQLException& e) {
1766       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1767                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1768                                 e.getErrorCode()) );
1769       return kFALSE;
1770    }   
1771    return return_value;
1772 }
1773 
1774 //___________________________________________________________________
1775 Bool_t ODBCDatabaseMetaData::SupportsGroupByBeyondSelect()
1776 {
1777    // Can a "GROUP BY" clause add columns not in the SELECT provided 
1778    // it specifies all the columns in the SELECT?
1779    //
1780    // For example, 
1781    //    SELECT DEPT,MAX(SALARY) FROM EMPLOYEE GROUP BY DEPT,AGE
1782    // 
1783    //
1784    //   Returns:
1785    //         kTRUE if so; kFALSE otherwise
1786    //   Throws:
1787    //         TSQLException - if a database access error occurs
1788 
1789    Bool_t return_value = kFALSE;
1790 
1791    if(!fImp) { Destroyed();   return return_value; } 
1792    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1793    
1794    try {      
1795       return_value = imp->supportsGroupByBeyondSelect();
1796 
1797    } catch(odbc::SQLException& e) {
1798       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1799                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1800                                 e.getErrorCode()) );
1801       return kFALSE;
1802    }   
1803    return return_value;
1804 }
1805 
1806 //___________________________________________________________________
1807 Bool_t ODBCDatabaseMetaData::SupportsLikeEscapeClause()
1808 {
1809    // Is the escape character in "LIKE" clauses supported? 
1810    // A SQL-92 entry level-conformant driver always returns kTRUE.
1811    //
1812    //   Returns:
1813    //         kTRUE if so; kFALSE otherwise
1814    //   Throws:
1815    //         TSQLException - if a database access error occurs
1816    // 
1817 
1818    Bool_t return_value = kFALSE;
1819    
1820    if(!fImp) { Destroyed();   return return_value; } 
1821    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1822     
1823    try {      
1824       return_value = imp->supportsLikeEscapeClause();
1825 
1826    } catch(odbc::SQLException& e) {
1827       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1828                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1829                                 e.getErrorCode()) );
1830       return kFALSE;
1831    }   
1832    return return_value;
1833 }
1834 
1835 //___________________________________________________________________
1836 Bool_t ODBCDatabaseMetaData::SupportsMultipleResultSets()
1837 {
1838    // Are multiple TSQLResultSets from a single execute supported?
1839    //
1840    //   Returns:
1841    //         kTRUE if so; kFALSE otherwise
1842    //   Throws:
1843    //         TSQLException - if a database access error occurs
1844 
1845    Bool_t return_value = kFALSE;
1846    
1847    if(!fImp) { Destroyed();   return return_value; } 
1848    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1849    
1850    try {
1851       return_value = imp->supportsMultipleResultSets();
1852 
1853    } catch(odbc::SQLException& e) {
1854       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1855                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1856                                 e.getErrorCode()) );
1857       return kFALSE;
1858    }   
1859    return return_value;
1860 }
1861 
1862 //___________________________________________________________________
1863 Bool_t ODBCDatabaseMetaData::SupportsMultipleTransactions()
1864 {
1865    // Can we have multiple transactions open at once (on different
1866    // connections)?
1867    //
1868    //   Returns:
1869    //         kTRUE if so; kFALSE otherwise
1870    //   Throws:
1871    //         TSQLException - if a database access error occurs
1872 
1873    Bool_t return_value = kFALSE;
1874    
1875    if(!fImp) { Destroyed();   return return_value; } 
1876    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1877    
1878    try {      
1879       return_value = imp->supportsMultipleTransactions();
1880 
1881    } catch(odbc::SQLException& e) {
1882       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1883                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1884                                 e.getErrorCode()) );
1885       return kFALSE;
1886    }   
1887    return return_value;
1888 }
1889 
1890 //___________________________________________________________________
1891 Bool_t ODBCDatabaseMetaData::SupportsNonNullableColumns()
1892 {
1893    // Can columns be defined as non-nullable? 
1894    // A SQL-92 entry level-conformant driver always returns kTRUE.
1895    //
1896    //   Returns:
1897    //         kTRUE if so; kFALSE otherwise
1898    //   Throws:
1899    //         TSQLException - if a database access error occurs
1900    //
1901    // ... more comments based on  "ODBC 3.5 Developer's Guide"
1902    //
1903    // Indicates whether the data source supports the "NOT NULL"
1904    // column constraint in "CREATE TABLE" SQL statements
1905    //
1906 
1907    Bool_t return_value = kFALSE;
1908    
1909    if(!fImp) { Destroyed();   return return_value; } 
1910    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1911    
1912    try {      
1913       return_value = imp->supportsNonNullableColumns();
1914 
1915    } catch(odbc::SQLException& e) {
1916       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1917                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1918                                 e.getErrorCode()) );
1919       return kFALSE;
1920    }   
1921    return return_value;
1922 }
1923 
1924 //___________________________________________________________________
1925 Bool_t ODBCDatabaseMetaData::SupportsMinimumSQLGrammar()
1926 {
1927    // Is the ODBC Minimum SQL grammar supported? 
1928    // All SQL-92 entry level-conformant drivers must return kTRUE.
1929    //
1930    //   Returns:
1931    //         kTRUE if so; kFALSE otherwise
1932    //   Throws:
1933    //         TSQLException - if a database access error occurs
1934 
1935    Bool_t return_value = kFALSE;
1936    
1937    if(!fImp) { Destroyed();   return return_value; } 
1938    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1939    
1940    try {      
1941       return_value = imp->supportsMinimumSQLGrammar();
1942 
1943    } catch(odbc::SQLException& e) {
1944       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1945                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1946                                 e.getErrorCode()) );
1947       return kFALSE;
1948    }   
1949    return return_value;
1950 }
1951 
1952 //___________________________________________________________________
1953 Bool_t ODBCDatabaseMetaData::SupportsCoreSQLGrammar()
1954 {
1955    // Is the ODBC Core SQL grammar supported?
1956    //
1957    //   Returns:
1958    //         kTRUE if so; kFALSE otherwise
1959    //   Throws:
1960    //         TSQLException - if a database access error occurs
1961 
1962    Bool_t return_value = kFALSE;
1963    
1964    if(!fImp) { Destroyed();   return return_value; } 
1965    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1966    
1967    try {      
1968       return_value = imp->supportsCoreSQLGrammar();
1969 
1970    } catch(odbc::SQLException& e) {
1971       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1972                                 ODBCXX_STRING_CSTR(e.getSQLState()),
1973                                 e.getErrorCode()) );
1974       return kFALSE;
1975    }   
1976    return return_value;
1977 }
1978 
1979 //___________________________________________________________________
1980 Bool_t ODBCDatabaseMetaData::SupportsExtendedSQLGrammar()
1981 {
1982    // Is the ODBC Extended SQL grammar supported?
1983    //
1984    //   Returns:
1985    //         kTRUE if so; kFALSE otherwise
1986    //   Throws:
1987    //         TSQLException - if a database access error occurs
1988 
1989    Bool_t return_value = kFALSE;
1990    
1991    if(!fImp) { Destroyed();   return return_value; } 
1992    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
1993    
1994    try {      
1995       return_value = imp->supportsExtendedSQLGrammar();
1996 
1997    } catch(odbc::SQLException& e) {
1998       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1999                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2000                                 e.getErrorCode()) );
2001       return kFALSE;
2002    }   
2003    return return_value;
2004 }
2005 
2006 //___________________________________________________________________
2007 Bool_t ODBCDatabaseMetaData::SupportsANSI92EntryLevelSQL()
2008 {
2009    // Is the ANSI92 entry level SQL grammar supported? 
2010    // All SQL-92 entry level-conformant drivers must return kTRUE.
2011    //
2012    //   Returns:
2013    //         kTRUE if so; kFALSE otherwise
2014    //   Throws:
2015    //         TSQLException - if a database access error occurs
2016 
2017    Bool_t return_value = kFALSE;
2018    
2019    if(!fImp) { Destroyed();   return return_value; } 
2020    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2021    
2022    try {      
2023       return_value = imp->supportsANSI92EntryLevelSQL();
2024 
2025    } catch(odbc::SQLException& e) {
2026       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2027                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2028                                 e.getErrorCode()) );
2029       return kFALSE;
2030    }   
2031    return return_value;
2032 }
2033 
2034 //___________________________________________________________________
2035 Bool_t ODBCDatabaseMetaData::SupportsANSI92IntermediateSQL()
2036 {
2037    // Is the ANSI92 intermediate SQL grammar supported?
2038    //
2039    //   Returns:
2040    //         kTRUE if so; kFALSE otherwise
2041    //   Throws:
2042    //         TSQLException - if a database access error occurs
2043 
2044    Bool_t return_value = kFALSE;
2045    
2046    if(!fImp) { Destroyed();   return return_value; } 
2047    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2048    
2049    try {      
2050       return_value = imp->supportsANSI92IntermediateSQL(); 
2051 
2052    } catch(odbc::SQLException& e) {
2053       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2054                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2055                                 e.getErrorCode()) );
2056       return kFALSE;
2057    }   
2058    return return_value;
2059 }
2060 
2061 //___________________________________________________________________
2062 Bool_t ODBCDatabaseMetaData::SupportsANSI92FullSQL()
2063 {
2064    // Is the ANSI92 full SQL grammar supported?
2065    //
2066    //   Returns:
2067    //         kTRUE if so; kFALSE otherwise
2068    //   Throws:
2069    //         TSQLException - if a database access error occurs
2070 
2071    Bool_t return_value = kFALSE;
2072    
2073    if(!fImp) { Destroyed();   return return_value; } 
2074 //   odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2075    
2076    try {   
2077 //   return ((DatabaseMetaData*)fImp)->supportsANSI92FullSQL();
2078       return kTRUE;
2079 
2080    } catch(odbc::SQLException& e) {
2081       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2082                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2083                                 e.getErrorCode()) );
2084       return kFALSE;
2085    }   
2086    return return_value;
2087 }
2088 
2089 //___________________________________________________________________
2090 Bool_t ODBCDatabaseMetaData::SupportsIntegrityEnhancementFacility()
2091 {
2092    // Is the SQL Integrity Enhancement Facility supported?
2093    //
2094    //   Returns:
2095    //         kTRUE if so; kFALSE otherwise
2096    //   Throws:
2097    //         TSQLException - if a database access error occurs
2098 
2099    Bool_t return_value = kFALSE;
2100    
2101    if(!fImp) { Destroyed();   return return_value; } 
2102    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2103    
2104    try {      
2105       return_value = imp->supportsIntegrityEnhancementFacility();
2106 
2107    } catch(odbc::SQLException& e) {
2108       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2109                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2110                                 e.getErrorCode()) );
2111       return kFALSE;
2112    }   
2113    return return_value;
2114 }
2115 
2116 //___________________________________________________________________
2117 Bool_t ODBCDatabaseMetaData::SupportsOuterJoins()
2118 {
2119    // Is some form of outer join supported?
2120    //
2121    //   Returns:
2122    //         kTRUE if so; kFALSE otherwise
2123    //   Throws:
2124    //         TSQLException - if a database access error occurs
2125 
2126    Bool_t return_value = kFALSE;
2127    
2128    if(!fImp) { Destroyed();   return return_value; } 
2129    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2130    
2131    try {      
2132       return_value = imp->supportsOuterJoins();            
2133 
2134    } catch(odbc::SQLException& e) {
2135       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2136                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2137                                 e.getErrorCode()) );
2138       return kFALSE;
2139    }   
2140    return return_value;
2141 }
2142 
2143 //___________________________________________________________________
2144 Bool_t ODBCDatabaseMetaData::SupportsFullOuterJoins()
2145 {
2146    // Are full nested outer joins supported?
2147    //
2148    //   Returns:
2149    //         kTRUE if so; kFALSE otherwise
2150    //   Throws:
2151    //         TSQLException - if a database access error occurs
2152 
2153    Bool_t return_value = kFALSE;
2154    
2155    if(!fImp) { Destroyed();   return return_value; } 
2156    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2157    
2158    try {      
2159       return_value = imp->supportsFullOuterJoins();
2160 
2161    } catch(odbc::SQLException& e) {
2162       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2163                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2164                                 e.getErrorCode()) );
2165       return kFALSE;
2166    }   
2167    return return_value;
2168 }
2169 
2170 //___________________________________________________________________
2171 Bool_t ODBCDatabaseMetaData::SupportsLimitedOuterJoins()
2172 {
2173    // Is there limited support for outer joins? (This will be kTRUE 
2174    // if SupportFullOuterJoins is kTRUE.)
2175    //
2176    //   Returns:
2177    //         kTRUE if so; kFALSE otherwise
2178    //   Throws:
2179    //         TSQLException - if a database access error occurs
2180 
2181    Bool_t return_value = kFALSE;
2182    
2183    if(!fImp) { Destroyed();   return return_value; } 
2184    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2185    
2186    try {      
2187       return_value = imp->supportsLimitedOuterJoins();
2188 
2189    } catch(odbc::SQLException& e) {
2190       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2191                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2192                                 e.getErrorCode()) );
2193       return kFALSE;
2194    }   
2195    return return_value;
2196 }
2197 
2198 //___________________________________________________________________
2199 TString ODBCDatabaseMetaData::GetSchemaTerm()
2200 {
2201    // What's the database vendor's preferred term for "schema"?
2202    //
2203    // For example "owner",Authorization ID", or "Schema"
2204    // this string can be in upper, lower , or mixed case.
2205    //
2206    //  An SQL-92 entry level-conformant driver returns "schema"
2207    //
2208    //   Returns:
2209    //         the vendor term
2210    //   Throws:
2211    //         TSQLException - if a database access error occurs
2212 
2213    TString str;
2214    
2215    if(!fImp) { Destroyed();   return str; } 
2216    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2217    
2218    try {
2219       str = ODBCXX_STRING_CSTR( imp->getSchemaTerm() );
2220 
2221    } catch(odbc::SQLException& e) {
2222       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2223                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2224                                 e.getErrorCode()) );
2225       return "";
2226    }   
2227    return str;
2228 }
2229 
2230 //___________________________________________________________________
2231 TString ODBCDatabaseMetaData::GetTableTerm()
2232 {
2233    // What's the database vendor's preferred term for "table"
2234    //
2235    //
2236    //  An SQL-92 entry level-conformant driver returns "schema"
2237    //
2238    //   Returns:
2239    //         the vendor term
2240    //   Throws:
2241    //         TSQLException - if a database access error occurs
2242 
2243    TString str;
2244    
2245    if(!fImp) { Destroyed();   return str; } 
2246    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2247    
2248    try {
2249       str = ODBCXX_STRING_CSTR( imp->getTableTerm() );
2250 
2251    } catch(odbc::SQLException& e) {
2252       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2253                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2254                                 e.getErrorCode()) );
2255       return "";
2256    }   
2257    return str;
2258 }
2259 
2260 //___________________________________________________________________
2261 TString ODBCDatabaseMetaData::GetProcedureTerm()
2262 {
2263    // What's the database vendor's preferred term for a
2264    // stored procedure?
2265    //
2266    // For example,"database procedure","stored procedure",
2267    // "procedure","package", or "stored query"
2268    //
2269    //   Returns:
2270    //         the vendor term
2271    //   Throws:
2272    //         TSQLException - if a database access error occurs
2273 
2274    TString str;
2275    
2276    if(!fImp) { Destroyed();   return str; } 
2277    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2278       
2279    try {
2280       str = ODBCXX_STRING_CSTR( imp->getProcedureTerm() );
2281 
2282    } catch(odbc::SQLException& e) {
2283       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2284                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2285                                 e.getErrorCode()) );
2286       return "";
2287    }   
2288    return str;
2289 }
2290 
2291 //___________________________________________________________________
2292 TString ODBCDatabaseMetaData::GetCatalogTerm()
2293 {
2294    // What's the database vendor's preferred term for "catalog"?
2295    //
2296    // Can be for example "directory" or "database"
2297    // This string can be in upper, lower , or mixed case.
2298    // I catalogs are not supported by the data source, an empty
2299    // string ("") is returned.
2300    //
2301    //   Returns:
2302    //         the vendor term
2303    //   Throws:
2304    //         TSQLException - if a database access error occurs
2305 
2306    TString str;
2307    
2308    if(!fImp) { Destroyed();   return str; } 
2309    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2310    
2311    try {
2312       str = ODBCXX_STRING_CSTR( imp->getCatalogTerm() );
2313 
2314    } catch(odbc::SQLException& e) {
2315       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2316                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2317                                 e.getErrorCode()) );
2318       return "";
2319    }   
2320    return str;
2321 }
2322 
2323 //___________________________________________________________________
2324 Bool_t ODBCDatabaseMetaData::IsCatalogAtStart()
2325 {
2326    // Does a catalog appear at the start of a qualified table name? 
2327    // (Otherwise it appears at the end)
2328    //
2329    // For example MySQL would say kTRUE, 
2330    // dBASE driver also returns kTRUE because the directory (catalog)
2331    // name is at the start of the table name, a in \EMPDATA\EMP.DBF
2332    // An ORACLE Server driver returns kFALSE, because the catalog is
2333    // at the end of the table name as in ADMIN.EMP@EMPDATA
2334    // 
2335    //   Returns:
2336    //         kTRUE if it appears at the start
2337    //   Throws:
2338    //         TSQLException - if a database access error occurs
2339 
2340    Bool_t return_value = kFALSE;
2341    
2342    if(!fImp) { Destroyed();   return return_value; } 
2343    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2344    
2345    try {      
2346       return_value = imp->isCatalogAtStart();
2347 
2348    } catch(odbc::SQLException& e) {
2349       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2350                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2351                                 e.getErrorCode()) );
2352       return kFALSE;
2353    }   
2354    return return_value;
2355 }
2356 
2357 //___________________________________________________________________
2358 TString ODBCDatabaseMetaData::GetCatalogSeparator()
2359 {
2360    // What's the separator between catalog and table name?
2361    //
2362    // For example ORACLE would return a "@", while MySQL would say "." 
2363    // If catalogs are not supported by the data source, an empty 
2364    // string ("") is returned.
2365    //
2366    // An SQL-92 Full level conformant driver returns "."
2367    //
2368    //   Returns:
2369    //         the separator string
2370    //   Throws:
2371    //         TSQLException - if a database access error occurs
2372 
2373    TString str;
2374    
2375    if(!fImp) { Destroyed();   return str; } 
2376    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2377    
2378    try {   
2379       str = ODBCXX_STRING_CSTR( imp->getCatalogSeparator() );
2380 
2381    } catch(odbc::SQLException& e) {
2382       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2383                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2384                                 e.getErrorCode()) );
2385       return "";
2386    }   
2387    return str;
2388 }
2389 
2390 //___________________________________________________________________
2391 Bool_t ODBCDatabaseMetaData::SupportsSchemasInDataManipulation()
2392 {
2393    // Can a schema name be used in a data manipulation statement?
2394    //
2395    //   Returns:
2396    //         kTRUE if so; kFALSE otherwise
2397    //   Throws:
2398    //         TSQLException - if a database access error occurs
2399    //
2400    // ... more comments based on  "ODBC 3.5 Developer's Guide"
2401    //
2402    // Returns kTRUE if schemas are supported in all Data
2403    // Manipulation Language (DML) statements:
2404    //    SELECT,INSERT,UPDATE,DELETE, and , if supported
2405    //    SELECT FOR UPDATE and positioned UPDATE and DELETE
2406    //    statements.
2407    //
2408    // An SQL-92 entry level-conformant driver returns kTRUE.
2409  
2410    Bool_t return_value = kFALSE; 
2411    
2412    if(!fImp) { Destroyed();   return return_value; } 
2413    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2414       
2415    try {      
2416       return_value = imp->supportsSchemasInDataManipulation();
2417 
2418    } catch(odbc::SQLException& e) {
2419       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2420                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2421                                 e.getErrorCode()) );
2422       return kFALSE;
2423    }   
2424    return return_value;
2425 }
2426 
2427 //___________________________________________________________________
2428 Bool_t ODBCDatabaseMetaData::SupportsSchemasInProcedureCalls()
2429 {
2430    // Can a schema name be used in a procedure call statement?
2431    //
2432    //   Returns:
2433    //         kTRUE if so; kFALSE otherwise
2434    //   Throws:
2435    //         TSQLException - if a database access error occurs
2436 
2437    Bool_t return_value = kFALSE;
2438    
2439    if(!fImp) { Destroyed();   return return_value; } 
2440    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2441    
2442    try {      
2443       return_value = imp->supportsSchemasInProcedureCalls(); 
2444 
2445    } catch(odbc::SQLException& e) {
2446       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2447                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2448                                 e.getErrorCode()) );
2449       return kFALSE;
2450    }   
2451    return return_value;
2452 }
2453 
2454 //___________________________________________________________________
2455 Bool_t ODBCDatabaseMetaData::SupportsSchemasInTableDefinitions()
2456 {
2457    // Can a schema name be used in a table definition statement?
2458    //
2459    //   Returns:
2460    //         kTRUE if so; kFALSE otherwise
2461    //   Throws:
2462    //         TSQLException - if a database access error occurs
2463    // 
2464    // Returns kTRUE if schemas are supported in all table
2465    // definition statements: CREATE TABLE,CREATE VIEW,
2466    // ALTER TABLE, DROP TABLE and DROP VIEW
2467    //
2468    // An SQL-92 entry level-conformant driver returns kTRUE.
2469 
2470    Bool_t return_value = kFALSE;
2471    
2472    if(!fImp) { Destroyed();   return return_value; } 
2473    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2474       
2475    try { 
2476       return_value = imp->supportsSchemasInTableDefinitions();
2477 
2478    } catch(odbc::SQLException& e) {
2479       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2480                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2481                                 e.getErrorCode()) );
2482       return kFALSE;
2483    }   
2484    return return_value;
2485 }
2486 
2487 //___________________________________________________________________
2488 Bool_t ODBCDatabaseMetaData::SupportsSchemasInIndexDefinitions()
2489 {
2490    // Can a schema name be used in an index definition statement?
2491    //
2492    //   Returns:
2493    //         kTRUE if so; kFALSE otherwise
2494    //   Throws:
2495    //         TSQLException - if a database access error occurs
2496    //   
2497    // Returns kTRUE if schemas are supported in all index
2498    // definition statements: CREATE INDEX and DROP INDEX
2499 
2500    Bool_t return_value = kFALSE;
2501 
2502    if(!fImp) { Destroyed();   return return_value; } 
2503    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2504       
2505    try {      
2506       return_value = imp->supportsSchemasInIndexDefinitions();
2507 
2508    } catch(odbc::SQLException& e) {
2509       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2510                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2511                                 e.getErrorCode()) );
2512       return kFALSE;
2513    }   
2514    return return_value;
2515 }
2516 
2517 //___________________________________________________________________
2518 Bool_t ODBCDatabaseMetaData::SupportsSchemasInPrivilegeDefinitions()
2519 {
2520    // Can a schema name be used in a privilege definition statement?
2521    //
2522    //   Returns:
2523    //         kTRUE if so; kFALSE otherwise
2524    //   Throws:
2525    //         TSQLException - if a database access error occurs
2526    //
2527    // Returns kTRUE if schemas are supported in all privelege
2528    // definition statements: GRANT and REVOKE
2529    //
2530    // An SQL-92 entry level-conformant driver returns kTRUE.
2531 
2532    Bool_t return_value = kFALSE;
2533    
2534    if(!fImp) { Destroyed();   return return_value; } 
2535    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2536    
2537    try {      
2538       return_value = imp->supportsSchemasInPrivilegeDefinitions();
2539 
2540    } catch(odbc::SQLException& e) {
2541       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2542                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2543                                 e.getErrorCode()) );
2544       return kFALSE;
2545    }   
2546    return return_value;
2547 }
2548 
2549 //___________________________________________________________________
2550 Bool_t ODBCDatabaseMetaData::SupportsCatalogsInDataManipulation()
2551 {
2552    // Can a catalog name be used in a data manipulation statement?
2553    //
2554    //   Returns:
2555    //         kTRUE if so; kFALSE otherwise
2556    //   Throws:
2557    //         TSQLException - if a database access error occurs
2558    //
2559    // ... more comments based on  "ODBC 3.5 Developer's Guide"
2560    //
2561    // Returns kTRUE if catalog names can be used in all Data
2562    // Manipulation Language (DML) statements:
2563    //    SELECT,INSERT,UPDATE,DELETE, and , if supported
2564    //    SELECT FOR UPDATE and positioned UPDATE and DELETE
2565    //    statements.
2566    //
2567    // An SQL-92 Full level-conformant driver returns kTRUE
2568 
2569    Bool_t return_value = kFALSE;
2570    
2571    if(!fImp) { Destroyed();   return return_value; } 
2572    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2573       
2574    try {      
2575       return_value = imp->supportsCatalogsInDataManipulation();  
2576 
2577    } catch(odbc::SQLException& e) {
2578       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2579                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2580                                 e.getErrorCode()) );
2581       return kFALSE;
2582    }   
2583    return return_value;
2584 }
2585 
2586 //___________________________________________________________________
2587 Bool_t ODBCDatabaseMetaData::SupportsCatalogsInProcedureCalls()
2588 {
2589    // Can a catalog name be used in a procedure call statement?
2590    //
2591    //   Returns:
2592    //         kTRUE if so; kFALSE otherwise
2593    //   Throws:
2594    //         TSQLException - if a database access error occurs
2595    //
2596    // An SQL-92 Full level-conformant driver returns kTRUE
2597 
2598    Bool_t return_value = kFALSE;
2599    
2600    if(!fImp) { Destroyed();   return return_value; } 
2601    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2602       
2603    try {      
2604       return_value = imp->supportsCatalogsInProcedureCalls();
2605 
2606    } catch(odbc::SQLException& e) {
2607       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2608                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2609                                 e.getErrorCode()) );
2610       return kFALSE;
2611    }   
2612    return return_value;
2613 }
2614 
2615 //___________________________________________________________________
2616 Bool_t ODBCDatabaseMetaData::SupportsCatalogsInTableDefinitions()
2617 {
2618    // Can a catalog name be used in a table definition statement?
2619    //
2620    //   Returns:
2621    //         kTRUE if so; kFALSE otherwise
2622    //   Throws:
2623    //         TSQLException - if a database access error occurs
2624    // 
2625    // Returns kTRUE if catalog names can be used in all table
2626    // definition statements: CREATE TABLE,CREATE VIEW,
2627    // ALTER TABLE, DROP TABLE and DROP VIEW
2628 
2629    Bool_t return_value = kFALSE; 
2630    
2631    if(!fImp) { Destroyed();   return return_value; } 
2632    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2633       
2634    try {      
2635       return_value = imp->supportsCatalogsInTableDefinitions();
2636 
2637    } catch(odbc::SQLException& e) {
2638       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2639                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2640                                 e.getErrorCode()) );
2641       return kFALSE;
2642    }   
2643    return return_value;
2644 }
2645 
2646 //___________________________________________________________________
2647 Bool_t ODBCDatabaseMetaData::SupportsCatalogsInIndexDefinitions()
2648 {
2649    // Can a catalog name be used in an index definition statement?
2650    //
2651    //   Returns:
2652    //         kTRUE if so; kFALSE otherwise
2653    //   Throws:
2654    //         TSQLException - if a database access error occurs
2655    //   
2656    // Returns kTRUE if catalog names can be used in all index
2657    // definition statements: CREATE INDEX and DROP INDEX
2658    //
2659    // An SQL-92 Full level-conformant driver returns kTRUE.
2660 
2661    Bool_t return_value = kFALSE;
2662 
2663    if(!fImp) { Destroyed();   return return_value; } 
2664    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2665         
2666    try {      
2667       return_value = imp->supportsCatalogsInIndexDefinitions();
2668 
2669    } catch(odbc::SQLException& e) {
2670       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2671                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2672                                 e.getErrorCode()) );
2673       return kFALSE;
2674    }   
2675    return return_value;
2676 }
2677 
2678 //___________________________________________________________________
2679 Bool_t ODBCDatabaseMetaData::SupportsCatalogsInPrivilegeDefinitions()
2680 {
2681    // Can a catalog name be used in a privilege definition statement?
2682    //
2683    //   Returns:
2684    //         kTRUE if so; kFALSE otherwise
2685    //   Throws:
2686    //         TSQLException - if a database access error occurs
2687    //
2688    // Returns kTRUE if catalog names can be used  in all privelege
2689    // definition statements: GRANT and REVOKE
2690    //
2691    // An SQL-92 Full level-conformant driver returns kTRUE
2692 
2693    Bool_t return_value = kFALSE;
2694    
2695    if(!fImp) { Destroyed();   return return_value; } 
2696    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2697       
2698    try {      
2699       return_value = imp->supportsCatalogsInPrivilegeDefinitions();
2700 
2701    } catch(odbc::SQLException& e) {
2702       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2703                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2704                                 e.getErrorCode()) );
2705       return kFALSE;
2706    }   
2707    return return_value;
2708 }
2709 
2710 //___________________________________________________________________
2711 Bool_t ODBCDatabaseMetaData::SupportsPositionedDelete()
2712 {
2713    // Is positioned DELETE supported?
2714    //
2715    //   Returns:
2716    //         kTRUE if so; kFALSE otherwise
2717    //   Throws:
2718    //         TSQLException - if a database access error occurs
2719 
2720    Bool_t return_value = kFALSE;
2721 
2722    if(!fImp) { Destroyed();   return return_value; } 
2723    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2724       
2725    try {      
2726       return_value = imp->supportsPositionedDelete();
2727 
2728    } catch(odbc::SQLException& e) {
2729       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2730                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2731                                 e.getErrorCode()) );
2732       return kFALSE;
2733    }   
2734    return return_value;
2735 }
2736 
2737 //___________________________________________________________________
2738 Bool_t ODBCDatabaseMetaData::SupportsPositionedUpdate()
2739 {
2740    // Is positioned UPDATE supported?
2741    //
2742    //   Returns:
2743    //         kTRUE if so; kFALSE otherwise
2744    //   Throws:
2745    //         TSQLException - if a database access error occurs
2746 
2747    Bool_t return_value = kFALSE;
2748 
2749    if(!fImp) { Destroyed();   return return_value; } 
2750    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2751       
2752    try {      
2753       return_value = imp->supportsPositionedUpdate();
2754 
2755    } catch(odbc::SQLException& e) {
2756       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2757                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2758                                 e.getErrorCode()) );
2759       return kFALSE;
2760    }   
2761    return return_value;
2762 }
2763 
2764 //___________________________________________________________________
2765 Bool_t ODBCDatabaseMetaData::SupportsSelectForUpdate()
2766 {
2767    // Is SELECT for UPDATE supported?
2768    //
2769    //   Returns:
2770    //         kTRUE if so; kFALSE otherwise
2771    //   Throws:
2772    //         TSQLException - if a database access error occurs
2773 
2774    Bool_t return_value = kFALSE;
2775    
2776    if(!fImp) { Destroyed();   return return_value; } 
2777    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2778    
2779    try {      
2780       return_value = imp->supportsStoredProcedures();
2781 
2782    } catch(odbc::SQLException& e) {
2783       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2784                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2785                                 e.getErrorCode()) );
2786       return kFALSE;
2787    }   
2788    return return_value;
2789 }
2790 
2791 //___________________________________________________________________
2792 Bool_t ODBCDatabaseMetaData::SupportsStoredProcedures()
2793 {
2794    // Are stored procedure calls using the stored procedure escape 
2795    // syntax supported?
2796    //
2797    //   Returns:
2798    //         kTRUE if so; kFALSE otherwise
2799    //   Throws:
2800    //         TSQLException - if a database access error occurs
2801 
2802    Bool_t return_value = kFALSE;
2803    
2804    if(!fImp) { Destroyed();   return return_value; } 
2805    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2806    
2807    try {      
2808       return_value = imp->supportsStoredProcedures();
2809 
2810    } catch(odbc::SQLException& e) {
2811       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2812                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2813                                 e.getErrorCode()) );
2814       return kFALSE;
2815    }   
2816    return return_value;
2817 }
2818 
2819 //___________________________________________________________________
2820 Bool_t ODBCDatabaseMetaData::SupportsSubqueriesInComparisons()
2821 {
2822    // Are subqueries in comparison expressions supported? 
2823    // A SQL-92 entry level-conformant driver always returns kTRUE.
2824    //
2825    //   Returns:
2826    //         kTRUE if so; kFALSE otherwise
2827    //   Throws:
2828    //         TSQLException - if a database access error occurs
2829 
2830    Bool_t return_value = kTRUE;
2831    
2832    if(!fImp) { Destroyed();   return return_value; } 
2833    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2834    
2835    try {      
2836       return_value = imp->supportsSubqueriesInComparisons();
2837 
2838    } catch(odbc::SQLException& e) {
2839       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2840                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2841                                 e.getErrorCode()) );
2842       return kFALSE;
2843    }   
2844    return return_value;
2845 }
2846 
2847 //___________________________________________________________________
2848 Bool_t ODBCDatabaseMetaData::SupportsSubqueriesInExists()
2849 {
2850    // Are subqueries in EXISTS expressions supported? 
2851    // A SQL-92 entry level-conformant driver always  returns kTRUE.
2852    //
2853    //   Returns:
2854    //         kTRUE if so; kFALSE otherwise
2855    //   Throws:
2856    //         TSQLException - if a database access error occurs
2857 
2858    Bool_t return_value = kFALSE;
2859    
2860    if(!fImp) { Destroyed();   return return_value; } 
2861    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2862    
2863    try {      
2864       return_value = imp->supportsSubqueriesInExists();
2865 
2866    } catch(odbc::SQLException& e) {
2867       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2868                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2869                                 e.getErrorCode()) );
2870       return kFALSE;
2871    }   
2872    return return_value;
2873 }
2874 
2875 //___________________________________________________________________
2876 Bool_t ODBCDatabaseMetaData::SupportsSubqueriesInIns()
2877 {
2878    // Are subqueries in IN statements supported? 
2879    // A SQL-92 entry level-conformant driver always returns kTRUE.
2880    //
2881    //   Returns:
2882    //         kTRUE if so; kFALSE otherwise
2883    //   Throws:
2884    //         TSQLException - if a database access error occurs
2885 
2886    Bool_t return_value = kFALSE;
2887    
2888    if(!fImp) { Destroyed();   return return_value; } 
2889    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2890    
2891    try {      
2892       return_value = imp->supportsSubqueriesInIns();
2893 
2894    } catch(odbc::SQLException& e) {
2895       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2896                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2897                                 e.getErrorCode()) );
2898       return kFALSE;
2899    }   
2900    return return_value;
2901 }
2902 
2903 //___________________________________________________________________
2904 Bool_t ODBCDatabaseMetaData::SupportsSubqueriesInQuantifieds()
2905 {
2906    // Are subqueries in quantified expressions supported? 
2907    // A SQL-92 entry level-conformant driver always returns kTRUE.
2908    //
2909    //   Returns:
2910    //         kTRUE if so; kFALSE otherwise
2911    //   Throws:
2912    //         TSQLException - if a database access error occurs
2913 
2914    Bool_t return_value = kFALSE;
2915    
2916    if(!fImp) { Destroyed();   return return_value; } 
2917    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2918    
2919    try {      
2920       return_value = imp->supportsSubqueriesInQuantifieds();
2921 
2922    } catch(odbc::SQLException& e) {
2923       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2924                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2925                                 e.getErrorCode()) );
2926       return kFALSE;
2927    }   
2928    return return_value;
2929 }
2930 
2931 //___________________________________________________________________
2932 Bool_t ODBCDatabaseMetaData::SupportsCorrelatedSubqueries()
2933 {
2934    // Are correlated subqueries supported? 
2935    // A SQL-92 entry level-conformant driver always returns kTRUE.
2936    //
2937    //   Returns:
2938    //         kTRUE if so; kFALSE otherwise
2939    //   Throws:
2940    //         TSQLException - if a database access error occurs
2941 
2942    Bool_t return_value = kFALSE;
2943    
2944    if(!fImp) { Destroyed();   return return_value; } 
2945    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2946    
2947    try {      
2948       return_value = imp->supportsCorrelatedSubqueries();
2949 
2950    } catch(odbc::SQLException& e) {
2951       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2952                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2953                                 e.getErrorCode()) );
2954       return kFALSE;
2955    }   
2956    return return_value;
2957 }
2958 
2959 //___________________________________________________________________
2960 Bool_t ODBCDatabaseMetaData::SupportsUnion()
2961 {
2962    // Is SQL UNION supported?
2963    // A SQL-92 entry level-conformant driver always returns kTRUE.
2964    //
2965    //   Returns:
2966    //         kTRUE if so; kFALSE otherwise
2967    //   Throws:
2968    //         TSQLException - if a database access error occurs
2969 
2970    Bool_t return_value = kFALSE;
2971    
2972    if(!fImp) { Destroyed();   return return_value; } 
2973    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
2974    
2975    try {
2976       return_value = imp->supportsUnion();
2977 
2978    } catch(odbc::SQLException& e) {
2979       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2980                                 ODBCXX_STRING_CSTR(e.getSQLState()),
2981                                 e.getErrorCode()) );
2982       return kFALSE;
2983    }   
2984    return return_value;
2985 }
2986 
2987 //___________________________________________________________________
2988 Bool_t ODBCDatabaseMetaData::SupportsUnionAll()
2989 {
2990    // Is SQL UNION ALL supported?
2991    // A SQL-92 entry level-conformant driver always returns kTRUE.
2992    //
2993    //   Returns:
2994    //         kTRUE if so; kFALSE otherwise
2995    //   Throws:
2996    //         TSQLException - if a database access error occurs
2997 
2998    Bool_t return_value = kFALSE;
2999    
3000    if(!fImp) { Destroyed();   return return_value; } 
3001    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3002    
3003    try {
3004       return_value = imp->supportsUnionAll();
3005 
3006    } catch(odbc::SQLException& e) {
3007       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3008                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3009                                 e.getErrorCode()) );
3010       return kFALSE;
3011    }   
3012    return return_value;
3013 }
3014 
3015 //___________________________________________________________________
3016 Bool_t ODBCDatabaseMetaData::SupportsOpenCursorsAcrossCommit()
3017 {
3018    // Can cursors remain open across commits?
3019    // 
3020    // Returns kTRUE if the data source and the driver can handle
3021    // open cursors (eg. TSQLResultSets) across a commit, or kFALSE 
3022    // if they are invalidated.
3023    //
3024    //   Returns:
3025    //         kTRUE if cursors always remain open; 
3026    //         kFALSE if they might not remain open
3027    //   Throws:
3028    //         TSQLException - if a database access error occurs
3029    //
3030    // ... more comments based on  "ODBC 3.5 Developer's Guide"
3031    //
3032    // Returns kTRUE if cursors and access plans for prepared SQL 
3033    // statements reamin as they were before the COMMIT operation
3034    // ( see TSQLConnection::Commit() method ) was performed. 
3035    // The application can continue to fetch data or it can close 
3036    // cursor  and re-execute SQL statement without having to 
3037    // re-prepare it.
3038    //
3039     
3040    Bool_t return_value = kFALSE;
3041    if(!fImp) { Destroyed();   return return_value; } 
3042    
3043    try {      
3044       odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3045       return_value = imp->supportsOpenCursorsAcrossCommit();
3046 
3047    } catch(odbc::SQLException& e) {
3048       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3049                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3050                                 e.getErrorCode()) );
3051       return kFALSE; 
3052    }   
3053    return return_value;
3054 }
3055 
3056 //___________________________________________________________________
3057 Bool_t ODBCDatabaseMetaData::SupportsOpenCursorsAcrossRollback()
3058 {
3059    // Can cursors remain open across rollbacks?
3060    // 
3061    // Returns kTRUE if the data source and the driver can handle
3062    // open cursors (eg. TSQLResultSet s) across a rollback, or kFALSE 
3063    // if they are invalidated.
3064    //
3065    //   Returns:
3066    //         kTRUE if cursors always remain open; 
3067    //         kFALSE if they might not remain open
3068    //   Throws:
3069    //         TSQLException - if a database access error occurs
3070    //
3071    // ... more comments based on  "ODBC 3.5 Developer's Guide"
3072    //
3073    // Returns kTRUE if cursors and access plans for prepared SQL 
3074    // statements reamin as they were before the ROLLBACK operation
3075    // ( see TSQLConnection::Rollback() method ) was performed. 
3076    // The application can continue to fetch data or it can close 
3077    // cursor  and re-execute SQL statement without having to 
3078    // re-prepare it.
3079    //
3080    
3081    Bool_t return_value = kFALSE;
3082    if(!fImp) { Destroyed();   return return_value; } 
3083 
3084    try {      
3085       odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3086       return_value = imp->supportsOpenCursorsAcrossRollback();
3087 
3088    } catch(odbc::SQLException& e) {
3089       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3090                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3091                                 e.getErrorCode()) );
3092       return kFALSE;
3093    }   
3094    return return_value;
3095 }
3096 
3097 //___________________________________________________________________
3098 Bool_t ODBCDatabaseMetaData::SupportsOpenStatementsAcrossCommit()
3099 {
3100    // Can statements remain open across commits?
3101    //
3102    // Returns kTRUE if the data source and the driver can handle
3103    // open statements across a commit, or kFALSE if
3104    // they are invalidated.   
3105    //
3106    //   Returns:
3107    //         kTRUE if statements always remain open; 
3108    //         kFALSE if they might not remain open
3109    //   Throws:
3110    //         TSQLException - if a database access error occurs
3111 
3112    Bool_t return_value = kFALSE;
3113  
3114    if(!fImp) { Destroyed();   return return_value; } 
3115    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3116    
3117    try {
3118       return_value = imp->supportsOpenStatementsAcrossCommit();
3119 
3120    } catch(odbc::SQLException& e) {
3121       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3122                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3123                                 e.getErrorCode()) );
3124       return kFALSE;
3125    }   
3126    return return_value;
3127 }
3128 
3129 //___________________________________________________________________
3130 Bool_t ODBCDatabaseMetaData::SupportsOpenStatementsAcrossRollback()
3131 {
3132    // Can statements remain open across rollbacks?
3133    //
3134    // Returns kTRUE if the data source and the driver can handle
3135    // open statements across a rollback, or kFALSE if
3136    // they are invalidated.   
3137    //
3138    //   Returns:
3139    //         kTRUE if statements always remain open; 
3140    //         kFALSE if they might not remain open
3141    //   Throws:
3142    //         TSQLException - if a database access error occurs
3143 
3144    Bool_t return_value = kFALSE;
3145    
3146    if(!fImp) { Destroyed();   return return_value; } 
3147    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3148    
3149    try {
3150       return_value = imp->supportsOpenStatementsAcrossRollback(); 
3151 
3152    } catch(odbc::SQLException& e) {
3153       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3154                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3155                                 e.getErrorCode()) );
3156       return kFALSE;
3157    }   
3158    return return_value;
3159 }
3160 
3161 //___________________________________________________________________
3162 Int_t ODBCDatabaseMetaData::GetMaxBinaryLiteralLength()
3163 {
3164    // How many hex characters can you have in an inline binary 
3165    // literal (number of hexadecimal characters, exluding the 
3166    // literal prefix and suffix ) ? For example the binary
3167    // literal 0xFFAA has a length of 4.
3168    //
3169    //   Returns:
3170    //         max binary literal length in hex characters; a result 
3171    //         of zero means that thereis no limit or the limit is 
3172    //         not known
3173    //   Throws:
3174    //         TSQLException - if a database access error occurs
3175 
3176    Int_t return_value = 0;
3177    if(!fImp) { Destroyed();   return return_value; } 
3178 
3179    try {      
3180       odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3181       return_value = imp->getMaxBinaryLiteralLength();
3182 
3183    } catch(odbc::SQLException& e) {
3184       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3185                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3186                                 e.getErrorCode()) );
3187       return 0; 
3188    }   
3189    return return_value;
3190 }
3191 
3192 //___________________________________________________________________
3193 Int_t ODBCDatabaseMetaData::GetMaxCharLiteralLength()
3194 {
3195    // What's the max length for a character literal
3196    // (number of characters, exluding the literal prefix
3197    // and suffix ) ?
3198    //
3199    //   Returns:
3200    //          max literal length; a result of zero means that 
3201    //          there is no limit or the limit is not known
3202    //   Throws:
3203    //         TSQLException - if a database access error occurs
3204 
3205    Int_t return_value = 0;
3206    if(!fImp) { Destroyed();   return return_value; } 
3207 
3208    try {      
3209       odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3210       return_value = imp->getMaxCharLiteralLength();
3211 
3212    } catch(odbc::SQLException& e) {
3213       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3214                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3215                                 e.getErrorCode()) );
3216       return 0;
3217    }   
3218    return return_value;
3219 }
3220 
3221 //___________________________________________________________________
3222 Int_t ODBCDatabaseMetaData::GetMaxColumnNameLength()
3223 {
3224    // What's the limit on column name length?
3225    //
3226    //    Returns:
3227    //          max column name length; a result of zero means that 
3228    //          there is no limit or the limit is not known
3229    //   Throws:
3230    //         TSQLException - if a database access error occurs
3231 
3232    Int_t return_value = 0;
3233    if(!fImp) { Destroyed();   return return_value; } 
3234 
3235    try {      
3236       odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3237       return_value = imp->getMaxColumnNameLength();
3238 
3239    } catch(odbc::SQLException& e) {
3240       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3241                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3242                                 e.getErrorCode()) );
3243       return 0;
3244    }   
3245    return return_value;
3246 }
3247 
3248 //___________________________________________________________________
3249 Int_t ODBCDatabaseMetaData::GetMaxColumnsInGroupBy()
3250 {
3251    // What's the maximum number of columns in a "GROUP BY" clause?
3252    //
3253    //   Returns:
3254    //          max number of columns; a result of zero means that 
3255    //          there is no limit or the limit is not known
3256    //   Throws:
3257    //         TSQLException - if a database access error occurs
3258 
3259    Int_t return_value = 0;
3260    if(!fImp) { Destroyed();   return return_value; } 
3261 
3262    try {      
3263       odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3264       return_value = imp->getMaxColumnsInGroupBy();
3265 
3266    } catch(odbc::SQLException& e) {
3267       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3268                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3269                                 e.getErrorCode()) );
3270       return 0;
3271    }   
3272    return return_value;
3273 }
3274 
3275 //___________________________________________________________________
3276 Int_t ODBCDatabaseMetaData::GetMaxColumnsInIndex()
3277 {
3278    // What's the maximum number of columns allowed in an index?
3279    //
3280    //   Returns:
3281    //          max number of columns; a result of zero means that 
3282    //          there is no limit or the limit is not known
3283    //   Throws:
3284    //         TSQLException - if a database access error occurs
3285 
3286    Int_t return_value = 0;
3287    if(!fImp) { Destroyed();   return return_value; } 
3288 
3289    try {      
3290       odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3291       return_value = imp->getMaxColumnsInIndex();
3292 
3293    } catch(odbc::SQLException& e) {
3294       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3295                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3296                                 e.getErrorCode()) );
3297       return 0;
3298    }   
3299    return return_value;
3300 }
3301 
3302 //___________________________________________________________________
3303 Int_t ODBCDatabaseMetaData::GetMaxColumnsInOrderBy()
3304 {
3305    // What's the maximum number of columns in an "ORDER BY" clause?
3306    //
3307    //   Returns:
3308    //          max number of columns; a result of zero means that 
3309    //          there is no limit or the limit is not known
3310    //   Throws:
3311    //         TSQLException - if a database access error occurs
3312 
3313    Int_t return_value = 0;
3314    if(!fImp) { Destroyed();   return return_value; } 
3315 
3316    try {      
3317       odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3318       return_value = imp->getMaxColumnsInOrderBy();
3319 
3320    } catch(odbc::SQLException& e) {
3321       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3322                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3323                                 e.getErrorCode()) );
3324       return 0;
3325    }   
3326    return return_value;
3327 }
3328 
3329 //___________________________________________________________________
3330 Int_t ODBCDatabaseMetaData::GetMaxColumnsInSelect()
3331 {
3332    // What's the maximum number of columns in a "SELECT" list?
3333    //
3334    //   Returns:
3335    //          max number of columns; a result of zero means that 
3336    //          there is no limit or the limit is not known
3337    //   Throws:
3338    //         TSQLException - if a database access error occurs
3339 
3340    Int_t return_value = 0;
3341    if(!fImp) { Destroyed();   return return_value; } 
3342 
3343    try {      
3344       odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3345       return_value = imp->getMaxColumnsInSelect();
3346 
3347    } catch(odbc::SQLException& e) {
3348       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3349                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3350                                 e.getErrorCode()) );
3351       return 0;
3352    }   
3353    return return_value;
3354 }
3355 
3356 //___________________________________________________________________
3357 Int_t ODBCDatabaseMetaData::GetMaxColumnsInTable()
3358 {
3359    // What's the maximum number of columns in a table?
3360    //
3361    //   Returns:
3362    //          max number of columns; a result of zero means that 
3363    //          there is no limit or the limit is not known
3364    //   Throws:
3365    //          TSQLException - if a database access error occurs
3366 
3367    Int_t return_value = 0;
3368    if(!fImp) { Destroyed();   return return_value; } 
3369 
3370    try {      
3371       odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3372       return_value = imp->getMaxColumnsInTable();
3373 
3374    } catch(odbc::SQLException& e) {
3375       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3376                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3377                                 e.getErrorCode()) );
3378       return 0;
3379    }   
3380    return return_value;
3381 }
3382 
3383 //___________________________________________________________________
3384 Int_t ODBCDatabaseMetaData::GetMaxConnections()
3385 {
3386    // How many active connections can we have at a time to this 
3387    // database? This value can reflect a limitation imposed  by
3388    // either the driver or the data source.
3389    //
3390    //   Returns:
3391    //          max number of active connections; a result of zero 
3392    //          means that there is no limit or the limit is not known
3393    //   Throws:
3394    //         TSQLException - if a database access error occurs
3395 
3396    Int_t return_value = 0;
3397    if(!fImp) { Destroyed();   return return_value; } 
3398 
3399    try {      
3400       odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3401       return_value = imp->getMaxConnections();
3402 
3403    } catch(odbc::SQLException& e) {
3404       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3405                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3406                                 e.getErrorCode()) );
3407       return 0;
3408    }   
3409    return return_value;
3410 }
3411 
3412 //___________________________________________________________________
3413 Int_t ODBCDatabaseMetaData::GetMaxCursorNameLength()
3414 {
3415   // What's the maximum cursor name length?
3416   //
3417   //    Returns:
3418   //           max cursor name length in bytes; a result of zero means 
3419   //           that there is no limit or the limit is not known
3420   //    Throws:
3421   //          TSQLException - if a database access error occurs
3422 
3423    Int_t return_value = 0;
3424    if(!fImp) { Destroyed();   return return_value; } 
3425 
3426    try {      
3427       odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3428       return_value = imp->getMaxCursorNameLength();
3429 
3430    } catch(odbc::SQLException& e) {
3431       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3432                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3433                                 e.getErrorCode()) );
3434       return 0;
3435    }   
3436    return return_value;
3437 }
3438 
3439 //___________________________________________________________________
3440 Int_t ODBCDatabaseMetaData::GetMaxIndexLength()
3441 {
3442    // What's the maximum length of an index (in bytes)?
3443    //
3444    //   Returns:
3445    //          max index length in bytes; a result of zero means that 
3446    //          there is no limit or the limit is not known
3447    //   Throws:
3448    //         TSQLException - if a database access error occurs
3449 
3450    Int_t return_value = 0;
3451    if(!fImp) { Destroyed();   return return_value; } 
3452 
3453    try {      
3454       odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3455       return_value = imp->getMaxIndexLength();
3456 
3457    } catch(odbc::SQLException& e) {
3458       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3459                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3460                                 e.getErrorCode()) );
3461       return 0;
3462    }   
3463    return return_value;
3464 }
3465 
3466 //___________________________________________________________________
3467 Int_t ODBCDatabaseMetaData::GetMaxSchemaNameLength()
3468 {
3469    // What's the maximum length allowed for a schema name?
3470    //
3471    //   Returns:
3472    //          max name length in bytes; a result of zero means that 
3473    //          there is no limit or the limit is not known
3474    //   Throws:
3475    //         TSQLException - if a database access error occurs
3476 
3477    Int_t return_value = 0;
3478    if(!fImp) { Destroyed();   return return_value; } 
3479 
3480    try {      
3481       odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3482       return_value = imp->getMaxSchemaNameLength();
3483 
3484    } catch(odbc::SQLException& e) {
3485       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3486                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3487                                 e.getErrorCode()) );
3488       return 0;
3489    }   
3490    return return_value;
3491 }
3492 
3493 //___________________________________________________________________
3494 Int_t ODBCDatabaseMetaData::GetMaxProcedureNameLength()
3495 {
3496    //  What's the maximum length of a procedure name?
3497    //
3498    //    Returns:
3499    //          max name length in bytes; a result of zero means that 
3500    //         there is no limit or the limit is not known
3501    //    Throws:
3502    //          TSQLException - if a database access error occurs
3503 
3504    Int_t return_value = 0;
3505    if(!fImp) { Destroyed();   return return_value; } 
3506 
3507    try {
3508       odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3509       return_value = imp->getMaxProcedureNameLength();
3510 
3511    } catch(odbc::SQLException& e) {
3512       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3513                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3514                                 e.getErrorCode()) );
3515       return 0;
3516    }   
3517    return return_value;
3518 }
3519 
3520 //___________________________________________________________________
3521 Int_t ODBCDatabaseMetaData::GetMaxCatalogNameLength()
3522 {
3523    // What's the maximum length of a catalog name?
3524    //
3525    //   Returns:
3526    //         max name length in bytes; a result of zero means 
3527    //         that there is no limit or the limit is not known
3528    //   Throws:
3529    //         TSQLException - if a database access error occurs
3530 
3531    Int_t return_value = 0;
3532    if(!fImp) { Destroyed();   return return_value; } 
3533 
3534    try {      
3535       odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3536       return_value = imp->getMaxCatalogNameLength();
3537 
3538    } catch(odbc::SQLException& e) {
3539       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3540                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3541                                 e.getErrorCode()) );
3542       return 0;
3543    }   
3544    return return_value;
3545 }
3546 
3547 //___________________________________________________________________
3548 Int_t ODBCDatabaseMetaData::GetMaxRowSize()
3549 {
3550    // What's the maximum length of a single row?
3551    //
3552    //   Returns:
3553    //         max row size in bytes; a result of zero means 
3554    //         that there is no limit or the limit is not known
3555    //   Throws:
3556    //         TSQLException - if a database access error occurs
3557 
3558    Int_t return_value = 0;
3559    if(!fImp) { Destroyed();   return return_value; } 
3560 
3561    try {      
3562       odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3563       return_value = imp->getMaxRowSize(); 
3564 
3565    } catch(odbc::SQLException& e) {
3566       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3567                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3568                                 e.getErrorCode()) );
3569       return 0;
3570    }   
3571    return return_value;
3572 }
3573 
3574 //___________________________________________________________________
3575 Bool_t ODBCDatabaseMetaData::DoesMaxRowSizeIncludeBlobs()
3576 {
3577    // Did GetMaxRowSize() include LONGVARCHAR and LONGVARBINARY blobs?
3578    //
3579    // Returns:
3580    //         kTRUE if so; kFALSE otherwise
3581    //   Throws:
3582    //         TSQLException - if a database access error occurs
3583    //
3584    
3585    Bool_t return_value = kFALSE;   
3586    if(!fImp) { Destroyed();   return return_value; } 
3587    
3588    try {      
3589       odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3590       return_value = imp->doesMaxRowSizeIncludeBlobs();
3591 
3592    } catch(odbc::SQLException& e) {
3593       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3594                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3595                                 e.getErrorCode()) );
3596       return kFALSE;
3597    }   
3598    return return_value;
3599 }
3600 
3601 //___________________________________________________________________
3602 Int_t ODBCDatabaseMetaData::GetMaxStatementLength()
3603 {
3604    // What's the maximum length of a SQL statement?
3605    //
3606    //   Returns:
3607    //         max length in bytes; a result of zero means that there 
3608    //         is no limit or the limit is not known
3609    //   Throws:
3610    //         TSQLException - if a database access error occurs
3611 
3612    Int_t return_value = 0;
3613    if(!fImp) { Destroyed();   return return_value; } 
3614 
3615    try {      
3616       odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3617       return_value = imp->getMaxStatementLength();
3618 
3619    } catch(odbc::SQLException& e) {
3620       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3621                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3622                                 e.getErrorCode()) );
3623       return 0;
3624    }   
3625    return return_value;
3626 }
3627 
3628 //___________________________________________________________________
3629 Int_t ODBCDatabaseMetaData::GetMaxStatements()
3630 {
3631    // How many active statements can we have open at one time to this 
3632    // database?
3633    //
3634    //   Returns:
3635    //        the maximum number of statements that can be open at 
3636    //        one time; a result of zero means that there is no limit
3637    //        or the limit is not known
3638    //   Throws:
3639    //         TSQLException - if a database access error occurs
3640    //
3641    // ... more comments based on  "ODBC 3.5 Developer's Guide"
3642    //
3643    // Identifies the maximum number of active SQL statements
3644    // the driver can support for a connection. A statement is defined
3645    // as active if it has results pending, with the term results
3646    // meaning ows from a SELECT operation or rows affected by an 
3647    // INSERT, UPDATE, or DELETE operation (such as a row count),
3648    // or if it is in a "Need Data" state. This value can reflect a
3649    // limitation imposed by either the  driver or the data source
3650    //
3651 
3652    Int_t return_value = 0;
3653    if(!fImp) { Destroyed();   return return_value; } 
3654    
3655    try {      
3656       odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3657       return_value = imp->getMaxStatements();
3658 
3659    } catch(odbc::SQLException& e) {
3660       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3661                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3662                                 e.getErrorCode()) );
3663       return 0;
3664    }   
3665    return return_value;
3666 }
3667 
3668 //___________________________________________________________________
3669 Int_t ODBCDatabaseMetaData::GetMaxTableNameLength()
3670 {
3671    // What's the maximum length of a table name?
3672    //
3673    //   Returns:
3674    //         max name length in bytes; a result of zero means that 
3675    //         there is no limit or the limit is not known
3676    //   Throws:
3677    //         TSQLException - if a database access error occurs
3678 
3679    Int_t return_value = 0;
3680    if(!fImp) { Destroyed();   return return_value; } 
3681 
3682    try {      
3683       odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3684       return_value = imp->getMaxTableNameLength();
3685 
3686    } catch(odbc::SQLException& e) {
3687       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3688                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3689                                 e.getErrorCode()) );
3690       return 0;
3691    }   
3692    return return_value;
3693 }
3694 
3695 //___________________________________________________________________
3696 Int_t ODBCDatabaseMetaData::GetMaxTablesInSelect()
3697 {
3698    // What's the maximum number of tables in a SELECT statement?
3699    //
3700    //   Returns:
3701    //         the maximum number of tables allowed in a SELECT 
3702    //         statement; a result of zero means that there is no 
3703    //         limit  or the limit is not known
3704    //   Throws:
3705    //         TSQLException - if a database access error occurs
3706    //
3707    // ... more comments based on  "ODBC 3.5 Developer's Guide"
3708    //
3709    // Identifies the maximum number of tables allowed in the
3710    // FROM clause of a SELECT statement.
3711    //
3712 
3713    Int_t return_value = 0;
3714    if(!fImp) { Destroyed();   return return_value; } 
3715    
3716    try {      
3717       odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3718       return_value = imp->getMaxTablesInSelect();
3719 
3720    } catch(odbc::SQLException& e) {
3721       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3722                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3723                                 e.getErrorCode()) );
3724       return 0;
3725    }  
3726    return return_value;
3727 }
3728 
3729 //___________________________________________________________________
3730 Int_t ODBCDatabaseMetaData::GetMaxUserNameLength()
3731 {
3732    // What's the maximum length of a user name?
3733    //
3734    //   Returns:
3735    //         max user name length in bytes; a result of zero means 
3736    //        that there is no limit or the limit is not known
3737    //   Throws:
3738    //         TSQLException - if a database access error occurs
3739 
3740    Int_t return_value = 0;
3741    if(!fImp) { Destroyed();   return return_value; } 
3742    
3743    try {      
3744       odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3745       return_value = imp->getMaxUserNameLength();
3746  
3747    } catch(odbc::SQLException& e) {
3748       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3749                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3750                                 e.getErrorCode()) );
3751       return 0;
3752    }   
3753    return return_value;
3754 }
3755 
3756 //___________________________________________________________________
3757 Int_t ODBCDatabaseMetaData::GetDefaultTransactionIsolation()
3758 {
3759    // What's the database's default transaction isolation level? 
3760    // The values are defined in TSQLConnection.
3761    //
3762    //   Returns:
3763    //         the default isolation level
3764    //   Throws:
3765    //         TSQLException - if a database access error occurs
3766    //   See Also: 
3767    //         TSQLConnection
3768 
3769    Int_t return_value = 0;
3770    if(!fImp) { Destroyed();   return return_value; } 
3771 
3772    try {      
3773       odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3774       return_value = imp->getDefaultTransactionIsolation();
3775 
3776    } catch(odbc::SQLException& e) {
3777       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3778                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3779                                 e.getErrorCode()) );
3780       return 0;
3781    }   
3782    return return_value;
3783 }
3784 
3785 //___________________________________________________________________
3786 Bool_t ODBCDatabaseMetaData::SupportsTransactions()
3787 {
3788    // Are transactions supported? If not, invoking the method commit 
3789    // is a noop and the isolation level is TRANSACTION_NONE.
3790    //
3791    //   Returns:
3792    //         kTRUE if transactions are supported; kFALSE otherwise
3793    //   Throws:
3794    //         TSQLException - if a database access error occurs
3795    
3796    Bool_t return_value = kFALSE;
3797    
3798    if(!fImp) { Destroyed();   return return_value; } 
3799    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3800    
3801    try {
3802       return_value = imp->supportsTransactions();
3803 
3804    } catch(odbc::SQLException& e) {
3805       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3806                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3807                                 e.getErrorCode()) );
3808       return kFALSE;
3809    }   
3810    return return_value;
3811 }
3812 
3813 //___________________________________________________________________
3814 Bool_t ODBCDatabaseMetaData::SupportsTransactionIsolationLevel(
3815                                                          Int_t level )
3816 {
3817    // Does this database support the given transaction isolation 
3818    // level?
3819    //
3820    //   Parameters:
3821    //         level - the values are defined in TSQLConnection
3822    //
3823    //   Returns:
3824    //         kTRUE if so; kFALSE otherwise
3825    //   Throws:
3826    //         TSQLException - if a database access error occurs
3827    //   See Also: 
3828    //         TSQLConnection
3829 
3830    Bool_t return_value = kFALSE;
3831    
3832    if(!fImp) { Destroyed();   return return_value; } 
3833    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3834    
3835    try {
3836       return_value = imp->supportsTransactionIsolationLevel(level);
3837 
3838    } catch(odbc::SQLException& e) {
3839       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3840                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3841                                 e.getErrorCode()) );
3842       return kFALSE;
3843    }   
3844    return return_value;
3845 }
3846 
3847 //___________________________________________________________________
3848 Bool_t ODBCDatabaseMetaData::SupportsDataDefinitionAndDataManipulationTransactions()
3849 {
3850    // Are both data definition and data manipulation statements 
3851    // within a transaction supported?
3852    //
3853    //   Returns:
3854    //         kTRUE if so; kFALSE otherwise
3855    //   Throws:
3856    //         TSQLException - if a database access error occurs
3857 
3858    Bool_t return_value = kFALSE;
3859    
3860    if(!fImp) { Destroyed();   return return_value; } 
3861    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3862    
3863    try {
3864       return_value = imp->supportsDataDefinitionAndDataManipulationTransactions();
3865 
3866    } catch(odbc::SQLException& e) {
3867       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3868                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3869                                 e.getErrorCode()) );
3870       return kFALSE;
3871    }   
3872    return return_value;
3873 }
3874 
3875 //___________________________________________________________________
3876 Bool_t ODBCDatabaseMetaData::SupportsDataManipulationTransactionsOnly()
3877 {
3878    // Are only data manipulation statements within a transaction 
3879    // supported?
3880    //
3881    //   Returns:
3882    //         kTRUE if so; kFALSE otherwise
3883    //   Throws:
3884    //         TSQLException - if a database access error occurs
3885 
3886    Bool_t return_value = kFALSE;
3887    
3888    if(!fImp) { Destroyed();   return return_value; } 
3889    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3890    
3891    try {
3892       return_value = imp->supportsDataManipulationTransactionsOnly();
3893 
3894    } catch(odbc::SQLException& e) {
3895       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3896                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3897                                 e.getErrorCode()) );
3898       return kFALSE;
3899    }   
3900    return return_value;
3901 }
3902 
3903 //___________________________________________________________________
3904 Bool_t ODBCDatabaseMetaData::DataDefinitionCausesTransactionCommit()
3905 {
3906    // Does a data definition statement within a transaction force 
3907    // the transaction to commit?
3908    //
3909    //   Returns:
3910    //         kTRUE if so; kFALSE otherwise
3911    //   Throws:
3912    //         TSQLException - if a database access error occurs
3913 
3914    Bool_t return_value = kFALSE;
3915    
3916    if(!fImp) { Destroyed();   return return_value; } 
3917    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3918    
3919    try {
3920       return_value = imp->dataDefinitionCausesTransactionCommit();
3921 
3922    } catch(odbc::SQLException& e) {
3923       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3924                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3925                                 e.getErrorCode()) );
3926       return kFALSE;
3927    }   
3928    return return_value;
3929 }
3930 
3931 //___________________________________________________________________
3932 Bool_t ODBCDatabaseMetaData::DataDefinitionIgnoredInTransactions()
3933 {
3934    // Is a data definition statement within a transaction ignored?
3935    //
3936    //   Returns:
3937    //         kTRUE if so; kFALSE otherwise
3938    //   Throws:
3939    //         TSQLException - if a database access error occurs
3940 
3941    Bool_t return_value = kFALSE;
3942    
3943    if(!fImp) { Destroyed();   return return_value; } 
3944    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
3945    
3946    try {      
3947       return_value = imp->dataDefinitionIgnoredInTransactions();
3948 
3949    } catch(odbc::SQLException& e) {
3950       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3951                                 ODBCXX_STRING_CSTR(e.getSQLState()),
3952                                 e.getErrorCode()) );
3953       return kFALSE;
3954    }   
3955    return return_value;
3956 }
3957 
3958 //___________________________________________________________________
3959 TSQLResultSet* ODBCDatabaseMetaData::GetProcedures(
3960                                  const TString& catalog,
3961                                  const TString& schemaPattern,
3962                                  const TString& procedureNamePattern )
3963 {
3964    // Gets a description of the stored procedures available in 
3965    // a catalog. 
3966    //
3967    //   Only procedure descriptions matching the schema and procedure 
3968    // name criteria are returned. They are ordered by PROCEDURE_SCHEM,
3969    // and PROCEDURE_NAME. 
3970    //
3971    //   Each procedure description has the the following columns:
3972    // 
3973    //     1.PROCEDURE_CAT string => procedure catalog (may be null) 
3974    //
3975    //     2.PROCEDURE_SCHEM string => procedure schema (may be null) 
3976    //
3977    //     3.PROCEDURE_NAME string => procedure name 
3978    //
3979    //     4.reserved for future use 
3980    //     5.reserved for future use 
3981    //     6.reserved for future use 
3982    //
3983    //     7.REMARKS string => explanatory comment on the procedure 
3984    //
3985    //     8.PROCEDURE_TYPE short => kind of procedure:
3986    // 
3987    //               kProcedureResultUnknown - May return a result 
3988    //               kProcedureNoResult - Does not return a result 
3989    //               kProcedureReturnsResult - Returns a result 
3990    //
3991    //   Parameters:
3992    //         catalog -  a catalog name; 
3993    //                   ""   - retrieves those without a catalog; 
3994    //         schemaPattern - a schema name pattern; 
3995    //                         ""  - retrieves  those without a schema
3996    //         procedureNamePattern - a procedure name pattern
3997    //
3998    //   Returns:
3999    //         TSQLResultSet - each row is a procedure description
4000    //   Throws:
4001    //         TSQLException - if a database access error occurs
4002    //   See Also: 
4003    //         GetSearchStringEscape()
4004 
4005    TSQLResultSet* rs = 0;
4006    
4007    if(!fImp) { Destroyed();   return rs; } 
4008    odbc::DatabaseMetaData* md = (odbc::DatabaseMetaData*)fImp;
4009    ClearWarnings();
4010    
4011    odbc::ResultSet* imp = 0;
4012 
4013    try { 
4014       imp = md->getProcedures( 
4015                      ODBCXX_STRING_C(catalog.Data()),
4016                      ODBCXX_STRING_C(schemaPattern.Data()),
4017                      ODBCXX_STRING_C(procedureNamePattern.Data()) );
4018    } catch(odbc::SQLException& e) {
4019       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
4020                                 ODBCXX_STRING_CSTR(e.getSQLState()),
4021                                 e.getErrorCode()) );
4022       if(imp) delete imp;
4023       return 0;
4024    }   
4025    return new ODBCResultSet(0,imp);
4026 }
4027 
4028 //___________________________________________________________________
4029 TSQLResultSet* ODBCDatabaseMetaData::GetProcedureColumns(
4030                                  const TString& catalog,
4031                                  const TString& schemaPattern,
4032                                  const TString& procedureNamePattern,
4033                                  const TString& columnNamePattern )
4034 {
4035    // Gets a description of a catalog's stored procedure parameters 
4036    // and result columns. 
4037    //
4038    //   Only descriptions matching the schema, procedure and 
4039    // parameter name criteria are returned. They are ordered by 
4040    // PROCEDURE_SCHEM and PROCEDURE_NAME. Within this, the return
4041    // value, if any, is first. Next are the parameter descriptions 
4042    // in call order. The column descriptions follow in column number
4043    // order. 
4044    //
4045    //   Each row in the TSQLResultSet is a parameter description or 
4046    // column description with the following fields: 
4047    //
4048    //      1.PROCEDURE_CAT string => procedure catalog (may be null) 
4049    //
4050    //      2.PROCEDURE_SCHEM string => procedure schema (may be null) 
4051    //
4052    //      3.PROCEDURE_NAME string => procedure name 
4053    //
4054    //      4.COLUMN_NAME string => column/parameter name 
4055    //
4056    //      5.COLUMN_TYPE Short => kind of column/parameter:
4057    // 
4058    //          kProcedureColumnUnknown - nobody knows 
4059    //          kProcedureColumnIn - IN parameter 
4060    //          kProcedureColumnInOut - INOUT parameter 
4061    //          kProcedureColumnOut - OUT parameter 
4062    //          kProcedureColumnReturn - procedure return value 
4063    //          kProcedureColumnResult - result column in TSQLResultSet 
4064    //
4065    //     6.DATA_TYPE short => SQL type from TSQLTypes 
4066    //
4067    //     7.TYPE_NAME string => SQL type name, for a UDT type 
4068    //                            the type name is fully qualified 
4069    //
4070    //     8.PRECISION int => precision 
4071    //
4072    //     9.LENGTH int => length in bytes of data 
4073    //
4074    //     10.SCALE short => scale 
4075    //
4076    //     11.RADIX short => radix 
4077    //
4078    //     12.NULLABLE short => can it contain NULL? 
4079    //
4080    //          kProcedureNoNulls - does not allow NULL values 
4081    //          kProcedureNullable - allows NULL values 
4082    //          kProcedureNullableUnknown - nullability unknown 
4083    //
4084    //     13.REMARKS string => comment describing parameter/column 
4085    //
4086    //   Note: Some databases may not return the column descriptions 
4087    //          for a procedure. Additional columns beyond REMARKS 
4088    //          can be defined by the database.
4089    //
4090    //   Parameters:
4091    //         catalog -  a catalog name; 
4092    //                      ""    -  retrieves those without a catalog; 
4093    //         schemaPattern - a schema name pattern; 
4094    //                         ""  - retrieves those without a schema
4095    //         procedureNamePattern - a procedure name pattern
4096    //         columnNamePattern - a column name pattern
4097    //
4098    //   Returns:
4099    //         TSQLResultSet - each row describes a stored procedure 
4100    //                         parameter or column
4101    //   Throws:
4102    //         TSQLException - if a database access error occurs
4103    //   See Also: 
4104    //         GetSearchStringEscape()
4105 
4106    TSQLResultSet* rs = 0;
4107    
4108    if(!fImp) { Destroyed(); return rs; } 
4109    odbc::DatabaseMetaData* md = (odbc::DatabaseMetaData*)fImp;
4110    ClearWarnings();
4111 
4112    odbc::ResultSet* imp = 0;
4113 
4114    try { 
4115       imp = md->getProcedureColumns(
4116                            ODBCXX_STRING_C(catalog.Data()),
4117                            ODBCXX_STRING_C(schemaPattern.Data()),
4118                            ODBCXX_STRING_C(procedureNamePattern.Data()),
4119                            ODBCXX_STRING_C(columnNamePattern.Data()) );
4120 
4121    } catch(odbc::SQLException& e) {
4122       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
4123                                 ODBCXX_STRING_CSTR(e.getSQLState()),
4124                                 e.getErrorCode()) );
4125       if(imp) delete imp;
4126       return 0;
4127    }   
4128    return new ODBCResultSet(0,imp);
4129 }
4130 
4131 //___________________________________________________________________
4132 TSQLResultSet* ODBCDatabaseMetaData::GetTables(
4133                                     const TString& catalog,
4134                                     const TString& schemaPattern,
4135                                     const TString& tableNamePattern,
4136                                     const TString& types )
4137 {
4138    // Gets a description of tables available in a catalog. 
4139    //
4140    //   Only table descriptions matching the catalog, schema, 
4141    // table name and type criteria are returned. They are ordered 
4142    // by TABLE_TYPE, TABLE_SCHEM and TABLE_NAME. 
4143    //
4144    //   Each table description has the following columns:
4145    // 
4146    //      1.TABLE_CAT string => table catalog (may be null) 
4147    //
4148    //      2.TABLE_SCHEM string => table schema (may be null) 
4149    //
4150    //      3.TABLE_NAME string => table name 
4151    //
4152    //      4.TABLE_TYPE string => table type. Typical types are:
4153    // 
4154    //                   "TABLE", "VIEW", "SYSTEM TABLE", 
4155    //                   "GLOBAL TEMPORARY", "LOCAL TEMPORARY", 
4156    //                   "ALIAS", "SYNONYM". 
4157    //
4158    //      5.REMARKS string => explanatory comment on the table 
4159    //
4160    // Note: Some databases may not return information for all tables.
4161    //
4162    //   Parameters:
4163    //          catalog -   a catalog name; 
4164    //                      ""   - retrieves those without a catalog; 
4165    //          schemaPattern - a schema name pattern; 
4166    //                      ""   - retrieves those without a schema
4167    //          tableNamePattern - a table name pattern
4168    //          types -  a list of table types to include; 
4169    //                   null returns all types
4170    //
4171    //   Returns:
4172    //         TSQLResultSet - each row is a table description
4173    //   Throws:
4174    //         TSQLException - if a database access error occurs
4175    //   See Also: 
4176    //          GetSearchStringEscape()
4177 
4178    TSQLResultSet* rs = 0;
4179    
4180    if(!fImp) { Destroyed();   return rs; } 
4181    odbc::DatabaseMetaData* md = (odbc::DatabaseMetaData*)fImp;
4182    ClearWarnings();
4183    
4184    using namespace std;
4185    
4186    std::vector<ODBCXX_STRING> vec;
4187    
4188    if( types.Contains("TABLE",TString::kIgnoreCase) &&
4189       !types.Contains("SYSTEM TABLE",TString::kIgnoreCase)  ) {
4190       vec.push_back(ODBCXX_STRING_C("TABLE"));
4191    } else if ( types.Contains("VIEW",TString::kIgnoreCase) ) {
4192       vec.push_back(ODBCXX_STRING_C("VIEW"));
4193    } else if ( types.Contains("SYSTEM TABLE",TString::kIgnoreCase) ) {
4194       vec.push_back(ODBCXX_STRING_C("SYSTEM TABLE"));
4195    } else if ( types.Contains("GLOBAL TEMPORARY",TString::kIgnoreCase) ) {
4196       vec.push_back(ODBCXX_STRING_C("GLOBAL TEMPORARY"));
4197    } else if ( types.Contains("LOCAL TEMPORARY",TString::kIgnoreCase) ) {
4198       vec.push_back(ODBCXX_STRING_C("LOCAL TEMPORARY"));
4199    } else if ( types.Contains("ALIAS",TString::kIgnoreCase) ) {
4200       vec.push_back(ODBCXX_STRING_C("ALIAS"));
4201    } else if ( types.Contains("SYNONYM",TString::kIgnoreCase) ) {   
4202       vec.push_back(ODBCXX_STRING_C("SYNONYM"));
4203    } else if (vec.empty()) {
4204       vec.push_back(ODBCXX_STRING_C(""));
4205    }
4206 
4207    odbc::ResultSet* imp = 0;
4208  
4209    try {
4210       imp = md->getTables( ODBCXX_STRING_C(catalog.Data()),
4211                            ODBCXX_STRING_C(schemaPattern.Data()),
4212                               ODBCXX_STRING_C(tableNamePattern.Data()),
4213                               vec );
4214    } catch(odbc::SQLException& e) {
4215       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
4216                                 ODBCXX_STRING_CSTR(e.getSQLState()),
4217                                 e.getErrorCode()) );
4218       if(imp) delete imp;
4219       return 0;
4220    }   
4221    return new ODBCResultSet(0,imp);
4222 }
4223 
4224 //___________________________________________________________________
4225 TSQLResultSet* ODBCDatabaseMetaData::GetSchemas()
4226 {
4227    // Gets the schema names available in this database. The results 
4228    // are ordered by schema name. 
4229    //
4230    //   The schema column is: 
4231    //      1.TABLE_SCHEM string => schema name 
4232    //
4233    //   Returns:
4234    //        TSQLResultSet -  each row has a single string column 
4235    //                         that is a schema name
4236    //   Throws:
4237    //         TSQLException - if a database access error occurs
4238 
4239    TSQLResultSet* rs = 0;
4240    
4241    if(!fImp) { Destroyed();   return rs; } 
4242    odbc::DatabaseMetaData* md = (odbc::DatabaseMetaData*)fImp;
4243    ClearWarnings();
4244    
4245    odbc::ResultSet* imp = 0;
4246 
4247    try { 
4248       imp = md->getSchemas();
4249    } catch(odbc::SQLException& e) {
4250       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
4251                                 ODBCXX_STRING_CSTR(e.getSQLState()),
4252                                 e.getErrorCode()) );
4253       if(imp) delete imp;
4254       return 0;
4255    }   
4256    return new ODBCResultSet(0,imp);
4257 }
4258 
4259 //___________________________________________________________________
4260 TSQLResultSet* ODBCDatabaseMetaData::GetCatalogs()
4261 {
4262    // Gets the catalog names available in this database. The results 
4263    // are ordered by catalog name. 
4264    //
4265    //   The catalog column is: 
4266    //      1.TABLE_CAT string => catalog name 
4267    //
4268    //   Returns:
4269    //         TSQLResultSet - each row has a single string column 
4270    //                         that is a catalog name
4271    //   Throws:
4272    //         TSQLException - if a database access error occurs
4273 
4274    TSQLResultSet* rs = 0;
4275    
4276    if(!fImp) { Destroyed();   return rs; } 
4277    odbc::DatabaseMetaData* md = (odbc::DatabaseMetaData*)fImp;
4278    ClearWarnings();
4279 
4280    odbc::ResultSet* imp = 0;
4281 
4282    try { 
4283       imp = md->getCatalogs();
4284    } catch(odbc::SQLException& e) {
4285       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
4286                                 ODBCXX_STRING_CSTR(e.getSQLState()),
4287                                 e.getErrorCode()) );
4288    
4289       if(imp) delete imp;
4290       return 0;
4291    }   
4292    return new ODBCResultSet(0,imp);
4293 }
4294 
4295 //___________________________________________________________________
4296 TSQLResultSet* ODBCDatabaseMetaData::GetTableTypes()
4297 {
4298    // Gets the table types available in this database. The results 
4299    // are ordered by table type. 
4300    //
4301    //   The table type is:
4302    //      1.TABLE_TYPE string => table type. Typical types are:
4303    // 
4304    //                   "TABLE", "VIEW", "SYSTEM TABLE", 
4305    //                   "GLOBAL TEMPORARY","LOCAL TEMPORARY", 
4306    //                   "ALIAS", "SYNONYM". 
4307    //
4308    //   Returns:
4309    //         TSQLResultSet - each row has a single string column 
4310    //                         that is a table type
4311    //   Throws:
4312    //         TSQLException - if a database access error occurs
4313 
4314    TSQLResultSet* rs = 0;
4315 
4316    if(!fImp) { Destroyed();   return rs; } 
4317    odbc::DatabaseMetaData* md = (odbc::DatabaseMetaData*)fImp;
4318    ClearWarnings();
4319 
4320    odbc::ResultSet* imp = 0;
4321 
4322    try { 
4323       imp = md->getTableTypes();
4324    } catch(odbc::SQLException& e) {
4325       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
4326                                 ODBCXX_STRING_CSTR(e.getSQLState()),
4327                                 e.getErrorCode()) );
4328       if(imp) delete imp;
4329       return 0;
4330       
4331    }   
4332    return new ODBCResultSet(0,imp);
4333 }
4334 
4335 //___________________________________________________________________
4336 TSQLResultSet* ODBCDatabaseMetaData::GetColumns(
4337                                     const TString& catalog,
4338                                     const TString& schemaPattern,
4339                                     const TString& tableNamePattern,
4340                                     const TString& columnNamePattern )
4341 {
4342    // Gets a description of table columns available in the specified 
4343    // catalog. 
4344    //
4345    //   Only column descriptions matching the catalog, schema, 
4346    // table and column name criteria are returned. They are ordered 
4347    // by TABLE_SCHEM, TABLE_NAME and ORDINAL_POSITION. 
4348    //
4349    //   Each column description has the following columns: 
4350    //
4351    //      1.TABLE_CAT string => table catalog (may be null) 
4352    //
4353    //      2.TABLE_SCHEM string => table schema (may be null) 
4354    //
4355    //      3.TABLE_NAME string => table name 
4356    //
4357    //      4.COLUMN_NAME string => column name 
4358    //
4359    //      5.DATA_TYPE short => SQL type from TSQLTypes 
4360    //
4361    //      6.TYPE_NAME string => Data source dependent type name, 
4362    //                   for a UDT the type name is fully qualified 
4363    //
4364    //      7.COLUMN_SIZE int => column size. For char or date types 
4365    //                   this is the maximum number of characters, 
4366    //                   for numeric or decimal types this is precision. 
4367    //
4368    //      8.BUFFER_LENGTH is not used. 
4369    //
4370    //      9.DECIMAL_DIGITS int => the number of fractional digits 
4371    //
4372    //     10.NUM_PREC_RADIX int => Radix (typically either 10 or 2) 
4373    //
4374    //     11.NULLABLE int => is NULL allowed? 
4375    //
4376    //               kColumnNoNulls - might not allow NULL values 
4377    //               kColumnNullable - definitely allows NULL values 
4378    //               kColumnNullableUnknown - nullability unknown 
4379    //
4380    //     12.REMARKS string => comment describing column (may be null) 
4381    //
4382    //     13.COLUMN_DEF string => default value (may be null) 
4383    //
4384    //     14.SQL_DATA_TYPE int => unused 
4385    //
4386    //     15.SQL_DATETIME_SUB int => unused 
4387    //
4388    //     16.CHAR_OCTET_LENGTH int => for char types the maximum 
4389    //                                  number of bytes in the column 
4390    //
4391    //     17.ORDINAL_POSITION int => index of column in 
4392    //                                  table  (starting at 1) 
4393    //
4394    //     18.IS_NULLABLE string => "NO" means column definitely 
4395    //                                  does not allow NULL values;
4396    //                             "YES" means the column might allow 
4397    //                                  NULL values. 
4398    //                             An empty string means nobody knows. 
4399    //
4400    //   Parameters:
4401    //         catalog - a catalog name; 
4402    //                   ""   -  retrieves those without a catalog; 
4403    //         schemaPattern - a schema name pattern; 
4404    //                         ""  - retrieves those without a schema
4405    //         tableNamePattern - a table name pattern
4406    //         columnNamePattern - a column name pattern
4407    //
4408    //   Returns:
4409    //         TSQLResultSet - each row is a column description
4410    //   Throws:
4411    //         TSQLException - if a database access error occurs
4412    //   See Also: 
4413    //         GetSearchStringEscape()
4414 
4415    TSQLResultSet* rs = 0;
4416    
4417    if(!fImp) { Destroyed();   return rs; } 
4418    odbc::DatabaseMetaData* md = (odbc::DatabaseMetaData*)fImp;
4419    ClearWarnings();
4420    
4421    odbc::ResultSet* imp = 0;
4422 
4423    try { 
4424       imp = md->getColumns( 
4425                            ODBCXX_STRING_C(catalog.Data()),
4426                               ODBCXX_STRING_C(schemaPattern.Data()),
4427                               ODBCXX_STRING_C(tableNamePattern.Data()),
4428                               ODBCXX_STRING_C(columnNamePattern.Data()) );
4429    } catch(odbc::SQLException& e) {
4430       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
4431                                 ODBCXX_STRING_CSTR(e.getSQLState()),
4432                                 e.getErrorCode()) );
4433       if(imp) delete imp;
4434       return 0;
4435    }   
4436    return new ODBCResultSet(0,imp);
4437 }
4438 
4439 //___________________________________________________________________
4440 TSQLResultSet* ODBCDatabaseMetaData::GetColumnPrivileges(
4441                                      const TString& catalog,
4442                                      const TString& schema,
4443                                      const TString& table,
4444                                      const TString& columnNamePattern )
4445 {
4446    // Gets a description of the access rights for a table's columns. 
4447    //
4448    //   Only privileges matching the column name criteria are 
4449    // returned. They are ordered by COLUMN_NAME and PRIVILEGE. 
4450    //
4451    //   Each privilige description has the following columns:
4452    // 
4453    //      1.TABLE_CAT string => table catalog (may be null) 
4454    //
4455    //      2.TABLE_SCHEM string => table schema (may be null) 
4456    //
4457    //      3.TABLE_NAME string => table name 
4458    //
4459    //      4.COLUMN_NAME string => column name 
4460    //
4461    //      5.GRANTOR => grantor of access (may be null) 
4462    //
4463    //      6.GRANTEE string => grantee of access 
4464    //
4465    //      7.PRIVILEGE string => name of access (SELECT, INSERT, 
4466    //                            UPDATE, REFRENCES, ...)
4467    // 
4468    //      8.IS_GRANTABLE string => "YES" if grantee is permitted 
4469    //                                     to grant to others; 
4470    //                               "NO"  if not; 
4471    //                               null  if unknown 
4472    //
4473    //   Parameters:
4474    //         catalog - a catalog name; 
4475    //                   ""   - retrieves those without a catalog; 
4476    //         schema - a schema name; 
4477    //                   ""  - retrieves those without a schema
4478    //         table - a table name
4479    //         columnNamePattern - a column name pattern
4480    //
4481    //   Returns:
4482    //         TSQLResultSet - each row is a column privilege 
4483    //                         description
4484    //   Throws:
4485    //         TSQLException - if a database access error occurs
4486    //   See Also: 
4487    //         GetSearchStringEscape()
4488 
4489    TSQLResultSet* rs = 0;
4490    
4491    if(!fImp) { Destroyed();   return rs; } 
4492    odbc::DatabaseMetaData* md = (odbc::DatabaseMetaData*)fImp;
4493    ClearWarnings();
4494 
4495    odbc::ResultSet* imp = 0;
4496 
4497    try { 
4498       imp = md->getColumnPrivileges(
4499                            ODBCXX_STRING_C(catalog.Data()),
4500                                ODBCXX_STRING_C(schema.Data()),
4501                                ODBCXX_STRING_C(table.Data()),
4502                                ODBCXX_STRING_C(columnNamePattern.Data()));
4503 
4504    } catch(odbc::SQLException& e) {
4505       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
4506                                 ODBCXX_STRING_CSTR(e.getSQLState()),
4507                                 e.getErrorCode()) );   
4508       if(imp) delete imp;
4509       return 0;
4510    }   
4511    return new ODBCResultSet(0,imp);
4512 }
4513 
4514 //___________________________________________________________________
4515 TSQLResultSet* ODBCDatabaseMetaData::GetTablePrivileges(
4516                                     const TString& catalog,
4517                                     const TString& schemaPattern,
4518                                     const TString& tableNamePattern )
4519 {
4520    // Gets a description of the access rights for each table 
4521    // available in a catalog. Note that a table privilege applies 
4522    // to one or more columns in the table. It would be wrong to 
4523    // assume that this priviledge applies to all columns (this may 
4524    // be true for some systems but is not true for all.) 
4525    //
4526    //   Only privileges matching the schema and table name criteria 
4527    // are returned. They are ordered by TABLE_SCHEM, TABLE_NAME, 
4528    // and PRIVILEGE. 
4529    //
4530    //   Each privilige description has the following columns:
4531    // 
4532    //      1.TABLE_CAT string => table catalog (may be null) 
4533    //
4534    //      2.TABLE_SCHEM string => table schema (may be null) 
4535    //
4536    //      3.TABLE_NAME string => table name 
4537    //
4538    //      4.GRANTOR => grantor of access (may be null) 
4539    //
4540    //      5.GRANTEE string => grantee of access 
4541    //
4542    //      6.PRIVILEGE string => name of access (SELECT, INSERT, 
4543    //                            UPDATE, REFRENCES, ...) 
4544    //
4545    //      7.IS_GRANTABLE string => "YES" -  if grantee is permitted 
4546    //                                        to grant to others; 
4547    //                               "NO"  -  if not; 
4548    //                               null  -  if unknown 
4549    //
4550    //   Parameters:
4551    //         catalog - a catalog name; 
4552    //                   ""   - retrieves those without a catalog; 
4553    //         schemaPattern - a schema name pattern; 
4554    //                   ""  - retrieves those without a schema
4555    //         tableNamePattern - a table name pattern
4556    //
4557    //   Returns:
4558    //         TSQLResultSet - each row is a table privilege 
4559    //                         description
4560    //   Throws:
4561    //         TSQLException - if a database access error occurs
4562    //   See Also: 
4563    //         GetSearchStringEscape()
4564    
4565    TSQLResultSet* rs = 0;
4566    
4567    if(!fImp) { Destroyed();   return rs; } 
4568    odbc::DatabaseMetaData* md = (odbc::DatabaseMetaData*)fImp;
4569    ClearWarnings();
4570 
4571    odbc::ResultSet* imp = 0;
4572 
4573    try {  
4574       imp = md->getTablePrivileges(
4575                            ODBCXX_STRING_C(catalog.Data()),
4576                                ODBCXX_STRING_C(schemaPattern.Data()),
4577                                ODBCXX_STRING_C(tableNamePattern.Data()));
4578    } catch(odbc::SQLException& e) {
4579       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
4580                                 ODBCXX_STRING_CSTR(e.getSQLState()),
4581                                 e.getErrorCode()) );   
4582       if(imp) delete imp;
4583       return 0;
4584    }   
4585    return new ODBCResultSet(0,imp);
4586 }
4587 
4588 //___________________________________________________________________
4589 TSQLResultSet* ODBCDatabaseMetaData::GetBestRowIdentifier(
4590                                              const TString& catalog,
4591                                              const TString& schema,
4592                                              const TString& table,
4593                                              Int_t scope,
4594                                              Bool_t nullable )
4595 {
4596    // Gets a description of a table's optimal set of columns that 
4597    // uniquely identifies a row. They are ordered by SCOPE. 
4598    //
4599    //   Each column description has the following columns: 
4600    //
4601    //      1.SCOPE short => actual scope of result
4602    // 
4603    //          kBestRowTemporary - very temporary, while using row    
4604    //          kBestRowTransaction - valid for remainder of current 
4605    //                               transaction 
4606    //          kBestRowSession - valid for remainder of current session 
4607    //
4608    //      2.COLUMN_NAME string => column name 
4609    //
4610    //      3.DATA_TYPE short => SQL data type from TSQLTypes 
4611    //
4612    //      4.TYPE_NAME string => Data source dependent type name, 
4613    //                            for a UDT the type name is fully 
4614    //                            qualified 
4615    //
4616    //      5.COLUMN_SIZE int => precision 
4617    //
4618    //      6.BUFFER_LENGTH int => not used 
4619    //
4620    //      7.DECIMAL_DIGITS short => scale 
4621    //
4622    //      8.PSEUDO_COLUMN short => is this a pseudo column like 
4623    //                               an Oracle ROWID
4624    //  
4625    //          kBestRowUnknown - may or may not  be pseudo column  
4626    //          kBestRowNotPseudo - is NOT a  pseudo column 
4627    //          kBestRowPseudo - is a pseudo column 
4628    //
4629    //   Parameters:
4630    //         catalog - a catalog name; 
4631    //                   ""  -  retrieves those without a catalog; 
4632    //         schema - a schema name; 
4633    //                  ""  - retrieves those without a schema
4634    //         table - a table name
4635    //         scope - the scope of interest; use same values as SCOPE
4636    //         nullable - include columns that are nullable?
4637    //
4638    //   Returns:
4639    //         TSQLResultSet - each row is a column description
4640    //   Throws:
4641    //         TSQLException - if a database access error occurs
4642 
4643    TSQLResultSet* rs = 0;
4644    
4645    if(!fImp) { Destroyed();   return rs; } 
4646    odbc::DatabaseMetaData* md = (odbc::DatabaseMetaData*)fImp;
4647    ClearWarnings();
4648    
4649    odbc::ResultSet* imp = 0;
4650 
4651    try { 
4652       imp = md->getBestRowIdentifier(
4653                                  ODBCXX_STRING_C(catalog.Data()),
4654                                  ODBCXX_STRING_C(schema.Data()),
4655                                  ODBCXX_STRING_C(table.Data()),
4656                                  scope,nullable);
4657    } catch(odbc::SQLException& e) {
4658       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
4659                                 ODBCXX_STRING_CSTR(e.getSQLState()),
4660                                 e.getErrorCode()) );
4661       if(imp) delete imp;
4662       return 0; 
4663    }   
4664    return new ODBCResultSet(0,imp);
4665 }
4666 
4667 //___________________________________________________________________
4668 TSQLResultSet* ODBCDatabaseMetaData::GetVersionColumns(
4669                                              const TString& catalog,
4670                                              const TString& schema,
4671                                              const TString& table )
4672 {
4673    // Gets a description of a table's columns that are automatically 
4674    // updated when any value in a row is updated. They are unordered. 
4675    //
4676    //   Each column description has the following columns: 
4677    //
4678    //      1.SCOPE short => is not used 
4679    //
4680    //      2.COLUMN_NAME string => column name 
4681    //
4682    //      3.DATA_TYPE short => SQL data type from TSQLTypes 
4683    //
4684    //      4.TYPE_NAME string => Data source dependent type name 
4685    //
4686    //      5.COLUMN_SIZE int => precision 
4687    //
4688    //      6.BUFFER_LENGTH int => length of column value in bytes 
4689    //
4690    //      7.DECIMAL_DIGITS short => scale 
4691    //
4692    //      8.PSEUDO_COLUMN short => is this a pseudo column like 
4693    //                               an Oracle ROWID
4694    //
4695    //          kVersionColumnUnknown - may or may not be pseudo column 
4696    //          kVersionColumnNotPseudo - is NOT a pseudo column 
4697    //          kVersionColumnPseudo - is a pseudo column 
4698    //
4699    //   Parameters:
4700    //          catalog - a catalog name; 
4701    //                   "" -     retrieves those without a catalog; 
4702    //          schema - a schema name; 
4703    //                   "" retrieves those without a schema
4704    //          table - a table name
4705    //
4706    //   Returns:
4707    //         TSQLResultSet - each row is a column description
4708    //   Throws:
4709    //         TSQLException - if a database access error occurs
4710 
4711    TSQLResultSet* rs = 0;
4712    
4713    if(!fImp) { Destroyed();   return rs; } 
4714    odbc::DatabaseMetaData* md = (odbc::DatabaseMetaData*)fImp;
4715    ClearWarnings();
4716 
4717    odbc::ResultSet* imp = 0;
4718 
4719    try { 
4720       imp = md->getVersionColumns( ODBCXX_STRING_C(catalog.Data()),
4721                                    ODBCXX_STRING_C(schema.Data()),
4722                                    ODBCXX_STRING_C(table.Data()) );
4723 
4724    } catch(odbc::SQLException& e) {
4725       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
4726                                 ODBCXX_STRING_CSTR(e.getSQLState()),
4727                                 e.getErrorCode()) );   
4728       if(imp) delete imp;
4729       return 0;
4730    }   
4731    return new ODBCResultSet(0,imp);
4732 }
4733 
4734 //___________________________________________________________________
4735 TSQLResultSet* ODBCDatabaseMetaData::GetPrimaryKeys(
4736                                              const TString& catalog,
4737                                              const TString& schema,
4738                                              const TString& table )
4739 {
4740    // Gets a description of a table's primary key columns. 
4741    // They are ordered by COLUMN_NAME.
4742    //
4743    //  Each primary key column description has the following columns:
4744    // 
4745    //      1.TABLE_CAT string => table catalog (may be null) 
4746    //
4747    //      2.TABLE_SCHEM string => table schema (may be null) 
4748    //
4749    //      3.TABLE_NAME string => table name 
4750    //
4751    //      4.COLUMN_NAME string => column name 
4752    //
4753    //      5.KEY_SEQ short => sequence number within primary key 
4754    //
4755    //      6.PK_NAME string => primary key name (may be null) 
4756    //
4757    //   Parameters:
4758    //         catalog - a catalog name; 
4759    //                   "" -   retrieves those without a catalog; 
4760    //         schema - a schema name; 
4761    //                   "" - retrieves those without  a schema
4762    //         table - a table name
4763    //
4764    //   Returns:
4765    //         TSQLResultSet - each row is a primary key column 
4766    //                         description
4767    //   Throws:
4768    //         TSQLException - if a database access error occurs
4769 
4770    TSQLResultSet* rs = 0;
4771    
4772    if(!fImp) { Destroyed();   return rs; } 
4773    odbc::DatabaseMetaData* md = (odbc::DatabaseMetaData*)fImp;
4774    ClearWarnings();
4775 
4776    odbc::ResultSet* imp = 0;
4777 
4778    try {
4779       imp = md->getPrimaryKeys( ODBCXX_STRING_C(catalog.Data()),
4780                                 ODBCXX_STRING_C(schema.Data()),
4781                                 ODBCXX_STRING_C(table.Data()) );
4782    } catch(odbc::SQLException& e) {
4783       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
4784                                 ODBCXX_STRING_CSTR(e.getSQLState()),
4785                                 e.getErrorCode()) );   
4786       if(imp) delete imp;
4787       return 0;
4788    }   
4789    return new ODBCResultSet(0,imp);
4790 }
4791 
4792 //___________________________________________________________________
4793 TSQLResultSet* ODBCDatabaseMetaData::GetImportedKeys(
4794                                              const TString& catalog,
4795                                              const TString& schema,
4796                                              const TString& table )
4797 {
4798    // Gets a description of the primary key columns that are 
4799    // referenced by a table's foreign key columns (the primary keys
4800    // imported by a table). They are ordered by PKTABLE_CAT,
4801    // PKTABLE_SCHEM, PKTABLE_NAME, and KEY_SEQ. 
4802    //
4803    //  Each primary key column description has the following columns: 
4804    //
4805    //    1.PKTABLE_CAT string => primary key table catalog being 
4806    //                            imported (may be null)
4807    //
4808    //    2.PKTABLE_SCHEM string => primary key table schema being
4809    //                             imported (may be null) 
4810    //
4811    //    3.PKTABLE_NAME string => primary key table name being 
4812    //                             imported 
4813    //
4814    //    4.PKCOLUMN_NAME string => primary key column name being    
4815    //                             imported 
4816    //
4817    //    5.FKTABLE_CAT string => foreign key table catalog 
4818    //                            (may be null) 
4819    //
4820    //    6.FKTABLE_SCHEM string => foreign key table schema 
4821    //                               (may be null) 
4822    //
4823    //    7.FKTABLE_NAME string => foreign key table name 
4824    //
4825    //    8.FKCOLUMN_NAME string => foreign key column name 
4826    //
4827    //    9.KEY_SEQ short => sequence number within foreign key 
4828    //
4829    //    10.UPDATE_RULE short =>  What happens to foreign key when 
4830    //                             primary is updated: 
4831    //
4832    //        kImportedNoAction -  do not allow update of primary key 
4833    //                             if it has been imported 
4834    //        kImportedKeyCascade -  change imported key to agree 
4835    //                               with primary key update 
4836    //        kImportedKeySetNull -  change imported key to NULL if 
4837    //                               its primary key has been updated 
4838    //        kImportedKeySetDefault - change imported key to default
4839    //                                  values if its primary key has 
4840    //                                  been updated 
4841    //        kImportedKeyRestrict - same as kImportedKeyNoAction 
4842    //
4843    //     11.DELETE_RULE short => What happens to the foreign key 
4844    //                             when primary is deleted:
4845    //   
4846    //        kImportedKeyNoAction - do not allow delete of primary
4847    //                               key if it has been imported 
4848    //        kImportedKeyCascade -  delete rows that import a 
4849    //                               deleted key 
4850    //        kImportedKeySetNull -  change imported key to NULL 
4851    //                               if its primary key has been deleted 
4852    //        kImportedKeyRestrict - same as kImportedKeyNoAction 
4853    //        kImportedKeySetDefault - change imported key to default
4854    //                               if its primary key has been deleted
4855    // 
4856    //     12.FK_NAME string => foreign key name (may be null) 
4857    //
4858    //     13.PK_NAME string => primary key name (may be null) 
4859    //
4860    //     14.DEFERRABILITY short => can the evaluation of foreign key
4861    //                            constraints be deferred until commit
4862    // 
4863    //       kImportedKeyInitiallyDeferred - see SQL92 for definition 
4864    //       kImportedKeyInitiallyImmediate - see SQL92 for definition 
4865    //       kImportedKeyNotDeferrable - see SQL92 for definition 
4866    //
4867    //   Parameters:
4868    //       catalog - a catalog name; 
4869    //                   ""    - retrieves those without a catalog; 
4870    //       schema - a schema name; 
4871    //                   ""   - retrieves those without a schema
4872    //       table - a table name
4873    //
4874    //   Returns:
4875    //       TSQLResultSet - each row is a primary key column description
4876    //   Throws:
4877    //         TSQLException - if a database access error occurs
4878    //   See Also: 
4879    //         GetExportedKeys(const TString&,
4880    //                         const TString&,
4881    //                         const TString&)
4882 
4883    TSQLResultSet* rs = 0;
4884    
4885    if(!fImp) { Destroyed();   return rs; } 
4886    odbc::DatabaseMetaData* md = (odbc::DatabaseMetaData*)fImp;
4887    ClearWarnings();
4888 
4889    odbc::ResultSet* imp = 0;
4890 
4891    try { 
4892       imp = md->getImportedKeys( ODBCXX_STRING_C(catalog.Data()),
4893                                  ODBCXX_STRING_C(schema.Data()),
4894                                  ODBCXX_STRING_C(table.Data()) );
4895 
4896    } catch(odbc::SQLException& e) {
4897       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
4898                                 ODBCXX_STRING_CSTR(e.getSQLState()),
4899                                 e.getErrorCode()) );   
4900       if(imp) delete imp;
4901       return 0;   
4902    }   
4903    return new ODBCResultSet(0,imp);
4904 }
4905 
4906 //___________________________________________________________________
4907 TSQLResultSet* ODBCDatabaseMetaData::GetExportedKeys( 
4908                                              const TString& catalog,
4909                                              const TString& schema,
4910                                              const TString& table )
4911 {
4912    // Gets a description of the foreign key columns that reference 
4913    // a table's primary key columns (the foreign keys exported by 
4914    // a table). They are ordered by FKTABLE_CAT, FKTABLE_SCHEM, 
4915    // FKTABLE_NAME, and KEY_SEQ. 
4916    //
4917    // Each foreign key column description has the following columns: 
4918    //
4919    //    1.PKTABLE_CAT string => primary key table catalog (may be null) 
4920    //
4921    //    2.PKTABLE_SCHEM string => primary key  table schema (may be null) 
4922    //
4923    //    3.PKTABLE_NAME string => primary key table name 
4924    //
4925    //    4.PKCOLUMN_NAME string => primary key column name 
4926    //
4927    //    5.FKTABLE_CAT string => foreign key table catalog (may be 
4928    //                            null) being exported (may be null) 
4929    //
4930    //    6.FKTABLE_SCHEM string => foreign key table schema (may be 
4931    //                              null) being exported (may be null) 
4932    //    7.FKTABLE_NAME string => foreign key table name being  exported 
4933    //
4934    //    8.FKCOLUMN_NAME string => foreign key column name being  exported 
4935    //
4936    //    9.KEY_SEQ short => sequence number within foreign key 
4937    //
4938    //    10.UPDATE_RULE short => What happens to foreign key when 
4939    //                            primary is updated: 
4940    //
4941    //          kImportedNoAction -  do not allow update of primary 
4942    //                               key if it has been imported 
4943    //          kImportedKeyCascade - change imported key to agree 
4944    //                               with primary key update 
4945    //          kImportedKeySetNull - change imported key to NULL 
4946    //                               if its primary key has been updated 
4947    //          kImportedKeySetDefault - change imported key to default 
4948    //                               values if its primary key has been 
4949    //                               updated 
4950    //          kImportedKeyRestrict - same as kImportedKeyNoAction 
4951    //
4952    //    11.DELETE_RULE short => What happens to the foreign key 
4953    //                            when primary is deleted:
4954    // 
4955    //          kImportedKeyNoAction -  do not allow delete of primary
4956    //                                  key if it has been imported 
4957    //          kImportedKeyCascade -   delete rows that import a 
4958    //                                  deleted key 
4959    //          kImportedKeySetNull -   change imported key to NULL if 
4960    //                                  its primary key has been deleted 
4961    //          kImportedKeyRestrict -  same as kImportedKeyNoAction 
4962    //          kImportedKeySetDefault - change imported key to default
4963    //                                  if its primary key has been 
4964    //                                  deleted 
4965    //
4966    //    12.FK_NAME string => foreign key name (may be null) 
4967    //
4968    //    13.PK_NAME string => primary key name (may be null) 
4969    //
4970    //    14.DEFERRABILITY short => can the evaluation of foreign key 
4971    //                            constraints be deferred until commit 
4972    //
4973    //          kImportedKeyInitiallyDeferred - see SQL92 for definition 
4974    //          kImportedKeyInitiallyImmediate - see SQL92 for definition 
4975    //          kImportedKeyNotDeferrable - see SQL92 for definition 
4976    //
4977    //   Parameters:
4978    //       catalog - a catalog name; 
4979    //                   ""    -  retrieves those without a  catalog; 
4980    //       schema - a schema name; 
4981    //                   ""    -  retrieves those without a schema
4982    //       table - a table name
4983    //
4984    //   Returns:
4985    //       TSQLResultSet -   each row is a foreign key column 
4986    //                         description
4987    //   Throws:
4988    //         TSQLException - if a database access error occurs
4989    //   See Also: 
4990    //         GetImportedKeys( const TString&,
4991    //                          const TString&,
4992    //                          const TString& )
4993 
4994    TSQLResultSet* rs = 0;
4995    
4996    if(!fImp) { Destroyed();   return rs; } 
4997    odbc::DatabaseMetaData* md = (odbc::DatabaseMetaData*)fImp;
4998    ClearWarnings();
4999 
5000    odbc::ResultSet* imp = 0;
5001 
5002    try { 
5003       imp = md->getExportedKeys( ODBCXX_STRING_C(catalog.Data()),
5004                                  ODBCXX_STRING_C(schema.Data()),
5005                                  ODBCXX_STRING_C(table.Data()) );
5006    } catch(odbc::SQLException& e) {
5007       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
5008                                 ODBCXX_STRING_CSTR(e.getSQLState()),
5009                                 e.getErrorCode()) );   
5010       if(imp) delete imp;
5011       return 0; 
5012    }   
5013    return new ODBCResultSet(0,imp);
5014 }
5015 
5016 //___________________________________________________________________
5017 TSQLResultSet* ODBCDatabaseMetaData::GetCrossReference(
5018                                    const TString& primaryCatalog,
5019                                    const TString& primarySchema,
5020                                    const TString& primaryTable,
5021                                    const TString& foreignCatalog,
5022                                    const TString& foreignSchema,
5023                                    const TString& foreignTable )
5024 {
5025    // Gets a description of the foreign key columns in the foreign 
5026    // key table that reference the primary key columns of the primary 
5027    // key table (describe how one table imports another's key.) 
5028    // This should normally return a single foreign key/primary key 
5029    // pair (most tables only import a foreign key from a table once.) 
5030    // They are ordered by FKTABLE_CAT, FKTABLE_SCHEM, FKTABLE_NAME, 
5031    // and KEY_SEQ. 
5032    //
5033    // Each foreign key column description has the following columns: 
5034    //
5035    //      1.PKTABLE_CAT string => primary key table catalog (may be null)
5036    // 
5037    //      2.PKTABLE_SCHEM string => primary key table schema (may be null)
5038    // 
5039    //      3.PKTABLE_NAME string => primary key table name 
5040    //
5041    //      4.PKCOLUMN_NAME string => primary key column name 
5042    //
5043    //      5.FKTABLE_CAT string =>  foreign key table catalog (may be null) 
5044    //                                being exported (may be null) 
5045    //
5046    //      6.FKTABLE_SCHEM string =>  foreign key table schema (may be null) 
5047    //                                 being exported (may be null) 
5048    //
5049    //      7.FKTABLE_NAME string =>  foreign key table name being exported 
5050    //
5051    //      8.FKCOLUMN_NAME string =>   foreign key column name 
5052    //                                  being exported 
5053    //
5054    //      9.KEY_SEQ short => sequence number within foreign key 
5055    //
5056    //      10.UPDATE_RULE short => What happens to foreign key when 
5057    //                            primary is updated: 
5058    //
5059    //          kImportedNoAction - do not allow update of primary key 
5060    //                               if it has been imported 
5061    //          kImportedKeyCascade - change imported key to agree 
5062    //                               with primary key update 
5063    //          kImportedKeySetNull - change imported key to NULL 
5064    //                               if its primary key has been updated 
5065    //          kImportedKeySetDefault - change imported key to 
5066    //                               default values if its primary key 
5067    //                               has been  updated 
5068    //          kImportedKeyRestrict - same as kImportedKeyNoAction 
5069    //
5070    //      11.DELETE_RULE short => What happens to the foreign key 
5071    //                               when primary is deleted
5072    // 
5073    //          kImportedKeyNoAction - do not allow delete of primary 
5074    //                               key if it has been imported 
5075    //          kImportedKeyCascade - delete rows that import 
5076    //                               a deleted  key 
5077    //          kImportedKeySetNull - change imported key to NULL if 
5078    //                               its primary key has been deleted 
5079    //          kImportedKeyRestrict - same as kImportedKeyNoAction 
5080    //          kImportedKeySetDefault - change imported key to 
5081    //                                  default if its primary key has 
5082    //                                  been deleted 
5083    //
5084    //     12.FK_NAME string => foreign key name (may be null) 
5085    //
5086    //     13.PK_NAME string => primary key name (may be null) 
5087    //
5088    //     14.DEFERRABILITY short => can the evaluation of foreign 
5089    //                               key constraints be deferred until
5090    //                               commit
5091    //
5092    //          kImportedKeyInitiallyDeferred - see SQL92 for definition 
5093    //          kImportedKeyInitiallyImmediate - see SQL92 for definition 
5094    //          kImportedKeyNotDeferrable - see SQL92 for definition 
5095    //
5096    //   Parameters:
5097    //         primaryCatalog -   a catalog name; 
5098    //                            "" - retrieves those without a catalog; 
5099    //         primarySchema - a schema name; 
5100    //                            "" - retrieves those  without a schema
5101    //         primaryTable - the table name that exports the key
5102    //         foreignCatalog - a catalog name; 
5103    //                            ""    - retrieves those without a catalog; 
5104    //         foreignSchema - a schema name; 
5105    //                            ""    - retrieves those without a schema
5106    //         foreignTable - the table name that imports the key
5107    //
5108    //   Returns:
5109    //         TSQLResultSet - each row is a foreign key column 
5110    //                         description
5111    //   Throws:
5112    //         TSQLException - if a database access error occurs
5113    //   See Also: 
5114    //         GetImportedKeys( const TString&,
5115    //                          const TString&,
5116    //                          const TString& )
5117 
5118    TSQLResultSet* rs = 0;
5119    
5120    if(!fImp) { Destroyed();   return rs; } 
5121    odbc::DatabaseMetaData* md = (odbc::DatabaseMetaData*)fImp;
5122    ClearWarnings();
5123 
5124    odbc::ResultSet* imp = 0;
5125 
5126    try { 
5127       imp = md->getCrossReference(
5128                         ODBCXX_STRING_C(primaryCatalog.Data()),
5129                         ODBCXX_STRING_C(primarySchema.Data()),
5130                         ODBCXX_STRING_C(primaryTable.Data()),
5131                         ODBCXX_STRING_C(foreignCatalog.Data()),
5132                         ODBCXX_STRING_C(foreignSchema.Data()),
5133                         ODBCXX_STRING_C(foreignTable.Data()) ); 
5134    } catch(odbc::SQLException& e) {
5135       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
5136                                 ODBCXX_STRING_CSTR(e.getSQLState()),
5137                                 e.getErrorCode()) );
5138       if(imp) delete imp;
5139       return 0;
5140    }   
5141    return new ODBCResultSet(0,imp);
5142 }
5143 
5144 //___________________________________________________________________
5145 TSQLResultSet* ODBCDatabaseMetaData::GetTypeInfo()
5146 {
5147    // Gets a description of all the standard SQL types supported 
5148    // by this database. They are ordered by DATA_TYPE and then by 
5149    // how closely the data type maps to the corresponding SQL type. 
5150    //
5151    //   Each type description has the following columns: 
5152    //
5153    //      1.TYPE_NAME string => Type name 
5154    //
5155    //      2.DATA_TYPE short => SQL data type from TSQLTypes 
5156    //
5157    //      3.PRECISION int => maximum precision 
5158    //
5159    //      4.LITERAL_PREFIX string => prefix used to quote a 
5160    //                                  literal  (may be null) 
5161    //
5162    //      5.LITERAL_SUFFIX string => suffix used to quote a 
5163    //                                  literal (may be null) 
5164    //
5165    //      6.CREATE_PARAMS string => parameters used in creating 
5166    //                                  the type (may be null) 
5167    //
5168    //      7.NULLABLE short => can you use NULL for this type?
5169    //
5170    //               kTypeNoNulls - does not allow NULL values 
5171    //               kTypeNullable - allows NULL values 
5172    //               kTypeNullableUnknown - nullability unknown 
5173    //
5174    //      8.CASE_SENSITIVE boolean=> is it case sensitive? 
5175    //
5176    //      9.SEARCHABLE short => can you use "WHERE" based on 
5177    //                            this type:
5178    // 
5179    //             kTypePredNone - No support 
5180    //             kTypePredChar - Only supported with WHERE .. LIKE 
5181    //             kTypePredBasic - Supported except for WHERE .. LIKE 
5182    //             kTypeSearchable - Supported for all WHERE .. 
5183    //
5184    //     10.UNSIGNED_ATTRIBUTE => is it unsigned? 
5185    //
5186    //     11.FIXED_PREC_SCALE => can it be a money value? 
5187    //
5188    //     12.AUTO_INCREMENT =>   can it be used for an auto-increment 
5189    //                            value? 
5190    //
5191    //     13.LOCAL_TYPE_NAME string => localized version of type 
5192    //                                  name (may be null)
5193    // 
5194    //     14.MINIMUM_SCALE short => minimum scale supported 
5195    //
5196    //     15.MAXIMUM_SCALE short => maximum scale supported 
5197    //
5198    //     16.SQL_DATA_TYPE int => unused 
5199    //
5200    //     17.SQL_DATETIME_SUB int => unused 
5201    //
5202    //     18.NUM_PREC_RADIX int => usually 2 or 10 
5203    //
5204    //   Returns:
5205    //         TSQLResultSet - each row is a SQL type description
5206    //   Throws:
5207    //         TSQLException - if a database access error occurs
5208 
5209    TSQLResultSet* rs = 0;   
5210    
5211    if(!fImp) { Destroyed();   return rs; } 
5212    odbc::DatabaseMetaData* md = (odbc::DatabaseMetaData*)fImp;
5213    ClearWarnings();
5214 
5215    odbc::ResultSet* imp = 0;
5216 
5217    try { 
5218       imp = md->getTypeInfo();
5219    } catch(odbc::SQLException& e) {
5220       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
5221                                 ODBCXX_STRING_CSTR(e.getSQLState()),
5222                                 e.getErrorCode()) );   
5223       if(imp) delete imp;
5224       return 0;
5225    }   
5226    return new ODBCResultSet(0,imp);
5227 }
5228 
5229 //___________________________________________________________________
5230 TSQLResultSet* ODBCDatabaseMetaData::GetIndexInfo(
5231                                              const TString& catalog,
5232                                              const TString& schema,
5233                                              const TString& table,
5234                                              Bool_t  unique,
5235                                              Bool_t approximate )
5236 {
5237    // Gets a description of a table's indices and statistics. 
5238    // They are ordered by NON_UNIQUE, TYPE, INDEX_NAME, 
5239    // and ORDINAL_POSITION. 
5240    //
5241    //   Each index column description has the following columns: 
5242    //
5243    //      1.TABLE_CAT string => table catalog (may be null) 
5244    //
5245    //      2.TABLE_SCHEM string => table schema (may be null) 
5246    //
5247    //      3.TABLE_NAME string => table name 
5248    //
5249    //      4.NON_UNIQUE => Can index values be non-unique? 
5250    //                   kFALSE when TYPE is kTableIndexStatistic 
5251    //
5252    //      5.INDEX_QUALIFIER string => index catalog (may be null); 
5253    //                   null when TYPE is kTableIndexStatistic 
5254    //
5255    //      6.INDEX_NAME string => index name;  null when TYPE 
5256    //                             is kTableIndexStatistic 
5257    //
5258    //      7.TYPE short => index type: 
5259    //
5260    //          kTableIndexStatistic - this identifies table 
5261    //                                  statistics that are returned
5262    //                                  in conjuction with a table's 
5263    //                                  index descriptions 
5264    //
5265    //          kTableIndexClustered  - this is a clustered index  
5266    //          kTableIndexHashed -  this is a hashed index  
5267    //          kTableIndexOther -  this is some other style of index 
5268    //
5269    //      8.ORDINAL_POSITION short => column sequence number within 
5270    //                                  index; zero when TYPE is 
5271    //                                  kTableIndexStatistic 
5272    //
5273    //      9.COLUMN_NAME string => column name; null when TYPE is 
5274    //                                  kTableIndexStatistic
5275    // 
5276    //     10.ASC_OR_DESC string => column sort sequence,
5277    // 
5278    //                         "A" => ascending, 
5279    //                         "D" => descending, may be null if 
5280    //                                sort sequence is not supported; 
5281    //                         null => when TYPE is kTableIndexStatistic
5282    // 
5283    //     11.CARDINALITY int => When TYPE is kTableIndexStatistic, 
5284    //                         then this is the number of rows in 
5285    //                         the table;  otherwise, it is the number 
5286    //                         of unique values in the index.
5287    // 
5288    //     12.PAGES int => When TYPE is kTableIndexStatisic then 
5289    //                      this is the number of pages used for 
5290    //                      the table,  otherwise it is the number 
5291    //                      of pages used for the  current index.
5292    // 
5293    //     13.FILTER_CONDITION string => Filter condition, if any
5294    //                                  (may be null) 
5295    //
5296    //   Parameters:
5297    //         catalog -    a catalog name; 
5298    //                         ""    -  retrieves those without  a catalog; 
5299    //          schema -    a schema name;  
5300    //                         ""    -  retrieves those without a schema 
5301    //          table -     a table  name 
5302    //          unique -    when kTRUE, return only indices for unique 
5303    //                      values; when kFALSE, return indices 
5304    //                      regardless  of whether unique or not 
5305    //          approximate -  when kTRUE,  result is allowed to reflect 
5306    //                         approximate or out of  data values; 
5307    //                         when kFALSE, results are requested to  
5308    //                         be accurate
5309    //
5310    //   Returns:
5311    //         TSQLResultSet - each row is an index column description
5312    //   Throws:
5313    //         TSQLException - if a database access error occurs
5314 
5315    TSQLResultSet* rs = 0;
5316    
5317    if(!fImp) { Destroyed();   return rs; } 
5318    odbc::DatabaseMetaData* md = (odbc::DatabaseMetaData*)fImp;
5319    ClearWarnings();
5320 
5321    odbc::ResultSet* imp = 0;
5322 
5323    try { 
5324       imp = md->getIndexInfo( ODBCXX_STRING_C(catalog.Data()),
5325                               ODBCXX_STRING_C(schema.Data()),
5326                               ODBCXX_STRING_C(table.Data()),
5327                               unique, approximate );  
5328    } catch(odbc::SQLException& e) {
5329       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
5330                                 ODBCXX_STRING_CSTR(e.getSQLState()),
5331                                 e.getErrorCode()) );
5332       if(imp) delete imp;
5333       return 0;
5334    
5335    }  
5336    return new ODBCResultSet(0,imp);
5337 }
5338 
5339 //___________________________________________________________________
5340 Bool_t ODBCDatabaseMetaData::SupportsResultSetType( Int_t type )
5341 {
5342    // Does the database support the given result set type?
5343    //
5344    //   Parameters:
5345    //         type - defined in TSQLResultSet::kTYPE_XXX
5346    //
5347    //   Returns:
5348    //         kTRUE if so; kFALSE otherwise
5349    //   Throws:
5350    //         TSQLException - if a database access error occurs
5351    //   See Also: 
5352    //         TSQLResultSet
5353 
5354    Bool_t return_value = kFALSE;   
5355    
5356    if(!fImp) { Destroyed();   return return_value; } 
5357    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
5358       
5359    try {      
5360       return_value = imp->supportsResultSetType(type);
5361 
5362    } catch(odbc::SQLException& e) {
5363       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
5364                                 ODBCXX_STRING_CSTR(e.getSQLState()),
5365                                 e.getErrorCode()) );
5366       return kFALSE;
5367    }   
5368    return return_value;
5369 }
5370 
5371 //___________________________________________________________________
5372 Bool_t ODBCDatabaseMetaData::SupportsResultSetConcurrency( Int_t type,
5373                                                    Int_t concurrency )
5374 {
5375    // Does the database support the concurrency type in combination 
5376    // with the given result set type?
5377    //
5378    //   Parameters:
5379    //         type - defined in TSQLResultSet
5380    //         concurrency - type defined in TSQLResultSet
5381    //
5382    //   Returns:
5383    //         kTRUE if so; kFALSE otherwise
5384    //   Throws:
5385    //         TSQLException - if a database access error occurs
5386    //   See Also: 
5387    //         TSQLConnection TSQLResultSet
5388 
5389    Bool_t return_value = kFALSE;
5390 
5391    if(!fImp) { Destroyed();   return return_value; } 
5392    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
5393    
5394    try {      
5395       return_value = imp->supportsResultSetConcurrency( type,
5396                                                         concurrency);
5397    
5398    } catch(odbc::SQLException& e) {
5399       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
5400                                 ODBCXX_STRING_CSTR(e.getSQLState()),
5401                                 e.getErrorCode()) );
5402       return kFALSE;
5403    }   
5404    return return_value;
5405 }
5406 
5407 //___________________________________________________________________
5408 Bool_t ODBCDatabaseMetaData::OwnUpdatesAreVisible( Int_t type )
5409 {
5410    // Indicates whether a result set's own updates are visible.
5411    //
5412    //   Parameters:
5413    //         resultset type, i.e. TSQLResultSet::kTYPE_XXX
5414    //
5415    //   Returns:
5416    //         kTRUE if updates are visible for the result set type; 
5417    //         kFALSE otherwise
5418    //   Throws:
5419    //         TSQLException - if a database access error occurs
5420    //
5421    //    see also TSQLResultSet
5422    
5423    Bool_t return_value = kFALSE;   
5424 
5425    if(!fImp) { Destroyed();   return return_value; } 
5426    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
5427       
5428    try {
5429       return_value = imp->ownUpdatesAreVisible(type);
5430 
5431    } catch(odbc::SQLException& e) {
5432       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
5433                                 ODBCXX_STRING_CSTR(e.getSQLState()),
5434                                 e.getErrorCode()) );
5435       return kFALSE;
5436    }   
5437    return return_value;
5438 }
5439 
5440 //___________________________________________________________________
5441 Bool_t ODBCDatabaseMetaData::OwnDeletesAreVisible( Int_t type )
5442 {
5443    // Indicates whether a result set's own deletes are visible.
5444    //
5445    //   Parameters:
5446    //         resultset type, i.e. TSQLResultSet::kTYPE_XXX
5447    //
5448    //    Returns:
5449    //         kTRUE if deletes are visible for the result set type; 
5450    //         kFALSE otherwise
5451    //   Throws:
5452    //         TSQLException - if a database access error occurs
5453    //
5454    //    see also TSQLResultSet
5455 
5456    Bool_t return_value = kFALSE;
5457    
5458    if(!fImp) { Destroyed();   return return_value; } 
5459    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
5460    
5461    try {      
5462       return_value = imp->ownDeletesAreVisible(type);
5463 
5464    } catch(odbc::SQLException& e) {
5465       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
5466                                 ODBCXX_STRING_CSTR(e.getSQLState()),
5467                                 e.getErrorCode()) );
5468       return kFALSE;
5469    }   
5470    return return_value;
5471 }
5472 
5473 //___________________________________________________________________
5474 Bool_t ODBCDatabaseMetaData::OwnInsertsAreVisible( Int_t type )
5475 {
5476    // Indicates whether a result set's own inserts are visible.
5477    //
5478    //   Parameters:
5479    //         resultset type, i.e. TSQLResultSet::kTYPE_XXX
5480    //
5481    //   Returns:
5482    //         kTRUE if inserts are visible for the result set type; 
5483    //         kFALSE otherwise
5484    //   Throws:
5485    //         TSQLException - if a database access error occurs
5486    //
5487    //    see also TSQLResultSet
5488 
5489    Bool_t return_value = kFALSE;
5490    
5491    if(!fImp) { Destroyed();   return return_value; } 
5492    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
5493     
5494    try {      
5495       return_value = imp->ownInsertsAreVisible(type);
5496 
5497    } catch(odbc::SQLException& e) {
5498       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
5499                                 ODBCXX_STRING_CSTR(e.getSQLState()),
5500                                 e.getErrorCode()) );
5501       return kFALSE;
5502    }   
5503    return return_value;
5504 }
5505 
5506 //___________________________________________________________________
5507 Bool_t ODBCDatabaseMetaData::OthersUpdatesAreVisible( Int_t type )
5508 {
5509    // Indicates whether updates made by others are visible.
5510    //
5511    //   Parameters:
5512    //         resultset type, i.e. TSQLResultSet::kTYPE_XXX. 
5513    //
5514    //   Returns:
5515    //         kTRUE if updates made by others are visible for 
5516    //         the result set type; kFALSE otherwise
5517    //   Throws:
5518    //         TSQLException - if a database access error occurs
5519 
5520    Bool_t return_value = kFALSE;   
5521    
5522    if(!fImp) { Destroyed();   return return_value; } 
5523    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
5524       
5525    try {      
5526       return_value = imp->othersUpdatesAreVisible(type);
5527 
5528    } catch(odbc::SQLException& e) {
5529       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
5530                                 ODBCXX_STRING_CSTR(e.getSQLState()),
5531                                 e.getErrorCode()) );
5532       return kFALSE;
5533    }   
5534    return return_value;
5535 }
5536 
5537 //___________________________________________________________________
5538 Bool_t ODBCDatabaseMetaData::OthersDeletesAreVisible( Int_t type )
5539 {
5540    // Indicates whether deletes made by others are visible.
5541    //
5542    //   Parameters:
5543    //         resultset type, i.e. TSQLResultSet::kTYPE_XXX
5544    //
5545    //   Returns:
5546    //         kTRUE if deletes made by others are visible for the 
5547    //         result set type; kFALSE otherwise
5548    //   Throws:
5549    //         TSQLException - if a database access error occurs
5550 
5551    Bool_t return_value = kFALSE;   
5552    
5553    if(!fImp) { Destroyed();   return return_value; } 
5554    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
5555       
5556    try {      
5557       return_value = imp->othersDeletesAreVisible(type); 
5558 
5559    } catch(odbc::SQLException& e) {
5560       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
5561                                 ODBCXX_STRING_CSTR(e.getSQLState()),
5562                                 e.getErrorCode()) );
5563       return kFALSE;
5564    }   
5565    return return_value;
5566 }
5567 
5568 //___________________________________________________________________
5569 Bool_t ODBCDatabaseMetaData::OthersInsertsAreVisible( Int_t type )
5570 {
5571    // Indicates whether inserts made by others are visible.
5572    //
5573    //   Parameters:
5574    //         resultset type, i.e. TSQLResultSet::kTYPE_XXX
5575    //
5576    //   Returns:
5577    //         kTRUE if updates are visible for the result set type
5578    //   Throws:
5579    //         TSQLException - if a database access error occurs
5580 
5581    Bool_t return_value = kFALSE;   
5582    
5583    if(!fImp) { Destroyed();   return return_value; } 
5584    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
5585       
5586    try {      
5587       return_value = imp->othersInsertsAreVisible(type);
5588 
5589    } catch(odbc::SQLException& e) {
5590       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
5591                                 ODBCXX_STRING_CSTR(e.getSQLState()),
5592                                 e.getErrorCode()) );
5593       return kFALSE;
5594    }   
5595    return return_value;
5596 }
5597 
5598 //___________________________________________________________________
5599 Bool_t ODBCDatabaseMetaData::UpdatesAreDetected( Int_t type )
5600 {
5601    // Indicates whether or not a visible row update  can be detected 
5602    // by calling the method TSQLResultSet::RowUpdated().
5603    //
5604    //   Parameters:
5605    //         resultset type, i.e. TSQLResultSet::kTYPE_XXX
5606    //
5607    //   Returns:
5608    //         kTRUE if changes are detected by the result set type; 
5609    //          kFALSE otherwise
5610    //   Throws:
5611    //         TSQLException - if a database access error occurs
5612 
5613    Bool_t return_value = kFALSE;   
5614    
5615    if(!fImp) { Destroyed();   return return_value; } 
5616    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
5617       
5618    try {      
5619       return_value = imp->updatesAreDetected(type);
5620 
5621    } catch(odbc::SQLException& e) {
5622       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
5623                                 ODBCXX_STRING_CSTR(e.getSQLState()),
5624                                 e.getErrorCode()) );
5625       return kFALSE;
5626    }   
5627    return return_value;
5628 }
5629 
5630 //___________________________________________________________________
5631 Bool_t ODBCDatabaseMetaData::DeletesAreDetected( Int_t type )
5632 {
5633    // Indicates whether or not a visible row delete 
5634    // can be detected by calling TSQLResultSet::RowDeleted(). 
5635    // If DeletesAreDetected() returns kFALSE, then deleted rows are
5636    // removed from the result set.
5637    //
5638    //   Parameters:
5639    //         resultset type, i.e. TSQLResultSet::kTYPE_XXX
5640    //
5641    //   Returns:
5642    //         kTRUE if changes are detected by the resultset type
5643    //   Throws:
5644    //         TSQLException - if a database access error occurs
5645 
5646    Bool_t return_value = kFALSE;   
5647    
5648    if(!fImp) { Destroyed();   return return_value; } 
5649    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
5650       
5651    try {
5652       return_value = imp->deletesAreDetected(type);
5653 
5654    } catch(odbc::SQLException& e) {
5655       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
5656                                 ODBCXX_STRING_CSTR(e.getSQLState()),
5657                                 e.getErrorCode()) );
5658       return kFALSE;
5659    }
5660    return return_value;
5661 }
5662 
5663 //___________________________________________________________________
5664 Bool_t ODBCDatabaseMetaData::InsertsAreDetected( Int_t type )
5665 {
5666    // Indicates whether or not a visible row insert 
5667    // can be detected by calling TSQLResultSet::RowInserted().
5668    //
5669    //   Parameters:
5670    //         resultset type, i.e. TSQLResultSet::kTYPE_XXX
5671    //
5672    //   Returns:
5673    //         kTRUE if changes are detected by the resultset type
5674    //   Throws:
5675    //         TSQLException - if a database access error occurs
5676 
5677    Bool_t return_value = kFALSE;   
5678    
5679    if(!fImp) { Destroyed();   return return_value; } 
5680    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
5681       
5682    try {      
5683       return_value = imp->insertsAreDetected(type);
5684 
5685    } catch(odbc::SQLException& e) {
5686       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
5687                                 ODBCXX_STRING_CSTR(e.getSQLState()),
5688                                 e.getErrorCode()) );
5689       return kFALSE;
5690    }   
5691    return return_value;
5692 }
5693 
5694 //___________________________________________________________________
5695 Bool_t ODBCDatabaseMetaData::SupportsBatchUpdates()
5696 {
5697    // Indicates whether the driver supports batch updates.
5698    //
5699    //   Returns:
5700    //         kTRUE if the driver supports batch updates; 
5701    //         kFALSE otherwise
5702 
5703    Bool_t return_value = kFALSE;
5704    
5705    if(!fImp) { Destroyed();   return return_value; } 
5706    odbc::DatabaseMetaData* imp = (odbc::DatabaseMetaData*)fImp;
5707       
5708    try { 
5709       return_value = imp->supportsBatchUpdates(); //
5710 
5711    } catch(odbc::SQLException& e) {
5712       Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
5713                                 ODBCXX_STRING_CSTR(e.getSQLState()),
5714                                 e.getErrorCode()) );
5715       return kFALSE;
5716    }   
5717    return return_value;
5718 }