Returns a list of objects stored in the database.
sp_tables [table_name] [, table_owner] [, table_qualifier] [, table_type]
is the name of the table. Use the wildcard character to request information about more than one table.
is the owner of the table. Use the wildcard character to request information about tables owned by more than one user.
is ignored. Leave empty or set to NULL.
is a list of values, separated by commas, requesting information about all objects of a specific type(s) as follows:
“‘TABLE’, ‘SYSTEM TABLE', ‘VIEW’, ‘ALIAS’, ‘SYNONYM’”
You must enclose each table type with single quotation marks, and enclose the entire parameter with double quotation marks. Enter table types in uppercase.
The DB2 access service CSP configuration properties limit the set of object types for which information is returned. Using the table_type parameter, the object types can be more limited, but not less limited. For example, if the DB2 access service CSP configuration properties indicate that only tables and views are included and the table_type parameter specifies all object types are included, sp_tables only returns information about tables and views. For information, see “Catalog Stored Procedure properties”.
The DB2 access service selects information from the SYSSYNONYMS, SYSTABAUTH, and SYSTABLES system catalog tables.
This function corresponds to the ODBC function SQLTables.
sp_tables returns a list of database objects. Results are ordered by the following columns:
TABLE_TYPE
TABLE_OWNER
TABLE_NAME
The lengths for varchar columns shown in the result set tables are maximums; the actual lengths depend on the target database.
The following table shows the result set.
Column |
Datatype |
Description |
---|---|---|
TABLE_QUALIFIER |
varchar(128) |
Always NULL |
TABLE_OWNER |
varchar(128) |
Table owner |
TABLE_NAME |
varchar(128) |
Name of the object about which information is returned |
TABLE_TYPE |
varchar(128) NOT NULL |
One of the following:
|
REMARKS |
varchar(254) |
A description of the table or NULL |
Copyright © 2005. Sybase Inc. All rights reserved. |