|
|
|||
File indexing completed on 2025-12-16 09:26:10
0001 /* 0002 This file is part of libodbc++. 0003 0004 Copyright (C) 1999-2000 Manush Dodunekov <manush@stendahls.net> 0005 0006 This library is free software; you can redistribute it and/or 0007 modify it under the terms of the GNU Library General Public 0008 License as published by the Free Software Foundation; either 0009 version 2 of the License, or (at your option) any later version. 0010 0011 This library is distributed in the hope that it will be useful, 0012 but WITHOUT ANY WARRANTY; without even the implied warranty of 0013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0014 Library General Public License for more details. 0015 0016 You should have received a copy of the GNU Library General Public License 0017 along with this library; see the file COPYING. If not, write to 0018 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 0019 Boston, MA 02111-1307, USA. 0020 */ 0021 0022 #ifndef __ODBCXX_DATABASEMETADATA_H 0023 #define __ODBCXX_DATABASEMETADATA_H 0024 0025 #include <RDBC/odbc++/setup.h> 0026 #include <RDBC/odbc++/types.h> 0027 #include <RDBC/odbc++/connection.h> 0028 0029 namespace odbc { 0030 0031 class ResultSet; 0032 class DriverInfo; 0033 0034 /** Provides several tons of information about a data source. 0035 * 0036 * @warning The column names in ResultSets returned by methods of 0037 * DatabaseMetaData can differ depending on what ODBC version 0038 * the current driver supports. To avoid problems, columns should 0039 * be referenced by number, and not by name. Also note that 0040 * ODBC version 2 drivers do not return some of the specified 0041 * columns. 0042 */ 0043 class ODBCXX_EXPORT DatabaseMetaData { 0044 friend class Connection; 0045 friend class DriverInfo; 0046 0047 private: 0048 Connection* connection_; 0049 0050 DatabaseMetaData(Connection* c); 0051 ~DatabaseMetaData(); 0052 0053 const DriverInfo* _getDriverInfo() const { 0054 return connection_->_getDriverInfo(); 0055 } 0056 0057 SQLUSMALLINT _getNumeric16(int what); 0058 SQLUINTEGER _getNumeric32(int what); 0059 0060 ODBCXX_STRING _getStringInfo(int what); 0061 bool _ownXXXAreVisible(int type, int what); 0062 0063 #if ODBCVER >= 0x0300 0064 // returns all CA1 or-ed together 0065 SQLUINTEGER _getAllCursorAttributes1(); 0066 #endif 0067 0068 public: 0069 0070 /** Returns the Connection this came from */ 0071 Connection* getConnection() { 0072 return connection_; 0073 } 0074 0075 /** Constants for the ResultSet returned by getBestRowIdentifier */ 0076 enum { 0077 bestRowTemporary = SQL_SCOPE_CURROW, 0078 bestRowTransaction = SQL_SCOPE_TRANSACTION, 0079 bestRowSession = SQL_SCOPE_SESSION 0080 }; 0081 0082 /** Constants for the ResultSet returned by getBestRowIdentifier */ 0083 enum { 0084 bestRowUnknown = SQL_PC_UNKNOWN, 0085 bestRowPseudo = SQL_PC_PSEUDO, 0086 bestRowNotPseudo = SQL_PC_NOT_PSEUDO 0087 }; 0088 0089 0090 /** Version column constants for getVersionColumns() 0091 * @see #getVersionColumns() 0092 */ 0093 enum { 0094 versionColumnNotPseudo = SQL_PC_NOT_PSEUDO, 0095 versionColumnPseudo = SQL_PC_PSEUDO, 0096 versionColumnUnknown = SQL_PC_UNKNOWN 0097 }; 0098 0099 0100 /** Nullability constants for the resultset returned by getTypes() 0101 * @see getTypes() 0102 */ 0103 enum { 0104 typeNoNulls = SQL_NO_NULLS, 0105 typeNullable = SQL_NULLABLE, 0106 typeNullableUnknown = SQL_NULLABLE_UNKNOWN 0107 }; 0108 0109 /** Nullability constants for the resultset returned by 0110 * getColumns(). 0111 * @see getColumns() 0112 */ 0113 enum { 0114 columnNoNulls = SQL_NO_NULLS, 0115 columnNullable = SQL_NULLABLE, 0116 columnNullableUnknown = SQL_NULLABLE_UNKNOWN 0117 }; 0118 0119 /** Searchability constants */ 0120 enum { 0121 /** Column is unsearchable */ 0122 typePredNone = SQL_UNSEARCHABLE, 0123 /** Column can only be used in a LIKE clause */ 0124 typePredChar = SQL_LIKE_ONLY, 0125 /** Column can be used in searches, except in LIKE */ 0126 typePredBasic = SQL_ALL_EXCEPT_LIKE, 0127 /** Column is searchable */ 0128 typeSearchable = SQL_SEARCHABLE 0129 }; 0130 0131 0132 /** Imported key UPDATE_RULE and DELETE_RULE constants. 0133 * @see getImportedKeys() 0134 */ 0135 #if ODBCVER >= 0x0300 0136 enum { 0137 importedKeyCascade = SQL_CASCADE, 0138 importedKeySetNull = SQL_SET_NULL, 0139 importedKeySetDefault = SQL_SET_DEFAULT, 0140 importedKeyNoAction = SQL_NO_ACTION, 0141 importedKeyRestrict = SQL_RESTRICT 0142 }; 0143 #else 0144 // workaround mode on 0145 enum { 0146 importedKeyCascade = SQL_CASCADE, 0147 importedKeySetNull = SQL_SET_NULL, 0148 importedKeyRestrict = SQL_RESTRICT, 0149 importedKeyNoAction = SQL_RESTRICT, 0150 importedKeySetDefault 0151 }; 0152 0153 #endif 0154 0155 #if ODBCVER >= 0x0300 0156 #if !defined(SQL_NOT_DEFERRABLE) 0157 # warning "Your sqlext.h is missing SQL_NOT_DEFERRABLE, consider upgrading" 0158 # define SQL_NOT_DEFERRABLE 7 0159 #endif 0160 /** Imported key DEFERRABILITY constants */ 0161 enum { 0162 importedKeyInitiallyDeferred = SQL_INITIALLY_DEFERRED, 0163 importedKeyInitiallyImmediate = SQL_INITIALLY_IMMEDIATE, 0164 importedKeyNotDeferrable = SQL_NOT_DEFERRABLE 0165 }; 0166 #endif 0167 0168 /** Index type constants */ 0169 enum { 0170 tableIndexClustered = SQL_INDEX_CLUSTERED, 0171 tableIndexHashed = SQL_INDEX_HASHED, 0172 tableIndexOther = SQL_INDEX_OTHER, 0173 tableIndexStatistic = SQL_TABLE_STAT 0174 }; 0175 0176 /** Procedure column type constants for getProcedureColumns() 0177 * @see #getProcedureColumns() 0178 */ 0179 enum { 0180 procedureColumnIn = SQL_PARAM_INPUT, 0181 procedureColumnInOut = SQL_PARAM_INPUT_OUTPUT, 0182 procedureColumnOut = SQL_PARAM_OUTPUT, 0183 procedureColumnResult = SQL_RESULT_COL, 0184 procedureColumnReturn = SQL_RETURN_VALUE, 0185 procedureColumnUnknown = SQL_PARAM_TYPE_UNKNOWN 0186 }; 0187 0188 /** Procedure column nullability constants for getProcedureColumns() 0189 * @see #getProcedureColumns() 0190 */ 0191 enum { 0192 procedureNoNulls = SQL_NO_NULLS, 0193 procedureNullable = SQL_NULLABLE, 0194 procedureNullableUnknown = SQL_NULLABLE_UNKNOWN 0195 }; 0196 0197 /** Procedure type constants for PROCEDURE_TYPE in getProcedures() 0198 * @see #getProcedures() 0199 */ 0200 enum { 0201 procedureReturnsResult = SQL_PT_FUNCTION, 0202 procedureNoResult = SQL_PT_PROCEDURE, 0203 procedureResultUnknown = SQL_PT_UNKNOWN 0204 }; 0205 0206 0207 0208 /** Returns the name of the database product. 0209 */ 0210 ODBCXX_STRING getDatabaseProductName(); 0211 0212 /** Returns the version of the database product as a string. 0213 */ 0214 ODBCXX_STRING getDatabaseProductVersion(); 0215 0216 /** Returns the name of the ODBC driver used. 0217 */ 0218 ODBCXX_STRING getDriverName(); 0219 0220 /** Returns the version of the ODBC driver used. 0221 */ 0222 ODBCXX_STRING getDriverVersion(); 0223 0224 /** Returns the major ODBC version of the driver used. */ 0225 int getDriverMajorVersion(); 0226 0227 /** Returns the minor ODBC version of the driver used. */ 0228 int getDriverMinorVersion(); 0229 0230 /** Returns the string that can be used to quote identifiers. 0231 * If the data source doesn't support it, returns an empty string. 0232 */ 0233 ODBCXX_STRING getIdentifierQuoteString(); 0234 0235 /** Returns the term for catalog used by the data source. 0236 * Can be for example "directory" or "database". 0237 */ 0238 ODBCXX_STRING getCatalogTerm(); 0239 0240 /** Returns the term for schema used by the data source, 0241 * for example "owner" or just "schema". 0242 */ 0243 ODBCXX_STRING getSchemaTerm(); 0244 0245 /** Returns the term for table used by the data source. 0246 */ 0247 ODBCXX_STRING getTableTerm(); 0248 0249 /** Returns the term the data source uses for a procedure, 0250 * for example "stored procedure". 0251 */ 0252 ODBCXX_STRING getProcedureTerm(); 0253 0254 /** Returns the user name of the connection. 0255 */ 0256 ODBCXX_STRING getUserName(); 0257 0258 /** Returns the string used to separate a catalog 0259 * in a fully qualified identifier. 0260 * 0261 * For example Oracle would return a "@", while 0262 * mysql would say ".". 0263 */ 0264 ODBCXX_STRING getCatalogSeparator(); 0265 0266 /** Returns true if the catalog is positioned at the 0267 * beginning of a fully qualified identifier. 0268 * 0269 * For example mysql would say true, while oracle would say false. 0270 */ 0271 bool isCatalogAtStart(); 0272 0273 /** Returns a comma-separated list of all non-ODBC keywords specific 0274 * to this data source. 0275 */ 0276 ODBCXX_STRING getSQLKeywords(); 0277 0278 0279 /** Returns true if the data source supports transactions. 0280 */ 0281 bool supportsTransactions(); 0282 0283 /** Returns the default transaction isolation level 0284 * @see Connection 0285 */ 0286 int getDefaultTransactionIsolation(); 0287 0288 /** Returns true if the data source supports the specified transaction 0289 * isolation level. 0290 * @param lev The isolation level to check for 0291 */ 0292 bool supportsTransactionIsolationLevel(int lev); 0293 0294 /** Checks if the data source supports both DML and DDL in transactions 0295 * 0296 * @return <code>true</code> if the data source supports both data manipulation 0297 * (eg. <code>UPDATE</code>, <code>INSERT</code>) and data definition 0298 * (eg. <code>CREATE TABLE</code>) within a transaction. 0299 * 0300 * 0301 * If this method returns <code>true</code>, 0302 * supportsDataManipulationTransactionsOnly(), 0303 * dataDefinitionCausesTransactionCommit() and 0304 * dataDefinitionIgnoredInTransactions() all return <code>false</code>. 0305 */ 0306 bool supportsDataDefinitionAndDataManipulationTransactions(); 0307 0308 /** Checks if the data source only supports DML in transactions 0309 * 0310 * @return <code>true</code> if the data source only supports data manipulation 0311 * (eg. <code>UPDATE</code>, <code>INSERT</code>) within a transaction. 0312 * 0313 * Attempts to use data definition 0314 * (eg. <code>CREATE TABLE</code>) in a transaction will trigger an 0315 * error. 0316 * 0317 * If this method returns <code>true</code>, 0318 * supportsDataDefinitionAndDataManipulationTransactions(), 0319 * dataDefinitionCausesTransactionCommit() and 0320 * dataDefinitionIgnoredInTransactions() all return <code>false</code>. 0321 */ 0322 bool supportsDataManipulationTransactionsOnly(); 0323 0324 /** Checks if DDL in a transaction will cause the transaction to be committed 0325 * 0326 * @return true if the data source only supports data manipulation 0327 * (eg. <code>UPDATE</code>, <code>INSERT</code>) within a transaction 0328 * and any data definition (eg. <code>CREATE TABLE</code>) will cause 0329 * the transaction to be committed. 0330 * 0331 * If this method returns <code>true</code>, 0332 * supportsDataDefinitionAndDataManipulationTransactions(), 0333 * supportsDataManipulationTransactionsOnly() and 0334 * dataDefinitionIgnoredInTransactions() all return <code>false</code>. 0335 */ 0336 bool dataDefinitionCausesTransactionCommit(); 0337 0338 /** Checks if DDL in a transaction is ignored 0339 * 0340 * @return true if the data source only supports data manipulation 0341 * (eg. <code>UPDATE</code>, <code>INSERT</code>) within a transaction 0342 * and any data definition (eg. <code>CREATE TABLE</code>) will be 0343 * ignored. 0344 * 0345 * If this method returns <code>true</code>, 0346 * supportsDataDefinitionAndDataManipulationTransactions(), 0347 * supportsDataManipulationTransactionsOnly() and 0348 * dataDefinitionCausesTransactionCommit() all return <code>false</code>. 0349 */ 0350 bool dataDefinitionIgnoredInTransactions(); 0351 0352 0353 /** 0354 */ 0355 bool supportsTableCorrelationNames(); 0356 0357 /** 0358 */ 0359 bool supportsDifferentTableCorrelationNames(); 0360 0361 /** 0362 */ 0363 bool supportsOrderByUnrelated(); 0364 0365 /** 0366 */ 0367 bool supportsExpressionsInOrderBy(); 0368 0369 /** Returns true if the data source and the driver can handle 0370 * open cursors (eg. ResultSets) across a commit, or false if 0371 * they are invalidated. 0372 */ 0373 bool supportsOpenCursorsAcrossCommit(); 0374 0375 0376 /** Returns true if the data source and the driver can handle 0377 * open cursors (eg. ResultSets) across a rollback, or false if 0378 * they are invalidated. 0379 */ 0380 bool supportsOpenCursorsAcrossRollback(); 0381 0382 0383 /** Returns true if the data source and the driver can handle 0384 * open statements across a commit, or false if 0385 * they are invalidated. 0386 */ 0387 bool supportsOpenStatementsAcrossCommit(); 0388 0389 /** Returns true if the data source and the driver can handle 0390 * open statements across a rollback, or false if 0391 * they are invalidated. 0392 */ 0393 bool supportsOpenStatementsAcrossRollback(); 0394 0395 /** Returns true if the data source supports the given 0396 * result set type. 0397 * @param type The type to check for 0398 * @see ResultSet 0399 */ 0400 bool supportsResultSetType(int type); 0401 0402 /** Returns true if the data source supports the given 0403 * result set concurrency for the given result set type. 0404 * @param type The type to check for. 0405 * @param concurrency The concurrency level to check for. 0406 * @see ResultSet 0407 */ 0408 bool supportsResultSetConcurrency(int type, int concurrency); 0409 0410 0411 /** Returns true if catalogs are supported in DML */ 0412 bool supportsCatalogsInDataManipulation(); 0413 0414 /** Returns true if catalogs are supported in procedure call statements */ 0415 bool supportsCatalogsInProcedureCalls(); 0416 0417 /** Returns true if catalogs are supported in CREATE/ALTER TABLE statements */ 0418 bool supportsCatalogsInTableDefinitions(); 0419 0420 /** Returns true if catalogs are supported in index definitions */ 0421 bool supportsCatalogsInIndexDefinitions(); 0422 0423 /** Returns true if catalogs are supported in privilege definition statements */ 0424 bool supportsCatalogsInPrivilegeDefinitions(); 0425 0426 0427 /** Returns true if schemas are supported in DML */ 0428 bool supportsSchemasInDataManipulation(); 0429 0430 /** Returns true if schemas are supported in procedure call statements */ 0431 bool supportsSchemasInProcedureCalls(); 0432 0433 /** Returns true if schemas are supported in CREATE/ALTER TABLE statements */ 0434 bool supportsSchemasInTableDefinitions(); 0435 0436 /** Returns true if schemas are supported in index definitions */ 0437 bool supportsSchemasInIndexDefinitions(); 0438 0439 /** Returns true if schemas are supported in privilege definition statements */ 0440 bool supportsSchemasInPrivilegeDefinitions(); 0441 0442 0443 /** Returns true if NULL plus a non-NULL value yields NULL. 0444 */ 0445 bool nullPlusNonNullIsNull(); 0446 0447 /** Returns true if the data source supports column aliasing, for example 0448 * SELECT COLUMN1 [AS] C1 FROM TABLE 0449 */ 0450 bool supportsColumnAliasing(); 0451 0452 /** Returns true if the CONVERT function is supported by the data source. 0453 */ 0454 bool supportsConvert(); 0455 0456 /** Returns true if CONVERT between fromType and toType is supported. 0457 */ 0458 bool supportsConvert(int fromType, int toType); 0459 0460 /** Returns true if ALTER TABLE with drop column is supported. 0461 */ 0462 bool supportsAlterTableWithDropColumn(); 0463 0464 /** Returns true if ALTER TABLE with add column is supported. 0465 */ 0466 bool supportsAlterTableWithAddColumn(); 0467 0468 /** Returns the extra characters beyond A-Z, a-z, 0-9 and _ that can 0469 * be used in unquoted identifier names. 0470 */ 0471 ODBCXX_STRING getExtraNameCharacters(); 0472 0473 /** Returns the string that can be used to escape wildcard characters. 0474 */ 0475 ODBCXX_STRING getSearchStringEscape(); 0476 0477 /** Returns a comma-separated list of all time and date functions supported. 0478 */ 0479 ODBCXX_STRING getTimeDateFunctions(); 0480 0481 /** Returns a comma-separated list of all system functions supported. 0482 */ 0483 ODBCXX_STRING getSystemFunctions(); 0484 0485 /** Returns a comma-separated list of all string functions supported. 0486 */ 0487 ODBCXX_STRING getStringFunctions(); 0488 0489 /** Returns a comma-separated list of all numeric functions supported. 0490 */ 0491 ODBCXX_STRING getNumericFunctions(); 0492 0493 /** Returns true if the escape character is supported in LIKE clauses. 0494 */ 0495 bool supportsLikeEscapeClause(); 0496 0497 /** Returns true if a query can return multiple ResultSets. 0498 */ 0499 bool supportsMultipleResultSets(); 0500 0501 /** Returns true if multiple transactions can be open at once 0502 * on different connections. 0503 */ 0504 bool supportsMultipleTransactions(); 0505 0506 /** Returns true if columns can be defined as non-nullable. 0507 */ 0508 bool supportsNonNullableColumns(); 0509 0510 /** Returns true if the data source supports ODBC minimum SQL grammar. 0511 */ 0512 bool supportsMinimumSQLGrammar(); 0513 0514 /** Returns true if the data source supports the core ODBC SQL grammar. 0515 */ 0516 bool supportsCoreSQLGrammar(); 0517 0518 /** Returns true if the data source supports the ODBC extended SQL grammar. 0519 */ 0520 bool supportsExtendedSQLGrammar(); 0521 0522 0523 /** Returns true if the data source supports the ANSI92 entry level 0524 * SQL grammar. 0525 */ 0526 bool supportsANSI92EntryLevelSQL(); 0527 0528 /** Returns true if the data source supports the ANSI92 intermediate level 0529 * SQL grammar. 0530 */ 0531 bool supportsANSI92IntermediateSQL(); 0532 0533 /** Returns true if the data source supports the full ANSI92 SQL grammar. 0534 */ 0535 bool supportsANSI92FullSQL(); 0536 0537 /** Checks if the data source supports positioned delete 0538 * 0539 * @return <code>true</code> if (<code>"DELETE WHERE CURRENT OF ..."</code>) 0540 * is supported 0541 */ 0542 bool supportsPositionedDelete(); 0543 0544 /** Checks if the data source supports positioned update 0545 * 0546 * @return <code>true</code> if (<code>"UPDATE ... WHERE CURRENT OF ..."</code>) 0547 * is supported 0548 */ 0549 bool supportsPositionedUpdate(); 0550 0551 /** Checks if the data source supports 0552 * 0553 * @return <code>true</code> if (<code>"SELECT ... FOR UPDATE"</code>) 0554 * is supported 0555 */ 0556 bool supportsSelectForUpdate(); 0557 0558 0559 /** Returns true if the data source supports the SQL Integrity 0560 * Enhancement Facility. 0561 */ 0562 bool supportsIntegrityEnhancementFacility(); 0563 0564 /** Whether the data source supports batch updates 0565 */ 0566 bool supportsBatchUpdates(); 0567 0568 /** Returns true if the data source supports subqueries in comparisons 0569 */ 0570 bool supportsSubqueriesInComparisons(); 0571 0572 /** Returns true if the data source supports subqueries in 0573 * <code>"EXISTS"</code> expressions. 0574 */ 0575 bool supportsSubqueriesInExists(); 0576 0577 /** Returns true if the data source supports subqueries in 0578 * <code>"IN"</code> expressions. 0579 */ 0580 bool supportsSubqueriesInIns(); 0581 0582 /** Returns true if the data source supports subqueries in 0583 * quantified expressions. 0584 */ 0585 bool supportsSubqueriesInQuantifieds(); 0586 0587 0588 /** Returns true if the data source supports correlated subqueries 0589 */ 0590 bool supportsCorrelatedSubqueries(); 0591 0592 /** Returns true if updated rows are available with their new 0593 * values in the ResultSet. 0594 * @param type The type of ResultSet of interest 0595 */ 0596 bool ownUpdatesAreVisible(int type); 0597 0598 /** Returns true if deleted rows dissapear from a ResultSet 0599 * @param type The type of ResultSet of interest 0600 */ 0601 bool ownDeletesAreVisible(int type); 0602 0603 /** Returns true if inserted rows become available in a ResultSet 0604 * @param type The type of ResultSet of interest 0605 */ 0606 bool ownInsertsAreVisible(int type); 0607 0608 /** Returns true if rows updated by others are visible 0609 * with their new values. 0610 * @param type The type of ResultSet of interest 0611 */ 0612 bool othersUpdatesAreVisible(int type); 0613 0614 /** Returns true if rows deleted by others disapear 0615 * from a ResultSet. 0616 * @param type The type of ResultSet of interest 0617 */ 0618 bool othersDeletesAreVisible(int type); 0619 0620 /** Returns true if rows inserted by others become available in 0621 * a ResultSet. 0622 * @param type The type of ResultSet of interest 0623 */ 0624 bool othersInsertsAreVisible(int type); 0625 0626 /** Returns true if a deleted row can be detected with 0627 * ResultSet::rowDeleted(). 0628 * @param type The type of ResultSet of interest 0629 */ 0630 bool deletesAreDetected(int type); 0631 0632 /** Returns true if an inserted row can be detected with 0633 * ResultSet::rowInserted(). 0634 * @param type The type of ResultSet of interest 0635 */ 0636 bool insertsAreDetected(int type); 0637 0638 /** Returns true if ResultSet::rowUpdated can determine whether 0639 * a row has been updated. 0640 * @param type The type of ResultSet of interest 0641 */ 0642 bool updatesAreDetected(int type); 0643 0644 0645 /** Returns the max number of hex characters allowed in an inline binary 0646 * literal. 0647 */ 0648 int getMaxBinaryLiteralLength(); 0649 0650 /** Returns the maximum length of an inline character string. 0651 */ 0652 int getMaxCharLiteralLength(); 0653 0654 /** Returns the maximum length of a column name. 0655 */ 0656 int getMaxColumnNameLength(); 0657 0658 /** Returns the maximum number of columns this data source can have in 0659 * a GROUP BY clause. 0660 */ 0661 int getMaxColumnsInGroupBy(); 0662 0663 /** Returns the maximum number of columns allowed in an index. 0664 */ 0665 int getMaxColumnsInIndex(); 0666 0667 /** Returns the maximum number of columns this data source can have in 0668 * an ORDER BY clause. 0669 */ 0670 int getMaxColumnsInOrderBy(); 0671 0672 /** Returns the maximum number of columns this data source can SELECT. 0673 */ 0674 int getMaxColumnsInSelect(); 0675 0676 /** Returns the maximum number of columns a table can consist of. 0677 */ 0678 int getMaxColumnsInTable(); 0679 0680 /** Returns the maximum length of a cursor name. 0681 */ 0682 int getMaxCursorNameLength(); 0683 0684 /** Returns the maximum length of an index in bytes. 0685 */ 0686 int getMaxIndexLength(); 0687 0688 /** Returns the maximum length of a schema name. 0689 */ 0690 int getMaxSchemaNameLength(); 0691 0692 /** Returns the maximum length of a procedure name. 0693 */ 0694 int getMaxProcedureNameLength(); 0695 0696 /** Returns the maximum length of a catalog name. 0697 */ 0698 int getMaxCatalogNameLength(); 0699 0700 /** Returns the maximum size of a row in bytes. 0701 */ 0702 int getMaxRowSize(); 0703 0704 /** Returns true if the value returned by getMaxRowSize() includes 0705 * BLOBs. 0706 */ 0707 bool doesMaxRowSizeIncludeBlobs(); 0708 0709 0710 /** Returns the maximum length of a statement (query). 0711 */ 0712 int getMaxStatementLength(); 0713 0714 /** Returns the maximum length of a table name. 0715 */ 0716 int getMaxTableNameLength(); 0717 0718 /** Returns the maximum number of tables that can be joined at once. 0719 * @return zero if unknown. 0720 */ 0721 int getMaxTablesInSelect(); 0722 0723 /** Returns the maximum length of a username. 0724 */ 0725 int getMaxUserNameLength(); 0726 0727 /** Returns the maximum number of connections we can have open 0728 * to this data source. 0729 */ 0730 int getMaxConnections(); 0731 0732 /** Returns the maximim number of statements that can be open 0733 * on this connection. 0734 */ 0735 int getMaxStatements(); 0736 0737 0738 /** Returns true if the data source supports case sensitive 0739 * mixed case identifiers. 0740 */ 0741 bool supportsMixedCaseIdentifiers(); 0742 0743 /** Returns true if the data source supports case sensitive 0744 * mixed case quoted identifiers. 0745 */ 0746 bool supportsMixedCaseQuotedIdentifiers(); 0747 0748 /** Returns true if the data source supports some form of 0749 * stored procedures. 0750 */ 0751 bool supportsStoredProcedures(); 0752 0753 0754 /** Returns true if the data source supports the 0755 * GROUP BY clause. 0756 */ 0757 bool supportsGroupBy(); 0758 0759 /** Returns true if the columns in a GROUP BY clause are independent 0760 * of the selected ones. 0761 */ 0762 bool supportsGroupByUnrelated(); 0763 0764 /** Returns true if the columns in a GROUP BY don't have to be 0765 * selected. 0766 */ 0767 bool supportsGroupByBeyondSelect(); 0768 0769 0770 /** Returns true if the data source supports UNION joins. 0771 */ 0772 bool supportsUnion(); 0773 0774 /** Returns true if the data source supports UNION ALL joins. 0775 */ 0776 bool supportsUnionAll(); 0777 0778 /** Returns true if the data source supports some form of 0779 * outer joins. 0780 */ 0781 bool supportsOuterJoins(); 0782 0783 /** Returns true if the data source fully supports outer joins. 0784 */ 0785 bool supportsFullOuterJoins(); 0786 0787 /** Returns true if the data source only supports certain types of 0788 * outer joins. 0789 */ 0790 bool supportsLimitedOuterJoins(); 0791 0792 /** Returns true if the data source uses a file for each table */ 0793 bool usesLocalFilePerTable(); 0794 0795 /** Returns true if the data source uses local files */ 0796 bool usesLocalFiles(); 0797 0798 /** Returns true if NULL values are sorted first, regardless of 0799 * the sort order. 0800 */ 0801 bool nullsAreSortedAtStart(); 0802 0803 /** Returns true if NULL values are sorted last, regardless of 0804 * the sort order. 0805 */ 0806 bool nullsAreSortedAtEnd(); 0807 0808 /** Returns true if NULL values are sorted high. 0809 */ 0810 bool nullsAreSortedHigh(); 0811 0812 /** Returns true if NULL values are sorted low. 0813 */ 0814 bool nullsAreSortedLow(); 0815 0816 /** Returns true if all procedures returned by getProcedures() are callable 0817 * by the current user. 0818 */ 0819 bool allProceduresAreCallable(); 0820 0821 /** Returns true if all tables returned by getTables() are selectable by 0822 * the current user. 0823 */ 0824 bool allTablesAreSelectable(); 0825 0826 /** Returns true if the data source or the current connection is in 0827 * read-only mode. 0828 */ 0829 bool isReadOnly(); 0830 0831 /** Returns true if the data source treats identifiers as case 0832 * insensitive and stores them in lower case. 0833 */ 0834 bool storesLowerCaseIdentifiers(); 0835 0836 /** Returns true if the data source treats quoted identifiers as case 0837 * insensitive and stores them in lower case. 0838 */ 0839 bool storesLowerCaseQuotedIdentifiers(); 0840 0841 /** Returns true if the data source treats identifiers as case 0842 * insensitive and stores them in mixed case. 0843 */ 0844 bool storesMixedCaseIdentifiers(); 0845 0846 /** Returns true if the data source treats quoted identifiers as case 0847 * insensitive and stores them in mixed case. 0848 */ 0849 bool storesMixedCaseQuotedIdentifiers(); 0850 0851 /** Returns true if the data source treats identifiers as case 0852 * insensitive and stores them in upper case. 0853 */ 0854 bool storesUpperCaseIdentifiers(); 0855 0856 /** Returns true if the data source treats quoted identifiers as case 0857 * insensitive and stores them in upper case. 0858 */ 0859 bool storesUpperCaseQuotedIdentifiers(); 0860 0861 0862 /** Fetches a list of data types supported by this data source. 0863 * 0864 * The returned ResultSet is ordered by <code>DATA_TYPE</code> and then 0865 * by how closely the type maps to the corresponding ODBC SQL type. 0866 * It contains the following columns: 0867 * <ol> 0868 * <li><b>TYPE_NAME</b> - string - native type name 0869 * <li><b>DATA_TYPE</b> - short - SQL data type from Types 0870 * <li><b>COLUMN_SIZE</b> - int - maximum precision 0871 * <li><b>LITERAL_PREFIX</b> - string - prefix used to quote a literal. 0872 * Can be <code>NULL</code>. 0873 * <li><b>LITERAL_SUFFIX</b> - string - suffix used to quote a literal. 0874 * Can be <code>NULL</code>. 0875 * <li><b>CREATE_PARAMS</b> - string - comma separated possible list of 0876 * parameters to creating a column of this type 0877 * <li><b>NULLABLE</b> - short - whether this type can contain <code>NULL</code>s: 0878 * <ul> 0879 * <li><code>typeNoNulls</code> - no 0880 * <li><code>typeNullable</code> - yes, can be nullable 0881 * <li><code>typeNullableUnknown</code> - nobody knows 0882 * </ul> 0883 * <li><b>CASE_SENSITIVE</b> - bool - whether this type is case sensitive 0884 * <li><b>SEARCHABLE</b> - bool - whether this type can be searched, eg 0885 * used in <code>WHERE</code>-clauses: 0886 * <ul> 0887 * <li><code>typePredNone</code> - no 0888 * <li><code>typePredChar</code> - yes, but only with a <code>LIKE</code> 0889 * predicate 0890 * <li><code>typePredBasic</code> - yes, except in a <code>LIKE</code> 0891 * predicate 0892 * <li><code>typeSearchable</code> - yes 0893 * </ul> 0894 * <li><b>UNSIGNED_ATTRIBUTE</b> - bool - <code>true</code> if this type is unsigned 0895 * <li><b>FIXED_PREC_SCALE</b> - bool - whether this type has predefined fixed 0896 * precision and scale (eg is useful for money) 0897 * <li><b>AUTO_UNIQUE_VALUE</b> - bool - whether this type can be used for an 0898 * autoincrementing value. <code>NULL</code> if not applicable. 0899 * <li><b>LOCAL_TYPE_NAME</b> - string - localized native type name. Can be 0900 * <code>NULL</code>. 0901 * <li><b>MINIMUM_SCALE</b> - short - minimum supported scale, if applicable 0902 * <li><b>MAXIMUM_SCALE</b> - short - maximum supported scale, if applicable 0903 * <li><b>SQL_DATA_TYPE</b> - short - unused 0904 * <li><b>SQL_DATETIME_SUB</b> - short - unused 0905 * <li><b>NUM_PREC_RADIX</b> - int - radix, if applicable 0906 * </ol> 0907 */ 0908 ResultSet* getTypeInfo(); 0909 0910 /** Fetches the available columns in a catalog. 0911 * 0912 * The returned ResultSet has the following columns: 0913 * <ol> 0914 * <li><b>TABLE_CAT</b> - string - table catalog (can be NULL) 0915 * <li><b>TABLE_SCHEM</b> - string - table schema (can be NULL) 0916 * <li><b>TABLE_NAME</b> - string - table name 0917 * <li><b>COLUMN_NAME</b> - string - column name 0918 * <li><b>COLUMN_TYPE</b> - short - see Types 0919 * <li><b>TYPE_NAME</b> - string - the name of the type. Data source 0920 * dependent. 0921 * <li><b>COLUMN_SIZE</b> - int - column size. For character and date 0922 * types, this is the maximum number of characters. For numeric types 0923 * this is the precision. 0924 * <li><b>BUFFER_LENGTH</b> - not used 0925 * <li><b>DECIMAL_DIGITS</b> - int - the number of fractional digits. 0926 * <li><b>NUM_PREC_RADIX</b> - int - radix 0927 * <li><b>NULLABLE</b> - int - whether the column allows NULLs 0928 * <ul> 0929 * <li><code>columnNoNulls</code> - might not allow NULLs 0930 * <li><code>columnNullable</code> - definitely allows NULLs 0931 * <li><code>columnNullableUnknown</code> - nullability is unknown 0932 * </ul> 0933 * <li><b>REMARKS</b> - string - comments on the column (can be NULL) 0934 * <li><b>COLUMN_DEF</b> - string - default value (can be NULL) 0935 * <li><b>SQL_DATA_TYPE</b> - short - 0936 * <li><b>SQL_DATETIME_SUB</b> - short - 0937 * <li><b>CHAR_OCTET_LENGTH</b> - int - for character data types the maximum 0938 * number of bytes in the column 0939 * <li><b>ORDINAL_POSITION</b> - int - 1-based index in the table 0940 * <li><b>IS_NULLABLE</b> - string - <code>"NO"</code> means in no way 0941 * nullable, <code>"YES"</code> means possibly nullable. Empty string means 0942 * nobody knows. 0943 * </ol> 0944 */ 0945 ResultSet* getColumns(const ODBCXX_STRING& catalog, 0946 const ODBCXX_STRING& schemaPattern, 0947 const ODBCXX_STRING& tableNamePattern, 0948 const ODBCXX_STRING& columnNamePattern); 0949 0950 0951 /** Fetches the available tables in the data source. 0952 * The returned ResultSet has the following columns: 0953 * <ol> 0954 * <li><b>TABLE_CAT</b> - string - table catalog (can be NULL) 0955 * <li><b>TABLE_SCHEM</b> - string - table schema (can be NULL) 0956 * <li><b>TABLE_NAME</b> - string - table name 0957 * <li><b>TABLE_TYPE</b> - string - table type 0958 * <li><b>REMARKS</b> - string - comments on the table 0959 * </ol> 0960 * @param catalog the catalog name 0961 * @param schemaPattern schema name search pattern 0962 * @param tableNamePattern table name search pattern 0963 * @param types a list of table types. An empty list returns all table types. 0964 */ 0965 ResultSet* getTables(const ODBCXX_STRING& catalog, 0966 const ODBCXX_STRING& schemaPattern, 0967 const ODBCXX_STRING& tableNamePattern, 0968 const std::vector<ODBCXX_STRING>& types); 0969 0970 /** Fetches a list of access rights for tables in a catalog. 0971 * 0972 * A table privilege applies to one or more columns in a table. 0973 * Do not assume that this privilege is valid for all columns. 0974 * 0975 * The returned ResultSet is ordered by 0976 * <code>TABLE_CAT</code>, <code>TABLE_SCHEM</code>, <code>TABLE_NAME</code> 0977 * and <code>PRIVILEGE</code>. It contains the following columns: 0978 * <ol> 0979 * <li><b>TABLE_CAT</b> - string - table catalog (can be <code>NULL</code>) 0980 * <li><b>TABLE_SCHEM</b> - string - table schema (can be <code>NULL</code>) 0981 * <li><b>TABLE_NAME</b> - string - table name 0982 * <li><b>GRANTOR</b> - string - grantor (can be <code>NULL</code>). If 0983 * <code>GRANTEE</code> owns the object, <code>GRANTOR</code> is 0984 * <code>"SYSTEM"</code>. 0985 * <li><b>GRANTEE</b> - string - grantee 0986 * <li><b>PRIVILEGE</b> - string - one of <code>"SELECT"</code>, 0987 * <code>"INSERT"</code>, <code>"UPDATE"</code>, <code>"DELETE"</code>, 0988 * <code>"REFERENCES"</code> or a data source specific value 0989 * <li><b>IS_GRANTABLE</b> - string - <code>"YES"</code> if <code>GRANTEE</code> 0990 * can grant this privilege to other users. <code>"NO"</code> if not. 0991 * <code>NULL</code> if unknown. 0992 * </ol> 0993 */ 0994 ResultSet* getTablePrivileges(const ODBCXX_STRING& catalog, 0995 const ODBCXX_STRING& schemaPattern, 0996 const ODBCXX_STRING& tableNamePattern); 0997 0998 0999 /** Fetches a list of access rights for a table's columns. 1000 * 1001 * The returned ResultSet is ordered by 1002 * <code>COLUMN_NAME</code> and <code>PRIVILEGE</code>. 1003 * It contains the following columns: 1004 * <ol> 1005 * <li><b>TABLE_CAT</b> - string - table catalog (can be <code>NULL</code>) 1006 * <li><b>TABLE_SCHEM</b> - string - table schema (can be <code>NULL</code>) 1007 * <li><b>TABLE_NAME</b> - string - table name 1008 * <li><b>COLUMN_NAME</b> - string - column name 1009 * <li><b>GRANTOR</b> - string - grantor (can be <code>NULL</code>). If 1010 * <code>GRANTEE</code> owns the object, <code>GRANTOR</code> is 1011 * <code>"SYSTEM"</code>. 1012 * <li><b>GRANTEE</b> - string - grantee 1013 * <li><b>PRIVILEGE</b> - string - one of <code>"SELECT"</code>, 1014 * <code>"INSERT"</code>, <code>"UPDATE"</code>, <code>"DELETE"</code>, 1015 * <code>"REFERENCES"</code> or a data source specific value 1016 * <li><b>IS_GRANTABLE</b> - string - <code>"YES"</code> if <code>GRANTEE</code> 1017 * can grant this privilege to other users. <code>"NO"</code> if not. 1018 * <code>NULL</code> if unknown. 1019 * </ol> 1020 */ 1021 ResultSet* getColumnPrivileges(const ODBCXX_STRING& catalog, 1022 const ODBCXX_STRING& schema, 1023 const ODBCXX_STRING& table, 1024 const ODBCXX_STRING& columnNamePattern); 1025 1026 /** Fetches a list of primary keys for a table. 1027 * 1028 * The returned ResultSet is ordered by 1029 * <code>TABLE_CAT</code>, <code>TABLE_SCHEM</code>, <code>TABLE_NAME</code> 1030 * and <code>KEY_SEQ</code>. It contains the following columns: 1031 * <ol> 1032 * <li><b>TABLE_CAT</b> - string - table catalog (can be <code>NULL</code>) 1033 * <li><b>TABLE_SCHEM</b> - string - table schema (can be <code>NULL</code>) 1034 * <li><b>TABLE_NAME</b> - string - table name 1035 * <li><b>COLUMN_NAME</b> - string - column name 1036 * <li><b>KEY_SEQ</b> - string - sequence number in primary key (1-based) 1037 * <li><b>PK_NAME</b> - string - primary key (constraint) name. 1038 * Can be <code>NULL</code>. 1039 * </ol> 1040 */ 1041 ResultSet* getPrimaryKeys(const ODBCXX_STRING& catalog, 1042 const ODBCXX_STRING& schema, 1043 const ODBCXX_STRING& table); 1044 1045 1046 /** Fetches a list of indices and statistics for a table. 1047 * 1048 * The returned ResultSet is ordered by 1049 * <code>NON_UNIQUE</code>, <code>TYPE</code>, <code>INDEX_QUALIFIER</code>, 1050 * <code>INDEX_NAME</code> and <code>ORDINAL_POSITION</code>. 1051 * It contains the following columns: 1052 * <ol> 1053 * <li><b>TABLE_CAT</b> - string - table catalog (can be <code>NULL</code>) 1054 * <li><b>TABLE_SCHEM</b> - string - table schema (can be <code>NULL</code>) 1055 * <li><b>TABLE_NAME</b> - string - table name 1056 * <li><b>NON_UNIQUE</b> - bool - <code>true</code> if index values can 1057 * be non-unique. <code>NULL</code> if <code>TYPE</code> is 1058 * <code>tableIndexStatistic</code> 1059 * <li><b>INDEX_QUALIFIER</b> - string - index catalog, <code>NULL</code> 1060 * if <code>TYPE</code> is <code>tableIndexStatistic</code> 1061 * <li><b>INDEX_NAME</b> - string - index name, <code>NULL</code> 1062 * if <code>TYPE</code> is <code>tableIndexStatistic</code> 1063 * <li><b>TYPE</b> - short - index type: 1064 * <ul> 1065 * <li><code>tableIndexStatistic</code> - no real index - a statistic for the table 1066 * <li><code>tableIndexClustered</code> - this index is clustered 1067 * <li><code>tableIndexHashed</code> - this index is hashed 1068 * <li><code>tableIndexOther</code> - this is some other kind of index 1069 * </ul> 1070 * <li><b>ORDINAL_POSITION</b> - short - column sequence number in index (1-based). 1071 * <code>NULL</code> if <code>TYPE</code> is <code>tableIndexStatistic</code>. 1072 * <li><b>COLUMN_NAME</b> - string - column name. 1073 * <code>NULL</code> if <code>TYPE</code> is <code>tableIndexStatistic</code>. 1074 * <li><b>ASC_OR_DESC</b> - string - <code>"A"</code> for ascending, 1075 * <code>"D"</code> for descending index. <code>NULL</code> if <code>TYPE</code> 1076 * is <code>tableIndexStatistic</code>. 1077 * <li><b>CARDINALITY</b> - int - If <code>TYPE</code> is 1078 * <code>tableIndexStatistic</code>, the number of rows in the 1079 * table. Otherwise, the number of unique values in the index. 1080 * <li><b>PAGES</b> - int - Number of pages used for the table if 1081 * <code>TYPE</code> is <code>tableIndexStatistic</code>. Otherwise 1082 * the number of pages used for the index. 1083 * <li><b>FILTER_CONDITION</b> - string - filter condition (if any) 1084 * </ol> 1085 * @param catalog the catalog name 1086 * @param schema the schema name 1087 * @param table the table name 1088 * @param unique whether only unique indices should be looked at 1089 * @param approximate whether only accurate values should be retrieved 1090 */ 1091 ResultSet* getIndexInfo(const ODBCXX_STRING& catalog, 1092 const ODBCXX_STRING& schema, 1093 const ODBCXX_STRING& table, 1094 bool unique, bool approximate); 1095 1096 /** Figures out in which way a foreign key table references a 1097 * primary key table. Returns it's findings in a ResultSet, ordered 1098 * by <code>FKTABLE_CAT</code>, <code>FKTABLE_SCHEM</code>, 1099 * <code>FKTABLE_NAME</code> and <code>KEY_SEQ</code>. The 1100 * ResultSet contains the following columns: 1101 * <ol> 1102 * <li><b>PKTABLE_CAT</b> - string - primary key table catalog 1103 * <li><b>PKTABLE_SCHEM</b> - string - primary key table schema 1104 * <li><b>PKTABLE_NAME</b> - string - primary key table name 1105 * <li><b>PKCOLUMN_NAME</b> - string - primary key column name 1106 * <li><b>FKTABLE_CAT</b> - string - foreign key table catalog 1107 * <li><b>FKTABLE_SCHEM</b> - string - foreign key table schema 1108 * <li><b>FKTABLE_NAME</b> - string - foreign key table name 1109 * <li><b>FKCOLUMN_NAME</b> - string - foreign key column name 1110 * <li><b>KEY_SEQ</b> - short - column sequence number in key (1-based) 1111 * <li><b>UPDATE_RULE</b> - short - what happens to the foreign key 1112 * when the primary is updated: 1113 * <ul> 1114 * <li><code>importedKeyNoAction</code> - nothing happends since 1115 * the primary key can not be updated 1116 * <li><code>importedKeyCascade</code> - change imported key to 1117 * match the primary key 1118 * <li><code>importedKeySetNull</code> - update the imported key to 1119 * <code>NULL</code> 1120 * <li><code>importedKeySetDefault</code> - update the impored key to 1121 * it's default value 1122 * <li><code>importedKeyRestrict</code> - same as 1123 * <code>importedKeyNoAction</code> 1124 * </ul> 1125 * <li><b>DELETE_RULE</b> - short - what happens to the foreign key 1126 * when the primary is deleted: 1127 * <ul> 1128 * <li><code>importedKeyNoAction</code> - nothing happends since 1129 * the primary key can not be deleted 1130 * <li><code>importedKeyCascade</code> - imported key is deleted as well 1131 * <li><code>importedKeySetNull</code> - imported key is set 1132 * to <code>NULL</code> 1133 * <li><code>importedKeySetDefault</code> - imported key is set to it's 1134 * default value 1135 * <li><code>importedKeyRestrict</code> - same as 1136 * <code>importedKeyNoAction</code> 1137 * </ul> 1138 * </ol> 1139 */ 1140 ResultSet* getCrossReference(const ODBCXX_STRING& primaryCatalog, 1141 const ODBCXX_STRING& primarySchema, 1142 const ODBCXX_STRING& primaryTable, 1143 const ODBCXX_STRING& foreignCatalog, 1144 const ODBCXX_STRING& foreignSchema, 1145 const ODBCXX_STRING& foreignTable); 1146 1147 /** Fetches a list of columns that are foreign keys to other tables' 1148 * primary keys. 1149 * 1150 * The returned ResultSet is identical to the one 1151 * returned by getCrossReference(), except it's ordered by 1152 * <code>PKTABLE_CAT</code>, <code>PKTABLE_SCHEM</code>, 1153 * <code>PKTABLE_NAME</code> and <code>KEY_SEQ</code>. 1154 */ 1155 ResultSet* getImportedKeys(const ODBCXX_STRING& catalog, 1156 const ODBCXX_STRING& schema, 1157 const ODBCXX_STRING& table) { 1158 return this->getCrossReference("","","",catalog,schema,table); 1159 } 1160 1161 /** Fetches a list of columns that reference a table's primary 1162 * keys. 1163 * 1164 * The returned ResultSet is identical to the one returned 1165 * by getCrossReference(). 1166 */ 1167 ResultSet* getExportedKeys(const ODBCXX_STRING& catalog, 1168 const ODBCXX_STRING& schema, 1169 const ODBCXX_STRING& table) { 1170 return this->getCrossReference(catalog,schema,table,"","",""); 1171 } 1172 1173 /** Returns available procedures in a catalog. 1174 * 1175 * The returned ResultSet is ordered by 1176 * <code>PROCEDURE_CAT</code>, <code>PROCEDURE_SCHEM</code> and 1177 * <code>PROCEDURE_NAME</code>. It contains the following columns: 1178 * <ol> 1179 * <li><b>PROCEDURE_CAT</b> - string - the procedure catalog 1180 * <li><b>PROCEDURE_SCHEM</b> - string - the procedure schema 1181 * <li><b>PROCEDURE_NAME</b> - string - the procedure name 1182 * <li><b>NUM_INPUT_PARAMS</b> - reserved for future use 1183 * <li><b>NUM_OUTPUT_PARAMS</b> - reserved for future use 1184 * <li><b>NUM_RESULT_SETS</b> - reserved for future use 1185 * <li><b>REMARKS</b> - string - comments on the procedure 1186 * <li><b>PROCEDURE_TYPE</b> - short - the procedure type: 1187 * <ul> 1188 * <li><code>procedureResultUnknown</code> - can possibly return 1189 * a result, but nobody is sure 1190 * <li><code>procedureNoResult</code> - does not return a result 1191 * <li><code>procedureReturnsResult</code> - returns a result 1192 * </ul> 1193 * </ol> 1194 */ 1195 ResultSet* getProcedures(const ODBCXX_STRING& catalog, 1196 const ODBCXX_STRING& schemaPattern, 1197 const ODBCXX_STRING& procedureNamePattern); 1198 1199 /** Returns available procedure columns in a catalog. 1200 * 1201 * The returned ResultSet is ordered by 1202 * <code>PROCEDURE_CAT</code>, <code>PROCEDURE_SCHEM</code>, 1203 * <code>PROCEDURE_NAME</code> and <code>COLUMN_NAME</code>. 1204 * It contains the following columns: 1205 * <ol> 1206 * <li><b>PROCEDURE_CAT</b> - string - the procedure catalog 1207 * <li><b>PROCEDURE_SCHEM</b> - string - the procedure schema 1208 * <li><b>PROCEDURE_NAME</b> - string - the procedure name 1209 * <li><b>COLUMN_NAME</b> - string - the column name 1210 * <li><b>COLUMN_TYPE</b> - short - the column type 1211 * <ul> 1212 * <li><code>procedureColumnUnknown</code> - beats the driver 1213 * <li><code>procedureColumnIn</code> - <code>IN</code> parameter 1214 * <li><code>procedureColumnInOut</code> - <code>IN OUT</code> parameter 1215 * <li><code>procedureColumnOut</code> - <code>OUT</code> parameter 1216 * <li><code>procedureColumnReturn</code> - procedure return value 1217 * (eg. this procedure is actually a function) 1218 * <li><code>procedureColumnResult</code> - this column is part of a 1219 * ResultSet this procedure returns 1220 * </ul> 1221 * <li><b>DATA_TYPE</b> - int - SQL type of the column 1222 * <li><b>TYPE_NAME</b> - string - native type name 1223 * <li><b>COLUMN_SIZE</b> - int - the precision of the column 1224 * <li><b>BUFFER_LENGTH</b> - int - nothing of interest 1225 * <li><b>DECIMAL_DIGITS</b> - short - scale, if applicable 1226 * <li><b>NUM_PREC_RADIX</b> - short - radix, if applicable 1227 * <li><b>NULLABLE</b> - short - whether the column is nullable 1228 * <ul> 1229 * <li><code>procedureNoNulls</code> - not nullable 1230 * <li><code>procedureNullable</code> - nullable 1231 * <li><code>procedureNullableUnknown</code> - nobody knows 1232 * </ul> 1233 * <li><b>REMARKS</b> - string - comments on the column 1234 * </ol> 1235 * 1236 * Note: more columns can be returned depending on the driver. 1237 */ 1238 ResultSet* getProcedureColumns(const ODBCXX_STRING& catalog, 1239 const ODBCXX_STRING& schemaPattern, 1240 const ODBCXX_STRING& procedureNamePattern, 1241 const ODBCXX_STRING& columnNamePattern); 1242 1243 1244 /** Returns the optimal set of columns that identifies a row. 1245 * 1246 * The returned ResultSet is ordered by <code>SCOPE</code> and has 1247 * the following columns: 1248 * <ol> 1249 * <li><b>SCOPE</b> - short - scope of this result: 1250 * <ul> 1251 * <li><code>bestRowTemporary</code> - temporary, only while 1252 * a ResultSet is using the row 1253 * <li><code>bestRowTransaction</code> - valid until the 1254 * current transaction ends 1255 * <li><code>bestRowSession</code> - valid through the whole 1256 * session - until the connection is closed 1257 * </ul> 1258 * <li><b>COLUMN_NAME</b> - string - the column name 1259 * <li><b>DATA_TYPE</b> - short - the type of the column from Types 1260 * <li><b>TYPE_NAME</b> - string - native type name (data source dependent) 1261 * <li><b>COLUMN_SIZE</b> - int - the size (precision) of the column. 1262 * <li><b>BUFFER_LENGTH</b> - int - unused 1263 * <li><b>DECIMAL_DIGITS</b> - short - scale if applicable. 1264 * Can be <code>NULL</code>. 1265 * <li><b>PSEUDO_COLUMN</b> - short - whether this is a pseudo column: 1266 * <ul> 1267 * <li><code>bestRowUnknown</code> - it is unknown whether this is a pseudo 1268 * column 1269 * <li><code>bestRowNotPseudo</code> - it is definitely not a pseudo column 1270 * <li><code>bestRowPseudo</code> - it is definitely a pseudo column 1271 * </ul> 1272 * </ol> 1273 * @param catalog the catalog name 1274 * @param schema the schema name 1275 * @param table the table name 1276 * @param scope the scope of interest, same values as the <b>SCOPE</b> column. 1277 * @param nullable whether nullable columns should be included 1278 */ 1279 ResultSet* getBestRowIdentifier(const ODBCXX_STRING& catalog, 1280 const ODBCXX_STRING& schema, 1281 const ODBCXX_STRING& table, 1282 int scope, 1283 bool nullable); 1284 1285 /** Returns a list of columns for a table that are automatically updated 1286 * when anything in a row is updated. 1287 * 1288 * The returned ResultSet has the following unordered columns: 1289 * <ol> 1290 * <li><b>SCOPE</b> - short - unused 1291 * <li><b>COLUMN_NAME</b> - string - the column name 1292 * <li><b>DATA_TYPE</b> - short - the type of the column from Types 1293 * <li><b>TYPE_NAME</b> - string - native type name (data source dependent) 1294 * <li><b>COLUMN_SIZE</b> - int - the size (precision) of the column. 1295 * <li><b>BUFFER_LENGTH</b> - int - unused 1296 * <li><b>DECIMAL_DIGITS</b> - short - scale if applicable. 1297 * Can be <code>NULL</code>. 1298 * <li><b>PSEUDO_COLUMN</b> - short - whether this is a pseudo column: 1299 * <ul> 1300 * <li><code>versionColumnUnknown</code> - it is unknown whether this is a pseudo 1301 * column 1302 * <li><code>versionColumnNotPseudo</code> - it is definitely not a pseudo column 1303 * <li><code>versionColumnPseudo</code> - it is definitely a pseudo column 1304 * </ul> 1305 * </ol> 1306 */ 1307 ResultSet* getVersionColumns(const ODBCXX_STRING& catalog, 1308 const ODBCXX_STRING& schema, 1309 const ODBCXX_STRING& table); 1310 1311 1312 1313 /** Fetches the table types the database supports. 1314 * 1315 * The returned ResultSet is the same as with getTables(), except 1316 * that all columns but <b>TABLE_TYPE</b> contain NULL values. 1317 */ 1318 ResultSet* getTableTypes(); 1319 1320 /** Returns a list of available schemas in the database. 1321 * 1322 * The returned ResultSet is the same as with getTables(), except 1323 * that all columns but <b>TABLE_SCHEM</b> contain NULL values. 1324 */ 1325 ResultSet* getSchemas(); 1326 1327 /** Returns a list of available catalogs in the database. 1328 * 1329 * The returned ResultSet is the same as with getTables(), except 1330 * that all columns but <b>TABLE_CAT</b> are NULL values. 1331 */ 1332 ResultSet* getCatalogs(); 1333 }; 1334 1335 1336 }; // namespace odbc 1337 1338 1339 #endif // __ODBCXX_DATABASEMETADATA_H
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|