CODBCStmt.GetTablesmethod
Returns the list of table, catalog, or schema names, and table types, stored in a specific data source.
Syntax
FUNCTION GetTables (BYREF wszCatalogName AS WSTRING, BYVAL CatalogNameLength AS SQLSMALLINT, BYREF wszSchemaName AS WSTRING, BYVAL SchemaNameLength AS SQLSMALLINT, BYREF wszTableName AS WSTRING, BYVAL TableNameLength AS SQLSMALLINT, BYREF wszTableType AS WSTRING, BYVAL TableTypeLength AS SQLSMALLINT) AS SQLRETURN
Parameters
| Name | Description | |
|---|---|---|
wszCatalogName | Catalog name. The wszCatalogName argument accepts search patterns if the SQL_ODBC_VERSION environment attribute is SQL_OV_ODBC3; it does not accept search patterns if SQL_OV_ODBC2 is set. If a driver supports catalogs for some tables but not for others, such as when a driver retrieves data from different DBMSs, an empty string ("") indicates those tables that do not have catalogs. | |
CatalogNameLength | Length of wszCatalogName. | |
wszSchemaName | String search pattern for schema names. If a driver supports schemas for some tables but not for others, such as when the driver retrieves data from different DBMSs, an empty string ("") indicates those tables that do not have schemas. | |
SchemaNameLength | Length of wszSchemaName. | |
wszTableName | String search pattern for table names. | |
TableNameLength | Length of wszTableName. | |
wszTableType | List of table types to match. Table type names: 'TABLE', 'VIEW', 'SYSTEM TABLE', 'GLOBAL TEMPORARY', 'LOCAL TEMPORARY', 'ALIAS', 'SYNONIM', or a data source-specific type name. The meaning od 'ALIAS' and 'SYNONIM' are driver specific. Pass an empty string ("") to retrieve all table types. If wszTableTypes is not an empty string, it must contain a list of comma-separated values for the types of interest; each value may be enclosed in single quotation marks (') or unquoted — for example, 'TABLE', 'VIEW' or TABLE, VIEW. An application should always specify the table type in uppercase; the driver should convert the table type to whatever case is needed by the data source. If the data source does not support a specified table type, Tables does not return any results for that type. Note that the SQL_ATTR_METADATA_ID statement attribute has no effect upon the wszTableTypes argument. wszTableTypes is a value list argument, no matter what the setting of SQL_ATTR_METADATA_ID. | |
TableTypeLength | Length of wszTableType. |
Return value
SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_STILL_EXECUTING, SQL_ERROR, or SQL_INVALID_HANDLE.
Description
Returns the list of table, catalog, or schema names, and table types, stored in a specific data source.
Reference
- Include file
CODBCStmt.inc - Defined in AfxNova/COdbcStmt.inc:1989
- Documented in Databases/ODBC Classes/CODBCStmt Class.md
- Topic: CODBCStmt Class