Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ODBCDatabaseMetaData.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ODBCDatabaseMetaData.cxx
1 // $Id: ODBCDatabaseMetaData.cxx,v 1.1.1.1 2004/02/18 20:58:02 dave Exp $
2 //*-- Author : Valeriy Onuchin 14/02/2000
3 //
4 
5 /**************************************************************************
6 
7  ROOT wrappers of libodbc++ library
8 
9  Copyright (C) 1999-2000 Manush Dodunekov <manush@stendahls.net>
10 
11  This library is free software; you can redistribute it and/or
12  modify it under the terms of the GNU Library General Public
13  License as published by the Free Software Foundation; either
14  version 2 of the License, or (at your option) any later version.
15 
16  This library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  Library General Public License for more details.
20 
21  You should have received a copy of the GNU Library General Public License
22  along with this library; see the file COPYING. If not, write to
23  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24  Boston, MA 02111-1307, USA.
25 
26 **************************************************************************/
27 
29 //
30 // Comprehensive information about the database as a whole.
31 //
32 // Many of the methods here return lists of information in the form
33 // of TSQLResultSet objects. You can use the normal TSQLResultSet
34 // methods such as TSQLResultSet::GetString() and
35 // TSQLResultSet::GetInt() to retrieve the data from
36 // these TSQLResultSet s. If a given form of metadata is not available,
37 // these methods should throw an TSQLException.
38 //
39 // Some of these methods take arguments that are string patterns.
40 // These arguments all have names such as fooPattern. Within a
41 // pattern string, "%" means match any substring of 0 or more
42 // characters, and "_" means match any one character. Only metadata
43 // entries matching the search pattern are returned. If a search
44 // pattern argument is set to a null ref, that argument's criteria
45 // will be dropped from the search.
46 //
47 //
49 //
50 // Constants:
51 //
52 //___________________________________________________________________
53 // kProcedureResultUnknown
54 //
55 // A possible value for column PROCEDURE_TYPE in the
56 // TSQLResultSet object returned by the method GetProcedures().
57 //
58 // Indicates that it is not known whether the procedure
59 // returns a result.
60 //
61 //___________________________________________________________________
62 // kProcedureNoResult
63 //
64 // A possible value for column PROCEDURE_TYPE in the
65 // TSQLResultSet object returned by the method GetProcedures().
66 //
67 // Indicates that the procedure does not return a result.
68 //
69 //___________________________________________________________________
70 // kProcedureReturnsResult
71 //
72 // A possible value for column PROCEDURE_TYPE in the
73 // TSQLResultSet object returned by the method GetProcedures().
74 //
75 // Indicates that the procedure returns a result.
76 //
77 //___________________________________________________________________
78 // kProcedureColumnUnknown
79 //
80 // Indicates that type of the column is unknown. A possible value
81 // for the column COLUMN_TYPE in the TSQLResultSet returned by
82 // the method GetProcedureColumns().
83 //
84 //___________________________________________________________________
85 // kProcedureColumnIn
86 //
87 // Indicates that the column stores IN parameters. A possible
88 // value for the column COLUMN_TYPE in the TSLQResultSet returned
89 // by the method GetProcedureColumns().
90 //
91 //___________________________________________________________________
92 // kProcedureColumnInOut
93 //
94 // Indicates that the column stores INOUT parameters. A possible
95 // value for the column COLUMN_TYPE in the TSQLResultSet returned
96 // by the method GetProcedureColumns().
97 //
98 //___________________________________________________________________
99 // kProcedureColumnOut
100 //
101 // Indicates that the column stores OUT parameters. A possible
102 // value for the column kCOLUMN_TYPE in the TSQLResultSet
103 // returned by the method GetProcedureColumns().
104 //
105 //___________________________________________________________________
106 // kProcedureColumnReturn
107 //
108 // Indicates that the column stores return values. A possible
109 // value for the column COLUMN_TYPE in the TSQLResultSet returned
110 // by the method GetProcedureColumns().
111 //
112 //___________________________________________________________________
113 // kProcedureColumnResult
114 //
115 // Indicates that the column stores results. A possible value
116 // for the column kCOLUMN_TYPE in the TSQLResultSet returned
117 // by the method GetProcedureColumns().
118 //
119 //___________________________________________________________________
120 // kProcedureNoNulls
121 //
122 // Indicates that NULL values are not allowed. A possible value
123 // for the column NULLABLE in the TSQLResultSet returned by the
124 // method GetProcedureColumns().
125 //
126 //___________________________________________________________________
127 // kProcedureNullable
128 //
129 // Indicates that NULL values are allowed. A possible value for
130 // the column NULLABLE in the TSQLResultSet returned by
131 // the method GetProcedureColumns().
132 //
133 //___________________________________________________________________
134 // kProcedureNullableUnknown
135 //
136 // Indicates that whether NULL values are allowed is unknown.
137 // A possible value for the column NULLABLE in the TSQLResultSet
138 // returned by the method GetProcedureColumns().
139 //
140 //___________________________________________________________________
141 // kColumnNoNulls
142 //
143 // Indicates that the column might not allow NULL values.
144 // A possible value for the column NULLABLE in the TSQLResultSet
145 // returned by the method GetColumns().
146 //
147 //___________________________________________________________________
148 // kColumnNullable
149 //
150 // Indicates that the column definitely allows NULL values.
151 // A possible value for the column NULLABLE in the TSQLResultSet
152 // returned by the method GetColumns().
153 //
154 //___________________________________________________________________
155 // kColumnNullableUnknown
156 //
157 // Indicates that the nullability of columns is unknown.
158 // A possible value for the column NULLABLE in the TSQLResultSet
159 // returned by the method GetColumns().
160 //
161 //___________________________________________________________________
162 // kBestRowTemporary
163 //
164 // Indicates that the scope of the best row identifier is very
165 // temporary, lasting only while the row is being used.
166 // A possible value for the column SCOPE in the TSQLResultSet
167 // object returned by the method GetBestRowIdentifier().
168 //
169 //___________________________________________________________________
170 // kBestRowTransaction
171 //
172 // Indicates that the scope of the best row identifier is the
173 // remainder of the current transaction. A possible value for
174 // the column SCOPE in the TSQLResultSet object returned by
175 // the method GetBestRowIdentifier().
176 //
177 //___________________________________________________________________
178 // kBestRowSession
179 //
180 // Indicates that the scope of the best row identifier is the
181 // remainder of the current session. A possible value for the
182 // column SCOPE in the TSQLResultSet object returned by
183 // the method GetBestRowIdentifier().
184 //
185 //___________________________________________________________________
186 // kBestRowUnknown
187 //
188 // Indicates that the best row identifier may or may not be
189 // a pseudo column. A possible value for the column
190 // PSEUDO_COLUMN in the TSQLResultSet object returned by
191 // the method GetBestRowIdentifier().
192 //
193 //___________________________________________________________________
194 // kBestRowNotPseudo
195 //
196 // Indicates that the best row identifier is NOT a pseudo
197 // column. A possible value for the column PSEUDO_COLUMN in
198 // the TSQLResultSet object returned by the method
199 // GetBestRowIdentifier().
200 //
201 //___________________________________________________________________
202 // kBestRowPseudo
203 //
204 // Indicates that the best row identifier is a pseudo column.
205 // A possible value for the column PSEUDO_COLUMN in the
206 // TSQLResultSet object returned by the method
207 // GetBestRowIdentifier().
208 //
209 //___________________________________________________________________
210 // kVersionColumnUnknown
211 //
212 // Indicates that this version column may or may not be a pseudo
213 // column. A possible value for the column PSEUDO_COLUMN in
214 // the TSQLResultSet object returned by the method
215 // GetVersionColumns().
216 //
217 //___________________________________________________________________
218 // kVersionColumnNotPseudo
219 //
220 // Indicates that this version column is NOT a pseudo column.
221 // A possible value for the column PSEUDO_COLUMN in the
222 // TSQLResultSet object returned by the method GetVersionColumns().
223 //
224 //___________________________________________________________________
225 // kVersionColumnPseudo
226 //
227 // Indicates that this version column is a pseudo column.
228 // A possible value for the column PSEUDO_COLUMN in the
229 // TSQLResultSet object returned by the method GetVersionColumns().
230 //
231 //___________________________________________________________________
232 // kImportedKeyCascade
233 //
234 // A possible value for the columns UPDATE_RULE and
235 // DELETE_RULE in the TSQLResultSet objects returned by the
236 // methods GetImportedKeys(), GetExportedKeys(),
237 // and GetCrossReference().
238 //
239 // For the column UPDATE_RULE, it indicates that when the
240 // primary key is updated, the foreign key (imported key)
241 // is changed to agree with it.
242 //
243 // For the column DELETE_RULE, it indicates that when the
244 // primary key is deleted, rows that imported that key
245 // are deleted.
246 //
247 //___________________________________________________________________
248 // kImportedKeyRestrict
249 //
250 // A possible value for the columns UPDATE_RULE and DELETE_RULE
251 // in the TSQLResultSet objects returned by the methods
252 // GetImportedKeys(), GetExportedKeys(), and GetCrossReference().
253 //
254 // For the column UPDATE_RULE, it indicates that a primary
255 // key may not be updated if it has been imported by another
256 // table as a foreign key.
257 //
258 // For the column DELETE_RULE, it indicates that a primary
259 // key may not be deleted if it has been imported by another
260 // table as a foreign key.
261 //
262 //___________________________________________________________________
263 // kImportedKeySetNull
264 //
265 // A possible value for the columns UPDATE_RULE and DELETE_RULE
266 // in the TSQLResultSet objects returned by the methods
267 // GetImportedKeys(), GetExportedKeys(), and GetCrossReference().
268 //
269 // For the columns UPDATE_RULE and DELETE_RULE, it indicates
270 // that when the primary key is updated or deleted, the
271 // foreign key (imported key) is changed to NULL.
272 //
273 //___________________________________________________________________
274 // kImportedKeyNoAction
275 //
276 // A possible value for the columns UPDATE_RULE and DELETE_RULE
277 // in the TSQLResultSet objects returned by the methods
278 // GetImportedKeys(), GetExportedKeys(), and GetCrossReference().
279 //
280 // For the columns UPDATE_RULE and DELETE_RULE, it indicates
281 // that if the primary key has been imported, it cannot be
282 // updated or deleted.
283 //
284 //___________________________________________________________________
285 // kImportedKeySetDefault
286 //
287 // A possible value for the columns UPDATE_RULE and DELETE_RULE
288 // in the TSQLResultSet objects returned by the methods
289 // GetImportedKeys(), GetExportedKeys(), and GetCrossReference().
290 //
291 // For the columns UPDATE_RULE and DELETE_RULE, it indicates
292 // that if the primary key is updated or deleted,
293 // the foreign key (imported key) is set to the default value.
294 //
295 //___________________________________________________________________
296 // kImportedKeyInitiallyDeferred
297 //
298 // A possible value for the column DEFERRABILITY in
299 // the TSQLResultSet objects returned by the methods
300 // GetImportedKeys(), GetExportedKeys(), and GetCrossReference().
301 //
302 // Indicates deferrability. See SQL-92 for a definition.
303 //
304 //___________________________________________________________________
305 // kImportedKeyInitiallyImmediate
306 //
307 // A possible value for the column DEFERRABILITY in
308 // the TSQLResultSet objects returned by the methods
309 // GetImportedKeys(), GetExportedKeys(), and GetCrossReference().
310 //
311 // Indicates deferrability. See SQL-92 for a definition.
312 //
313 //___________________________________________________________________
314 // kImportedKeyNotDeferrable
315 //
316 // A possible value for the column DEFERRABILITY in
317 // the TSQLResultSet objects returned by the methods
318 // GetImportedKeys(), GetExportedKeys(), and GetCrossReference().
319 //
320 // Indicates deferrability. See SQL-92 for a definition.
321 //
322 //___________________________________________________________________
323 // kTypeNoNulls
324 //
325 // A possible value for column NULLABLE in the TSQLResultSet
326 // object returned by the method GetTypeInfo().
327 //
328 // Indicates that a NULL value is NOT allowed for
329 // this data type.
330 //
331 //___________________________________________________________________
332 // kTypeNullable
333 //
334 // A possible value for column NULLABLE in the TSQLResultSet
335 // object returned by the method GetTypeInfo().
336 //
337 // Indicates that a NULL value is allowed for this data type.
338 //
339 //___________________________________________________________________
340 // kTypeNullableUnknown
341 //
342 // A possible value for column NULLABLE in the TSQLResultSet
343 // object returned by the method GetTypeInfo().
344 //
345 // Indicates that it is not known whether a NULL value
346 // is allowed for this data type.
347 //
348 //___________________________________________________________________
349 // kTypePredNone
350 //
351 // A possible value for column SEARCHABLE in the TSQLResultSet
352 // object returned by the method GetTypeInfo().
353 //
354 // Indicates that WHERE search clauses are not supported
355 // for this type.
356 //
357 //___________________________________________________________________
358 // kTypePredChar
359 //
360 // A possible value for column SEARCHABLE in the TSQLResultSet
361 // object returned by the method GetTypeInfo().
362 //
363 // Indicates that the only WHERE search clause that can be
364 // based on this type is WHERE . . .LIKE.
365 //
366 //___________________________________________________________________
367 // kTypePredBasic
368 //
369 // A possible value for column SEARCHABLE in the TSQLResultSet
370 // object returned by the method GetTypeInfo().
371 //
372 // Indicates that one can base all WHERE search clauses
373 // except WHERE . . .LIKE on this data type.
374 //
375 //___________________________________________________________________
376 // kTypeSearchable
377 //
378 // A possible value for column SEARCHABLE in the TSQLResultSet
379 // object returned by the method GetTypeInfo().
380 //
381 // Indicates that all WHERE search clauses can be based
382 // on this type.
383 //
384 //___________________________________________________________________
385 // kTableIndexStatistic
386 //
387 // A possible value for column TYPE in the TSQLResultSet
388 // object returned by the method GetIndexInfo().
389 //
390 // Indicates that this column contains table statistics
391 // that are returned in conjunction with a table's index
392 // descriptions.
393 //
394 //___________________________________________________________________
395 // kTableIndexClustered
396 //
397 // A possible value for column TYPE in the TSQLResultSet object
398 // returned by the method GetIndexInfo().
399 //
400 // Indicates that this table index is a clustered index.
401 //
402 //___________________________________________________________________
403 // kTableIndexHashed
404 //
405 // A possible value for column TYPE in the TSQLResultSet object
406 // returned by the method GetIndexInfo().
407 //
408 // Indicates that this table index is a hashed index.
409 //
410 //___________________________________________________________________
411 // kTableIndexOther
412 //
413 // A possible value for column TYPE in the TSQLResultSet object
414 // returned by the method GetIndexInfo().
415 //
416 // Indicates that this table index is not a clustered index,
417 // a hashed index, or table statistics; it is something
418 // other than these.
419 //
420 // See also:
421 // TSQLTypes TSQLConnection
422 //
424 
425 #include "ODBCDatabaseMetaData.h"
426 #include "ODBCResultSet.h"
427 #include "ODBCConnection.h"
429 #include <RDBC/odbc++/resultset.h>
430 
431 using namespace odbc;
432 using namespace std;
433 
435 
436 
437 //___________________________________________________________________
439  TSQLDatabaseMetaData(connection,imp)
440 {
441  // constructor
442 
443 }
444 
445 //___________________________________________________________________
447 {
448  // destructor will be called when fConnection is deleted
449 
450  fConnection = 0;
451 
452  //fImp deleted when fConnection->fImp is deleted
453 }
454 
455 //___________________________________________________________________
457 {
458  // Can all the procedures returned by GetProcedures be
459  // called by the current user?
460  //
461  // Returns:
462  // kTRUE if so; kFALSE otherwise
463  // Throws:
464  // TSQLException - if a database access error occurs
465 
466  Bool_t return_value = kFALSE;
467 
468  if(!fImp) { Destroyed(); return return_value; }
470 
471  try {
472  return_value = imp->allProceduresAreCallable();
473 
474  } catch(odbc::SQLException& e) {
477  e.getErrorCode()) );
478  return kFALSE;
479  }
480  return return_value;
481 }
482 
483 //___________________________________________________________________
485 {
486  // Can all the tables returned by GetTable() be SELECTed by
487  // the current user?
488  //
489  // Returns:
490  // kTRUE if so; kFALSE otherwise
491  // Throws:
492  // TSQLException - if a database access error occurs
493 
494  Bool_t return_value = kFALSE;
495 
496  if(!fImp) { Destroyed(); return return_value; }
498 
499  try {
500  return_value = imp->allTablesAreSelectable();
501 
502  } catch(odbc::SQLException& e) {
505  e.getErrorCode()) );
506  return kFALSE;
507  }
508  return return_value;
509 }
510 
511 //___________________________________________________________________
513 {
514  // What's our user name as known to the database?
515  //
516  // Returns:
517  // our database user name
518  // Throws:
519  // TSQLException - if a database access error occurs
520  //
521  // ... more comments based on "ODBC 3.5 Developer's Guide"
522  //
523  // Identifies the user name in a particular database
524  // (this name can be different from the login name)
525  //
526 
527  TString str;
528 
529  if(!fImp) { Destroyed(); return str; }
531 
532  try {
533  str = ODBCXX_STRING_CSTR( imp->getUserName() );
534 
535  } catch(odbc::SQLException& e) {
538  e.getErrorCode()) );
539  return "";
540  }
541  return str;
542 }
543 
544 //___________________________________________________________________
546 {
547  // Is the database in read-only mode?
548  //
549  // Returns:
550  // kTRUE if so; kFALSE otherwise
551  // Throws:
552  // TSQLException - if a database access error occurs
553  //
554  // ... more comments based on "ODBC 3.5 Developer's Guide"
555  //
556  // This characteristic pertains only to the data source itself;
557  // it is not a characteristic of the driver that enables access
558  // to the data source. A driver that is read/write can be used
559  // with a data source that is read-only.
560  //
561  // If a driver is read-only, all its data sources must be read-only
562  // and must return kTRUE for this method
563  //
564 
565  Bool_t return_value = kTRUE;
566 
567  if(!fImp) { Destroyed(); return return_value; }
569 
570  try {
571  return_value = imp->isReadOnly();
572 
573  } catch(odbc::SQLException& e) {
576  e.getErrorCode()) );
577  return kTRUE;
578  }
579  return return_value;
580 }
581 
582 //___________________________________________________________________
584 {
585  // Are NULL values sorted high?
586  //
587  // Returns:
588  // kTRUE if so; kFALSE otherwise
589  // Throws:
590  // TSQLException - if a database access error occurs
591  //
592  // Identifies where NULL values are sorted in a result data set
593  //
594 
595  Bool_t return_value = kFALSE;
596 
597  if(!fImp) { Destroyed(); return return_value; }
599 
600  try {
601  return_value = imp->nullsAreSortedHigh();
602 
603  } catch(odbc::SQLException& e) {
606  e.getErrorCode()) );
607  return kFALSE;
608  }
609  return return_value;
610 }
611 
612 //___________________________________________________________________
614 {
615  // Are NULL values sorted low?
616  //
617  // Returns:
618  // kTRUE if so; kFALSE otherwise
619  // Throws:
620  // TSQLException - if a database access error occurs
621  //
622  // Identifies where NULL values are sorted in a result data set
623  //
624 
625  Bool_t return_value = kFALSE;
626 
627  if(!fImp) { Destroyed(); return return_value; }
629 
630  try {
631  return_value = imp->nullsAreSortedLow();
632 
633  } catch(odbc::SQLException& e) {
636  e.getErrorCode()) );
637  return kFALSE;
638  }
639  return return_value;
640 }
641 
642 //___________________________________________________________________
644 {
645  // Are NULL values sorted at the start regardless of sort order?
646  //
647  // Returns:
648  // kTRUE if so; kFALSE otherwise
649  // Throws:
650  // TSQLException - if a database access error occurs
651  //
652  // Identifies where NULL values are sorted in a result data set
653  //
654 
655  Bool_t return_value = kFALSE;
656 
657  if(!fImp) { Destroyed(); return return_value; }
659 
660  try {
661  return_value = imp->nullsAreSortedAtStart();
662 
663  } catch(odbc::SQLException& e) {
666  e.getErrorCode()) );
667  return kFALSE;
668  }
669  return return_value;
670 }
671 
672 //___________________________________________________________________
674 {
675  // Are NULL values sorted at the end regardless of sort order?
676  //
677  // Returns:
678  // kTRUE if so; kFALSE otherwise
679  // Throws:
680  // TSQLException - if a database access error occurs
681  //
682  // Identifies where NULL values are sorted in a result data set
683  //
684 
685  Bool_t return_value = kFALSE;
686 
687  if(!fImp) { Destroyed(); return return_value; }
689 
690  try {
691  return_value = imp->nullsAreSortedAtEnd();
692 
693  } catch(odbc::SQLException& e) {
696  e.getErrorCode()) );
697  return kFALSE;
698  }
699  return return_value;
700 }
701 
702 //___________________________________________________________________
704 {
705  // What's the name of this database product?
706  //
707  // Returns:
708  // database product name
709  // Throws:
710  // TSQLException - if a database access error occurs
711 
712  TString str;
713 
714  if(!fImp) { Destroyed(); return str; }
716 
717  try {
719 
720  } catch(odbc::SQLException& e) {
723  e.getErrorCode()) );
724  return "";
725  }
726  return str;
727 }
728 
729 //___________________________________________________________________
731 {
732  // What's the version of this database product?
733  //
734  // ... more comments based on "ODBC 3.5 Developer's Guide"
735  //
736  // This information returned in a string that has format
737  // mm.vv.rrrr, where mm is the major version number,
738  // vv is the minor version number, and rrrr is the release
739  // virsion number.
740  //
741  // Returns:
742  // database version
743  // Throws:
744  // TSQLException - if a database access error occurs
745 
746  TString str;
747 
748  if(!fImp) { Destroyed(); return str; }
750 
751  try {
753 
754  } catch(odbc::SQLException& e) {
757  e.getErrorCode()) );
758  return "";
759  }
760  return str;
761 }
762 
763 //___________________________________________________________________
765 {
766  // What's the name of this ODBC driver?
767  //
768  // Returns:
769  // driver name
770  // Throws:
771  // TSQLException - if a database access error occurs
772 
773  TString str;
774 
775  if(!fImp) { Destroyed(); return str; }
777 
778  try {
779  str = ODBCXX_STRING_CSTR( imp->getDriverName() );
780 
781  } catch(odbc::SQLException& e) {
784  e.getErrorCode()) );
785  return "";
786  }
787  return str;
788 }
789 
790 //___________________________________________________________________
792 {
793  // What's the version of this ODBC driver?
794  //
795  // ... more comments based on "ODBC 3.5 Developer's Guide"
796  //
797  // This information returned in a string that has format
798  // mm.vv.rrrr, where mm is the major version number,
799  // vv is the minor version number, and rrrr is the release
800  // virsion number
801  //
802  // Returns:
803  // driver version
804  // Throws:
805  // TSQLException - if a database access error occurs
806 
807  TString str;
808 
809  if(!fImp) { Destroyed(); return str; }
811 
812  try {
813  str = ODBCXX_STRING_CSTR( imp->getDriverVersion() );
814 
815  } catch(odbc::SQLException& e) {
818  e.getErrorCode()) );
819  return "";
820  }
821  return str;
822 }
823 
824 //___________________________________________________________________
826 {
827  // What's this driver's major version number?
828  //
829  // Returns:
830  // driver major version
831 
832  Int_t return_value = 0;
833 
834  if(!fImp) { Destroyed(); return return_value; }
836 
837  try {
838  return_value = imp->getDriverMajorVersion();
839 
840  } catch(odbc::SQLException& e) {
843  e.getErrorCode()) );
844  return 0;
845  }
846  return return_value;
847 }
848 
849 //___________________________________________________________________
851 {
852  // What's this driver's minor version number?
853  //
854  // Returns:
855  // driver minor version number
856 
857  Int_t return_value = 0;
858 
859  if(!fImp) { Destroyed(); return return_value; }
861 
862  try {
863  return_value = imp->getDriverMinorVersion();
864 
865  } catch(odbc::SQLException& e) {
868  e.getErrorCode()) );
869  return 0;
870  }
871  return return_value;
872 }
873 
874 //___________________________________________________________________
876 {
877  // Does the database store tables in a local file?
878  //
879  // Returns:
880  // kTRUE if so; kFALSE otherwise
881  // Throws:
882  // TSQLException - if a database access error occurs
883  //
884  // ... more comments based on "ODBC 3.5 Developer's Guide"
885  //
886  // kFALSE means that driver is a not single-tier driver
887  // thereore files are not supported
888 
889  Bool_t return_value = kFALSE;
890 
891  if(!fImp) { Destroyed(); return return_value; }
893 
894  try {
895  return_value = imp->usesLocalFiles();
896 
897  } catch(odbc::SQLException& e) {
900  e.getErrorCode()) );
901  return kFALSE;
902  }
903  return return_value;
904 }
905 
906 //___________________________________________________________________
908 {
909  // Does the database use a file for each table?
910  //
911  // Returns:
912  // kTRUE if the database uses a local file for each table
913  // Throws:
914  // TSQLException - if a database access error occurs
915  //
916  // ... more comments based on "ODBC 3.5 Developer's Guide"
917  //
918  // The single-tier driver treats files in a data source as
919  // tables
920  //
921 
922  Bool_t return_value = kFALSE;
923 
924  if(!fImp) { Destroyed(); return return_value; }
926 
927  try {
928  return_value = imp->usesLocalFilePerTable();
929 
930  } catch(odbc::SQLException& e) {
933  e.getErrorCode()) );
934  return kFALSE;
935  }
936  return return_value;
937 }
938 
939 //___________________________________________________________________
941 {
942  // Does the database treat mixed case unquoted SQL identifiers
943  // as case sensitive and as a result store them in mixed case?
944  // A SQL-92 complient driver will always return kFALSE.
945  //
946  // Returns:
947  // kTRUE if so; kFALSE otherwise
948  // Throws:
949  // TSQLException - if a database access error occurs
950 
951  Bool_t return_value = kFALSE;
952 
953  if(!fImp) { Destroyed(); return return_value; }
955 
956  try {
957  return_value = imp->supportsMixedCaseIdentifiers();
958 
959  } catch(odbc::SQLException& e) {
962  e.getErrorCode()) );
963  return kFALSE;
964  }
965  return return_value;
966 }
967 
968 //___________________________________________________________________
970 {
971  // Does the database treat mixed case unquoted SQL identifiers
972  // as case insensitive and store them in upper case?
973  //
974  // Returns:
975  // kTRUE if so; kFALSE otherwise
976  // Throws:
977  // TSQLException - if a database access error occurs
978 
979  Bool_t return_value = kFALSE;
980 
981  if(!fImp) { Destroyed(); return return_value; }
983 
984  try {
985  return_value = imp->storesUpperCaseIdentifiers();
986 
987  } catch(odbc::SQLException& e) {
990  e.getErrorCode()) );
991  return kFALSE;
992  }
993  return return_value;
994 }
995 
996 //___________________________________________________________________
998 {
999  // 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; }
1011 
1012  try {
1013  return_value = imp->storesLowerCaseIdentifiers();
1014 
1015  } catch(odbc::SQLException& e) {
1016  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1018  e.getErrorCode()) );
1019  return kFALSE;
1020  }
1021  return return_value;
1022 }
1023 
1024 //___________________________________________________________________
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; }
1039 
1040  try {
1041  return_value = imp->storesMixedCaseIdentifiers();
1042 
1043  } catch(odbc::SQLException& e) {
1044  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1046  e.getErrorCode()) );
1047  return kFALSE;
1048  }
1049  return return_value;
1050 }
1051 
1052 //___________________________________________________________________
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; }
1069 
1070  try {
1071  return_value = imp->supportsMixedCaseQuotedIdentifiers();
1072 
1073  } catch(odbc::SQLException& e) {
1074  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1076  e.getErrorCode()) );
1077  return kFALSE;
1078  }
1079  return return_value;
1080 }
1081 
1082 //___________________________________________________________________
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; }
1097 
1098  try {
1099  return_value = imp->storesUpperCaseQuotedIdentifiers();
1100 
1101  } catch(odbc::SQLException& e) {
1102  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1104  e.getErrorCode()) );
1105  return kFALSE;
1106  }
1107  return return_value;
1108 }
1109 
1110 //___________________________________________________________________
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; }
1125 
1126  try {
1127  return_value = imp->storesLowerCaseQuotedIdentifiers();
1128 
1129  } catch(odbc::SQLException& e) {
1130  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1132  e.getErrorCode()) );
1133  return kFALSE;
1134  }
1135  return return_value;
1136 }
1137 
1138 //___________________________________________________________________
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; }
1153 
1154  try {
1155  return_value = imp->storesMixedCaseQuotedIdentifiers();
1156 
1157  } catch(odbc::SQLException& e) {
1158  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1160  e.getErrorCode()) );
1161  return kFALSE;
1162  }
1163  return return_value;
1164 }
1165 
1166 //___________________________________________________________________
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; }
1195 
1196  try {
1198 
1199  } catch(odbc::SQLException& e) {
1200  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1202  e.getErrorCode()) );
1203  return "";
1204  }
1205  return str;
1206 }
1207 
1208 //___________________________________________________________________
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; }
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()),
1229  e.getErrorCode()) );
1230  return "";
1231  }
1232  return str;
1233 }
1234 
1235 //___________________________________________________________________
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; }
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()),
1258  e.getErrorCode()) );
1259  return "";
1260  }
1261  return str;
1262 }
1263 
1264 //___________________________________________________________________
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; }
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()),
1287  e.getErrorCode()) );
1288  return "";
1289  }
1290  return str;
1291 }
1292 
1293 //___________________________________________________________________
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; }
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()),
1316  e.getErrorCode()) );
1317  return "";
1318  }
1319  return str;
1320 }
1321 
1322 //___________________________________________________________________
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; }
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()),
1344  e.getErrorCode()) );
1345  return "";
1346  }
1347  return str;
1348 }
1349 
1350 //___________________________________________________________________
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; }
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()),
1384  e.getErrorCode()) );
1385  return "";
1386  }
1387  return str;
1388 }
1389 
1390 //___________________________________________________________________
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; }
1406 
1407  try {
1409 
1410  } catch(odbc::SQLException& e) {
1411  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1413  e.getErrorCode()) );
1414  return "";
1415  }
1416  return str;
1417 }
1418 
1419 //___________________________________________________________________
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; }
1433 
1434  try {
1435  return_value = imp->supportsAlterTableWithAddColumn();
1436 
1437  } catch(odbc::SQLException& e) {
1438  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1440  e.getErrorCode()) );
1441  return kFALSE;
1442  }
1443  return return_value;
1444 }
1445 
1446 //___________________________________________________________________
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; }
1460 
1461  try {
1462  return_value = imp->supportsAlterTableWithDropColumn();
1463 
1464  } catch(odbc::SQLException& e) {
1465  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1467  e.getErrorCode()) );
1468  return kFALSE;
1469  }
1470  return return_value;
1471 }
1472 
1473 //___________________________________________________________________
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; }
1492 
1493  try {
1494  return_value = imp->supportsColumnAliasing();
1495 
1496  } catch(odbc::SQLException& e) {
1497  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1499  e.getErrorCode()) );
1500  return kFALSE;
1501  }
1502  return return_value;
1503 }
1504 
1505 //___________________________________________________________________
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; }
1520 
1521  try {
1522  return_value = imp->nullPlusNonNullIsNull();
1523 
1524  } catch(odbc::SQLException& e) {
1525  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1527  e.getErrorCode()) );
1528  return kFALSE;
1529  }
1530  return return_value;
1531 }
1532 
1533 //___________________________________________________________________
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; }
1547 
1548  try {
1549  return_value = imp->supportsConvert();
1550 
1551  } catch(odbc::SQLException& e) {
1552  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1554  e.getErrorCode()) );
1555  return kFALSE;
1556  }
1557  return return_value;
1558 }
1559 
1560 //___________________________________________________________________
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; }
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()),
1600  e.getErrorCode()) );
1601  return kFALSE;
1602  }
1603  return return_value;
1604 }
1605 
1606 //___________________________________________________________________
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; }
1621 
1622  try {
1623  return_value = imp->supportsTableCorrelationNames();
1624 
1625  } catch(odbc::SQLException& e) {
1626  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1628  e.getErrorCode()) );
1629  return kFALSE;
1630  }
1631  return return_value;
1632 }
1633 
1634 //___________________________________________________________________
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; }
1649 
1650  try {
1651  return_value = imp->supportsDifferentTableCorrelationNames();
1652 
1653  } catch(odbc::SQLException& e) {
1654  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1656  e.getErrorCode()) );
1657  return kFALSE;
1658  }
1659  return return_value;
1660 }
1661 
1662 //___________________________________________________________________
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; }
1676 
1677  try {
1678  return_value = imp->supportsExpressionsInOrderBy();
1679 
1680  } catch(odbc::SQLException& e) {
1681  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1683  e.getErrorCode()) );
1684  return kFALSE;
1685  }
1686  return return_value;
1687 }
1688 
1689 //___________________________________________________________________
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; }
1704 
1705  try {
1706  return_value = imp->supportsOrderByUnrelated();
1707 
1708  } catch(odbc::SQLException& e) {
1709  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1711  e.getErrorCode()) );
1712  return kFALSE;
1713  }
1714  return return_value;
1715 }
1716 
1717 //___________________________________________________________________
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; }
1731 
1732  try {
1733  return_value = imp->supportsGroupBy();
1734 
1735  } catch(odbc::SQLException& e) {
1736  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1738  e.getErrorCode()) );
1739  return kFALSE;
1740  }
1741  return return_value;
1742 }
1743 
1744 //___________________________________________________________________
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; }
1761 
1762  try {
1763  return_value = imp->supportsGroupByUnrelated();
1764 
1765  } catch(odbc::SQLException& e) {
1766  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1768  e.getErrorCode()) );
1769  return kFALSE;
1770  }
1771  return return_value;
1772 }
1773 
1774 //___________________________________________________________________
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; }
1793 
1794  try {
1795  return_value = imp->supportsGroupByBeyondSelect();
1796 
1797  } catch(odbc::SQLException& e) {
1798  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1800  e.getErrorCode()) );
1801  return kFALSE;
1802  }
1803  return return_value;
1804 }
1805 
1806 //___________________________________________________________________
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; }
1822 
1823  try {
1824  return_value = imp->supportsLikeEscapeClause();
1825 
1826  } catch(odbc::SQLException& e) {
1827  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1829  e.getErrorCode()) );
1830  return kFALSE;
1831  }
1832  return return_value;
1833 }
1834 
1835 //___________________________________________________________________
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; }
1849 
1850  try {
1851  return_value = imp->supportsMultipleResultSets();
1852 
1853  } catch(odbc::SQLException& e) {
1854  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1856  e.getErrorCode()) );
1857  return kFALSE;
1858  }
1859  return return_value;
1860 }
1861 
1862 //___________________________________________________________________
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; }
1877 
1878  try {
1879  return_value = imp->supportsMultipleTransactions();
1880 
1881  } catch(odbc::SQLException& e) {
1882  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1884  e.getErrorCode()) );
1885  return kFALSE;
1886  }
1887  return return_value;
1888 }
1889 
1890 //___________________________________________________________________
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; }
1911 
1912  try {
1913  return_value = imp->supportsNonNullableColumns();
1914 
1915  } catch(odbc::SQLException& e) {
1916  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1918  e.getErrorCode()) );
1919  return kFALSE;
1920  }
1921  return return_value;
1922 }
1923 
1924 //___________________________________________________________________
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; }
1939 
1940  try {
1941  return_value = imp->supportsMinimumSQLGrammar();
1942 
1943  } catch(odbc::SQLException& e) {
1944  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1946  e.getErrorCode()) );
1947  return kFALSE;
1948  }
1949  return return_value;
1950 }
1951 
1952 //___________________________________________________________________
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; }
1966 
1967  try {
1968  return_value = imp->supportsCoreSQLGrammar();
1969 
1970  } catch(odbc::SQLException& e) {
1971  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
1973  e.getErrorCode()) );
1974  return kFALSE;
1975  }
1976  return return_value;
1977 }
1978 
1979 //___________________________________________________________________
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; }
1993 
1994  try {
1995  return_value = imp->supportsExtendedSQLGrammar();
1996 
1997  } catch(odbc::SQLException& e) {
1998  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2000  e.getErrorCode()) );
2001  return kFALSE;
2002  }
2003  return return_value;
2004 }
2005 
2006 //___________________________________________________________________
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; }
2021 
2022  try {
2023  return_value = imp->supportsANSI92EntryLevelSQL();
2024 
2025  } catch(odbc::SQLException& e) {
2026  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2028  e.getErrorCode()) );
2029  return kFALSE;
2030  }
2031  return return_value;
2032 }
2033 
2034 //___________________________________________________________________
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; }
2048 
2049  try {
2050  return_value = imp->supportsANSI92IntermediateSQL();
2051 
2052  } catch(odbc::SQLException& e) {
2053  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2055  e.getErrorCode()) );
2056  return kFALSE;
2057  }
2058  return return_value;
2059 }
2060 
2061 //___________________________________________________________________
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()),
2083  e.getErrorCode()) );
2084  return kFALSE;
2085  }
2086  return return_value;
2087 }
2088 
2089 //___________________________________________________________________
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; }
2103 
2104  try {
2105  return_value = imp->supportsIntegrityEnhancementFacility();
2106 
2107  } catch(odbc::SQLException& e) {
2108  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2110  e.getErrorCode()) );
2111  return kFALSE;
2112  }
2113  return return_value;
2114 }
2115 
2116 //___________________________________________________________________
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; }
2130 
2131  try {
2132  return_value = imp->supportsOuterJoins();
2133 
2134  } catch(odbc::SQLException& e) {
2135  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2137  e.getErrorCode()) );
2138  return kFALSE;
2139  }
2140  return return_value;
2141 }
2142 
2143 //___________________________________________________________________
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; }
2157 
2158  try {
2159  return_value = imp->supportsFullOuterJoins();
2160 
2161  } catch(odbc::SQLException& e) {
2162  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2164  e.getErrorCode()) );
2165  return kFALSE;
2166  }
2167  return return_value;
2168 }
2169 
2170 //___________________________________________________________________
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; }
2185 
2186  try {
2187  return_value = imp->supportsLimitedOuterJoins();
2188 
2189  } catch(odbc::SQLException& e) {
2190  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2192  e.getErrorCode()) );
2193  return kFALSE;
2194  }
2195  return return_value;
2196 }
2197 
2198 //___________________________________________________________________
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; }
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()),
2224  e.getErrorCode()) );
2225  return "";
2226  }
2227  return str;
2228 }
2229 
2230 //___________________________________________________________________
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; }
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()),
2254  e.getErrorCode()) );
2255  return "";
2256  }
2257  return str;
2258 }
2259 
2260 //___________________________________________________________________
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; }
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()),
2285  e.getErrorCode()) );
2286  return "";
2287  }
2288  return str;
2289 }
2290 
2291 //___________________________________________________________________
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; }
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()),
2317  e.getErrorCode()) );
2318  return "";
2319  }
2320  return str;
2321 }
2322 
2323 //___________________________________________________________________
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; }
2344 
2345  try {
2346  return_value = imp->isCatalogAtStart();
2347 
2348  } catch(odbc::SQLException& e) {
2349  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2351  e.getErrorCode()) );
2352  return kFALSE;
2353  }
2354  return return_value;
2355 }
2356 
2357 //___________________________________________________________________
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; }
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()),
2384  e.getErrorCode()) );
2385  return "";
2386  }
2387  return str;
2388 }
2389 
2390 //___________________________________________________________________
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; }
2414 
2415  try {
2416  return_value = imp->supportsSchemasInDataManipulation();
2417 
2418  } catch(odbc::SQLException& e) {
2419  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2421  e.getErrorCode()) );
2422  return kFALSE;
2423  }
2424  return return_value;
2425 }
2426 
2427 //___________________________________________________________________
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; }
2441 
2442  try {
2443  return_value = imp->supportsSchemasInProcedureCalls();
2444 
2445  } catch(odbc::SQLException& e) {
2446  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2448  e.getErrorCode()) );
2449  return kFALSE;
2450  }
2451  return return_value;
2452 }
2453 
2454 //___________________________________________________________________
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; }
2474 
2475  try {
2476  return_value = imp->supportsSchemasInTableDefinitions();
2477 
2478  } catch(odbc::SQLException& e) {
2479  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2481  e.getErrorCode()) );
2482  return kFALSE;
2483  }
2484  return return_value;
2485 }
2486 
2487 //___________________________________________________________________
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; }
2504 
2505  try {
2506  return_value = imp->supportsSchemasInIndexDefinitions();
2507 
2508  } catch(odbc::SQLException& e) {
2509  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2511  e.getErrorCode()) );
2512  return kFALSE;
2513  }
2514  return return_value;
2515 }
2516 
2517 //___________________________________________________________________
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; }
2536 
2537  try {
2538  return_value = imp->supportsSchemasInPrivilegeDefinitions();
2539 
2540  } catch(odbc::SQLException& e) {
2541  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2543  e.getErrorCode()) );
2544  return kFALSE;
2545  }
2546  return return_value;
2547 }
2548 
2549 //___________________________________________________________________
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; }
2573 
2574  try {
2575  return_value = imp->supportsCatalogsInDataManipulation();
2576 
2577  } catch(odbc::SQLException& e) {
2578  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2580  e.getErrorCode()) );
2581  return kFALSE;
2582  }
2583  return return_value;
2584 }
2585 
2586 //___________________________________________________________________
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; }
2602 
2603  try {
2604  return_value = imp->supportsCatalogsInProcedureCalls();
2605 
2606  } catch(odbc::SQLException& e) {
2607  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2609  e.getErrorCode()) );
2610  return kFALSE;
2611  }
2612  return return_value;
2613 }
2614 
2615 //___________________________________________________________________
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; }
2633 
2634  try {
2635  return_value = imp->supportsCatalogsInTableDefinitions();
2636 
2637  } catch(odbc::SQLException& e) {
2638  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2640  e.getErrorCode()) );
2641  return kFALSE;
2642  }
2643  return return_value;
2644 }
2645 
2646 //___________________________________________________________________
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; }
2665 
2666  try {
2667  return_value = imp->supportsCatalogsInIndexDefinitions();
2668 
2669  } catch(odbc::SQLException& e) {
2670  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2672  e.getErrorCode()) );
2673  return kFALSE;
2674  }
2675  return return_value;
2676 }
2677 
2678 //___________________________________________________________________
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; }
2697 
2698  try {
2699  return_value = imp->supportsCatalogsInPrivilegeDefinitions();
2700 
2701  } catch(odbc::SQLException& e) {
2702  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2704  e.getErrorCode()) );
2705  return kFALSE;
2706  }
2707  return return_value;
2708 }
2709 
2710 //___________________________________________________________________
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; }
2724 
2725  try {
2726  return_value = imp->supportsPositionedDelete();
2727 
2728  } catch(odbc::SQLException& e) {
2729  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2731  e.getErrorCode()) );
2732  return kFALSE;
2733  }
2734  return return_value;
2735 }
2736 
2737 //___________________________________________________________________
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; }
2751 
2752  try {
2753  return_value = imp->supportsPositionedUpdate();
2754 
2755  } catch(odbc::SQLException& e) {
2756  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2758  e.getErrorCode()) );
2759  return kFALSE;
2760  }
2761  return return_value;
2762 }
2763 
2764 //___________________________________________________________________
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; }
2778 
2779  try {
2780  return_value = imp->supportsStoredProcedures();
2781 
2782  } catch(odbc::SQLException& e) {
2783  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2785  e.getErrorCode()) );
2786  return kFALSE;
2787  }
2788  return return_value;
2789 }
2790 
2791 //___________________________________________________________________
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; }
2806 
2807  try {
2808  return_value = imp->supportsStoredProcedures();
2809 
2810  } catch(odbc::SQLException& e) {
2811  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2813  e.getErrorCode()) );
2814  return kFALSE;
2815  }
2816  return return_value;
2817 }
2818 
2819 //___________________________________________________________________
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; }
2834 
2835  try {
2836  return_value = imp->supportsSubqueriesInComparisons();
2837 
2838  } catch(odbc::SQLException& e) {
2839  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2841  e.getErrorCode()) );
2842  return kFALSE;
2843  }
2844  return return_value;
2845 }
2846 
2847 //___________________________________________________________________
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; }
2862 
2863  try {
2864  return_value = imp->supportsSubqueriesInExists();
2865 
2866  } catch(odbc::SQLException& e) {
2867  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2869  e.getErrorCode()) );
2870  return kFALSE;
2871  }
2872  return return_value;
2873 }
2874 
2875 //___________________________________________________________________
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; }
2890 
2891  try {
2892  return_value = imp->supportsSubqueriesInIns();
2893 
2894  } catch(odbc::SQLException& e) {
2895  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2897  e.getErrorCode()) );
2898  return kFALSE;
2899  }
2900  return return_value;
2901 }
2902 
2903 //___________________________________________________________________
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; }
2918 
2919  try {
2920  return_value = imp->supportsSubqueriesInQuantifieds();
2921 
2922  } catch(odbc::SQLException& e) {
2923  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2925  e.getErrorCode()) );
2926  return kFALSE;
2927  }
2928  return return_value;
2929 }
2930 
2931 //___________________________________________________________________
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; }
2946 
2947  try {
2948  return_value = imp->supportsCorrelatedSubqueries();
2949 
2950  } catch(odbc::SQLException& e) {
2951  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2953  e.getErrorCode()) );
2954  return kFALSE;
2955  }
2956  return return_value;
2957 }
2958 
2959 //___________________________________________________________________
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; }
2974 
2975  try {
2976  return_value = imp->supportsUnion();
2977 
2978  } catch(odbc::SQLException& e) {
2979  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
2981  e.getErrorCode()) );
2982  return kFALSE;
2983  }
2984  return return_value;
2985 }
2986 
2987 //___________________________________________________________________
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; }
3002 
3003  try {
3004  return_value = imp->supportsUnionAll();
3005 
3006  } catch(odbc::SQLException& e) {
3007  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3009  e.getErrorCode()) );
3010  return kFALSE;
3011  }
3012  return return_value;
3013 }
3014 
3015 //___________________________________________________________________
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 {
3045  return_value = imp->supportsOpenCursorsAcrossCommit();
3046 
3047  } catch(odbc::SQLException& e) {
3048  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3050  e.getErrorCode()) );
3051  return kFALSE;
3052  }
3053  return return_value;
3054 }
3055 
3056 //___________________________________________________________________
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 {
3086  return_value = imp->supportsOpenCursorsAcrossRollback();
3087 
3088  } catch(odbc::SQLException& e) {
3089  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3091  e.getErrorCode()) );
3092  return kFALSE;
3093  }
3094  return return_value;
3095 }
3096 
3097 //___________________________________________________________________
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; }
3116 
3117  try {
3118  return_value = imp->supportsOpenStatementsAcrossCommit();
3119 
3120  } catch(odbc::SQLException& e) {
3121  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3123  e.getErrorCode()) );
3124  return kFALSE;
3125  }
3126  return return_value;
3127 }
3128 
3129 //___________________________________________________________________
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; }
3148 
3149  try {
3150  return_value = imp->supportsOpenStatementsAcrossRollback();
3151 
3152  } catch(odbc::SQLException& e) {
3153  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3155  e.getErrorCode()) );
3156  return kFALSE;
3157  }
3158  return return_value;
3159 }
3160 
3161 //___________________________________________________________________
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 {
3181  return_value = imp->getMaxBinaryLiteralLength();
3182 
3183  } catch(odbc::SQLException& e) {
3184  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3186  e.getErrorCode()) );
3187  return 0;
3188  }
3189  return return_value;
3190 }
3191 
3192 //___________________________________________________________________
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 {
3210  return_value = imp->getMaxCharLiteralLength();
3211 
3212  } catch(odbc::SQLException& e) {
3213  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3215  e.getErrorCode()) );
3216  return 0;
3217  }
3218  return return_value;
3219 }
3220 
3221 //___________________________________________________________________
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 {
3237  return_value = imp->getMaxColumnNameLength();
3238 
3239  } catch(odbc::SQLException& e) {
3240  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3242  e.getErrorCode()) );
3243  return 0;
3244  }
3245  return return_value;
3246 }
3247 
3248 //___________________________________________________________________
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 {
3264  return_value = imp->getMaxColumnsInGroupBy();
3265 
3266  } catch(odbc::SQLException& e) {
3267  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3269  e.getErrorCode()) );
3270  return 0;
3271  }
3272  return return_value;
3273 }
3274 
3275 //___________________________________________________________________
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 {
3291  return_value = imp->getMaxColumnsInIndex();
3292 
3293  } catch(odbc::SQLException& e) {
3294  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3296  e.getErrorCode()) );
3297  return 0;
3298  }
3299  return return_value;
3300 }
3301 
3302 //___________________________________________________________________
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 {
3318  return_value = imp->getMaxColumnsInOrderBy();
3319 
3320  } catch(odbc::SQLException& e) {
3321  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3323  e.getErrorCode()) );
3324  return 0;
3325  }
3326  return return_value;
3327 }
3328 
3329 //___________________________________________________________________
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 {
3345  return_value = imp->getMaxColumnsInSelect();
3346 
3347  } catch(odbc::SQLException& e) {
3348  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3350  e.getErrorCode()) );
3351  return 0;
3352  }
3353  return return_value;
3354 }
3355 
3356 //___________________________________________________________________
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 {
3372  return_value = imp->getMaxColumnsInTable();
3373 
3374  } catch(odbc::SQLException& e) {
3375  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3377  e.getErrorCode()) );
3378  return 0;
3379  }
3380  return return_value;
3381 }
3382 
3383 //___________________________________________________________________
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 {
3401  return_value = imp->getMaxConnections();
3402 
3403  } catch(odbc::SQLException& e) {
3404  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3406  e.getErrorCode()) );
3407  return 0;
3408  }
3409  return return_value;
3410 }
3411 
3412 //___________________________________________________________________
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 {
3428  return_value = imp->getMaxCursorNameLength();
3429 
3430  } catch(odbc::SQLException& e) {
3431  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3433  e.getErrorCode()) );
3434  return 0;
3435  }
3436  return return_value;
3437 }
3438 
3439 //___________________________________________________________________
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 {
3455  return_value = imp->getMaxIndexLength();
3456 
3457  } catch(odbc::SQLException& e) {
3458  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3460  e.getErrorCode()) );
3461  return 0;
3462  }
3463  return return_value;
3464 }
3465 
3466 //___________________________________________________________________
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 {
3482  return_value = imp->getMaxSchemaNameLength();
3483 
3484  } catch(odbc::SQLException& e) {
3485  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3487  e.getErrorCode()) );
3488  return 0;
3489  }
3490  return return_value;
3491 }
3492 
3493 //___________________________________________________________________
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 {
3509  return_value = imp->getMaxProcedureNameLength();
3510 
3511  } catch(odbc::SQLException& e) {
3512  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3514  e.getErrorCode()) );
3515  return 0;
3516  }
3517  return return_value;
3518 }
3519 
3520 //___________________________________________________________________
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 {
3536  return_value = imp->getMaxCatalogNameLength();
3537 
3538  } catch(odbc::SQLException& e) {
3539  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3541  e.getErrorCode()) );
3542  return 0;
3543  }
3544  return return_value;
3545 }
3546 
3547 //___________________________________________________________________
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 {
3563  return_value = imp->getMaxRowSize();
3564 
3565  } catch(odbc::SQLException& e) {
3566  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3568  e.getErrorCode()) );
3569  return 0;
3570  }
3571  return return_value;
3572 }
3573 
3574 //___________________________________________________________________
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 {
3590  return_value = imp->doesMaxRowSizeIncludeBlobs();
3591 
3592  } catch(odbc::SQLException& e) {
3593  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3595  e.getErrorCode()) );
3596  return kFALSE;
3597  }
3598  return return_value;
3599 }
3600 
3601 //___________________________________________________________________
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 {
3617  return_value = imp->getMaxStatementLength();
3618 
3619  } catch(odbc::SQLException& e) {
3620  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3622  e.getErrorCode()) );
3623  return 0;
3624  }
3625  return return_value;
3626 }
3627 
3628 //___________________________________________________________________
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 {
3657  return_value = imp->getMaxStatements();
3658 
3659  } catch(odbc::SQLException& e) {
3660  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3662  e.getErrorCode()) );
3663  return 0;
3664  }
3665  return return_value;
3666 }
3667 
3668 //___________________________________________________________________
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 {
3684  return_value = imp->getMaxTableNameLength();
3685 
3686  } catch(odbc::SQLException& e) {
3687  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3689  e.getErrorCode()) );
3690  return 0;
3691  }
3692  return return_value;
3693 }
3694 
3695 //___________________________________________________________________
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 {
3718  return_value = imp->getMaxTablesInSelect();
3719 
3720  } catch(odbc::SQLException& e) {
3721  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3723  e.getErrorCode()) );
3724  return 0;
3725  }
3726  return return_value;
3727 }
3728 
3729 //___________________________________________________________________
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 {
3745  return_value = imp->getMaxUserNameLength();
3746 
3747  } catch(odbc::SQLException& e) {
3748  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3750  e.getErrorCode()) );
3751  return 0;
3752  }
3753  return return_value;
3754 }
3755 
3756 //___________________________________________________________________
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 {
3774  return_value = imp->getDefaultTransactionIsolation();
3775 
3776  } catch(odbc::SQLException& e) {
3777  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3779  e.getErrorCode()) );
3780  return 0;
3781  }
3782  return return_value;
3783 }
3784 
3785 //___________________________________________________________________
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; }
3800 
3801  try {
3802  return_value = imp->supportsTransactions();
3803 
3804  } catch(odbc::SQLException& e) {
3805  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3807  e.getErrorCode()) );
3808  return kFALSE;
3809  }
3810  return return_value;
3811 }
3812 
3813 //___________________________________________________________________
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; }
3834 
3835  try {
3836  return_value = imp->supportsTransactionIsolationLevel(level);
3837 
3838  } catch(odbc::SQLException& e) {
3839  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3841  e.getErrorCode()) );
3842  return kFALSE;
3843  }
3844  return return_value;
3845 }
3846 
3847 //___________________________________________________________________
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; }
3862 
3863  try {
3865 
3866  } catch(odbc::SQLException& e) {
3867  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3869  e.getErrorCode()) );
3870  return kFALSE;
3871  }
3872  return return_value;
3873 }
3874 
3875 //___________________________________________________________________
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; }
3890 
3891  try {
3892  return_value = imp->supportsDataManipulationTransactionsOnly();
3893 
3894  } catch(odbc::SQLException& e) {
3895  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3897  e.getErrorCode()) );
3898  return kFALSE;
3899  }
3900  return return_value;
3901 }
3902 
3903 //___________________________________________________________________
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; }
3918 
3919  try {
3920  return_value = imp->dataDefinitionCausesTransactionCommit();
3921 
3922  } catch(odbc::SQLException& e) {
3923  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3925  e.getErrorCode()) );
3926  return kFALSE;
3927  }
3928  return return_value;
3929 }
3930 
3931 //___________________________________________________________________
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; }
3945 
3946  try {
3947  return_value = imp->dataDefinitionIgnoredInTransactions();
3948 
3949  } catch(odbc::SQLException& e) {
3950  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
3952  e.getErrorCode()) );
3953  return kFALSE;
3954  }
3955  return return_value;
3956 }
3957 
3958 //___________________________________________________________________
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; }
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()),
4021  e.getErrorCode()) );
4022  if(imp) delete imp;
4023  return 0;
4024  }
4025  return new ODBCResultSet(0,imp);
4026 }
4027 
4028 //___________________________________________________________________
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; }
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()),
4124  e.getErrorCode()) );
4125  if(imp) delete imp;
4126  return 0;
4127  }
4128  return new ODBCResultSet(0,imp);
4129 }
4130 
4131 //___________________________________________________________________
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; }
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()),
4217  e.getErrorCode()) );
4218  if(imp) delete imp;
4219  return 0;
4220  }
4221  return new ODBCResultSet(0,imp);
4222 }
4223 
4224 //___________________________________________________________________
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; }
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()),
4252  e.getErrorCode()) );
4253  if(imp) delete imp;
4254  return 0;
4255  }
4256  return new ODBCResultSet(0,imp);
4257 }
4258 
4259 //___________________________________________________________________
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; }
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()),
4287  e.getErrorCode()) );
4288 
4289  if(imp) delete imp;
4290  return 0;
4291  }
4292  return new ODBCResultSet(0,imp);
4293 }
4294 
4295 //___________________________________________________________________
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; }
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()),
4327  e.getErrorCode()) );
4328  if(imp) delete imp;
4329  return 0;
4330 
4331  }
4332  return new ODBCResultSet(0,imp);
4333 }
4334 
4335 //___________________________________________________________________
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; }
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()),
4432  e.getErrorCode()) );
4433  if(imp) delete imp;
4434  return 0;
4435  }
4436  return new ODBCResultSet(0,imp);
4437 }
4438 
4439 //___________________________________________________________________
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; }
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()),
4507  e.getErrorCode()) );
4508  if(imp) delete imp;
4509  return 0;
4510  }
4511  return new ODBCResultSet(0,imp);
4512 }
4513 
4514 //___________________________________________________________________
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; }
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()),
4581  e.getErrorCode()) );
4582  if(imp) delete imp;
4583  return 0;
4584  }
4585  return new ODBCResultSet(0,imp);
4586 }
4587 
4588 //___________________________________________________________________
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; }
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()),
4660  e.getErrorCode()) );
4661  if(imp) delete imp;
4662  return 0;
4663  }
4664  return new ODBCResultSet(0,imp);
4665 }
4666 
4667 //___________________________________________________________________
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; }
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()),
4727  e.getErrorCode()) );
4728  if(imp) delete imp;
4729  return 0;
4730  }
4731  return new ODBCResultSet(0,imp);
4732 }
4733 
4734 //___________________________________________________________________
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; }
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()),
4785  e.getErrorCode()) );
4786  if(imp) delete imp;
4787  return 0;
4788  }
4789  return new ODBCResultSet(0,imp);
4790 }
4791 
4792 //___________________________________________________________________
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; }
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()),
4899  e.getErrorCode()) );
4900  if(imp) delete imp;
4901  return 0;
4902  }
4903  return new ODBCResultSet(0,imp);
4904 }
4905 
4906 //___________________________________________________________________
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; }
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()),
5009  e.getErrorCode()) );
5010  if(imp) delete imp;
5011  return 0;
5012  }
5013  return new ODBCResultSet(0,imp);
5014 }
5015 
5016 //___________________________________________________________________
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; }
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()),
5137  e.getErrorCode()) );
5138  if(imp) delete imp;
5139  return 0;
5140  }
5141  return new ODBCResultSet(0,imp);
5142 }
5143 
5144 //___________________________________________________________________
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; }
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()),
5222  e.getErrorCode()) );
5223  if(imp) delete imp;
5224  return 0;
5225  }
5226  return new ODBCResultSet(0,imp);
5227 }
5228 
5229 //___________________________________________________________________
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; }
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()),
5331  e.getErrorCode()) );
5332  if(imp) delete imp;
5333  return 0;
5334 
5335  }
5336  return new ODBCResultSet(0,imp);
5337 }
5338 
5339 //___________________________________________________________________
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; }
5358 
5359  try {
5360  return_value = imp->supportsResultSetType(type);
5361 
5362  } catch(odbc::SQLException& e) {
5363  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
5365  e.getErrorCode()) );
5366  return kFALSE;
5367  }
5368  return return_value;
5369 }
5370 
5371 //___________________________________________________________________
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; }
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()),
5401  e.getErrorCode()) );
5402  return kFALSE;
5403  }
5404  return return_value;
5405 }
5406 
5407 //___________________________________________________________________
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; }
5427 
5428  try {
5429  return_value = imp->ownUpdatesAreVisible(type);
5430 
5431  } catch(odbc::SQLException& e) {
5432  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
5434  e.getErrorCode()) );
5435  return kFALSE;
5436  }
5437  return return_value;
5438 }
5439 
5440 //___________________________________________________________________
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; }
5460 
5461  try {
5462  return_value = imp->ownDeletesAreVisible(type);
5463 
5464  } catch(odbc::SQLException& e) {
5465  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
5467  e.getErrorCode()) );
5468  return kFALSE;
5469  }
5470  return return_value;
5471 }
5472 
5473 //___________________________________________________________________
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; }
5493 
5494  try {
5495  return_value = imp->ownInsertsAreVisible(type);
5496 
5497  } catch(odbc::SQLException& e) {
5498  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
5500  e.getErrorCode()) );
5501  return kFALSE;
5502  }
5503  return return_value;
5504 }
5505 
5506 //___________________________________________________________________
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; }
5524 
5525  try {
5526  return_value = imp->othersUpdatesAreVisible(type);
5527 
5528  } catch(odbc::SQLException& e) {
5529  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
5531  e.getErrorCode()) );
5532  return kFALSE;
5533  }
5534  return return_value;
5535 }
5536 
5537 //___________________________________________________________________
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; }
5555 
5556  try {
5557  return_value = imp->othersDeletesAreVisible(type);
5558 
5559  } catch(odbc::SQLException& e) {
5560  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
5562  e.getErrorCode()) );
5563  return kFALSE;
5564  }
5565  return return_value;
5566 }
5567 
5568 //___________________________________________________________________
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; }
5585 
5586  try {
5587  return_value = imp->othersInsertsAreVisible(type);
5588 
5589  } catch(odbc::SQLException& e) {
5590  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
5592  e.getErrorCode()) );
5593  return kFALSE;
5594  }
5595  return return_value;
5596 }
5597 
5598 //___________________________________________________________________
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; }
5617 
5618  try {
5619  return_value = imp->updatesAreDetected(type);
5620 
5621  } catch(odbc::SQLException& e) {
5622  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
5624  e.getErrorCode()) );
5625  return kFALSE;
5626  }
5627  return return_value;
5628 }
5629 
5630 //___________________________________________________________________
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; }
5650 
5651  try {
5652  return_value = imp->deletesAreDetected(type);
5653 
5654  } catch(odbc::SQLException& e) {
5655  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
5657  e.getErrorCode()) );
5658  return kFALSE;
5659  }
5660  return return_value;
5661 }
5662 
5663 //___________________________________________________________________
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; }
5681 
5682  try {
5683  return_value = imp->insertsAreDetected(type);
5684 
5685  } catch(odbc::SQLException& e) {
5686  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
5688  e.getErrorCode()) );
5689  return kFALSE;
5690  }
5691  return return_value;
5692 }
5693 
5694 //___________________________________________________________________
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; }
5707 
5708  try {
5709  return_value = imp->supportsBatchUpdates(); //
5710 
5711  } catch(odbc::SQLException& e) {
5712  Throw( new TSQLException( ODBCXX_STRING_CSTR(e.getMessage()),
5714  e.getErrorCode()) );
5715  return kFALSE;
5716  }
5717  return return_value;
5718 }