ODBCTables

(Engine-Level Function)

Description: Retrieves a list of the tables present in an ODBC-compliant database and returns it as a dynamically allocated array.
Returns: Array
Usage: Script Only.
Function Groups: Database and Data Source,  ODBC
Related to: ODBC | ODBCConfigureData | ODBCConnect | ODBCDisconnect | ODBCSources | ODBCStatus | TODBC | TODBCConnect | TODBCDisconnect
Format: ODBCTables(DB [, Search, TableType, Timeout, MaxResults, HasMore])
Parameters:  
DB
Required. An ODBC value for the ODBC database as returned by ODBCConnect.
Search
Optional. Any text string indicating the pattern to match for table names.
If this parameter is omitted, the search pattern defaults to "%", where the percent sign is the SQL wildcard (i.e. all table names are returned).
TableType
Optional. List of table types to match. Parameters include the following:
"TABLE", "VIEW", "SYSTEM TABLE",..., or a data source-specific type name.
Timeout
Optional. Sets the period (in seconds) that the driver will wait for the request to complete.
The default value of "0" indicates that there is no timeout. See comments.
MaxResults
Optional. Specify the maximum number of tables to be returned.
If this is Invalid or less than 0, there is no limit. See comments.
HasMore
Optional. If the request would return more than MaxResults results, this output parameter gets set to TRUE. Otherwise it will be set to FALSE.
Comments:

If TableType 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. If the data source does not support a specified table type, no results will be returned for that type.

ODBCTables will stall the calling thread while it executes. Consider calling it from a separate script thread that doesn't need to remain responsive.

For Timeout, Please note:

Not all ODBC drivers support the optional Timeout parameter. (In particular, the Microsoft Access (.mdb) driver). If the driver does not support the option, it will have no effect.

Example:

If 1 Next;
[
  tables = ODBCTables(dBase, "Analog%");
]

This will obtain the list of all tables in the database beginning with the string "Analog".