Help Center

CODBCStmt.GetTablesmethod

Returns the list of table, catalog, or schema names, and table types, stored in a specific data source.

DatabasesmethodCODBCStmt.incdocumented

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

NameDescription
wszCatalogNameCatalog 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.
CatalogNameLengthLength of wszCatalogName.
wszSchemaNameString 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.
SchemaNameLengthLength of wszSchemaName.
wszTableNameString search pattern for table names.
TableNameLengthLength of wszTableName.
wszTableTypeList 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.
TableTypeLengthLength 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