
Command line processor LIST TABLES command
The LIST TABLES command lists tables, views, or aliases on a DB2® server.
>>-LIST TABLES--+------------------------------+--------------->< | .-USER----------------. | '-FOR--+-SYSTEM--------------+-' +-ALL-----------------+ '-SCHEMA--schema-name-'
- FOR USER
- Displays a list of tables, views, and aliases with a schema name that matches the user ID of the user that issued the CONNECT command to connect the command line processor to a DB2 server. The case of the user ID in the CONNECT command must match the case of the CREATOR value in SYSIBM.SYSTABLES for a table to be listed. FOR USER is the default.
- FOR SYSTEM
- Displays a list of catalog tables on the DB2 server.
- FOR ALL
- Displays a list of all tables, views, and aliases on the DB2 server.
- FOR SCHEMA schema-name
- Displays a list of all tables, views, and aliases with a schema name that matches schema-name.
- Example: Listing tables, views, and aliases for the currently connected user
- Suppose that you connected the command line processor to a DB2 server with user ID ADMF001. You want to display a list of tables, views, and aliases with a schema name of ADMF001. You do not want the output to wrap on your display, so you set the column widths on the display to at most 14 bytes. Use these commands to set the column width and display the list.
CHANGE MAXCOLUMNWIDTH TO 14 LIST TABLES
Information like this is displayed:
TABLE_SCHEM TABLE_NAME TABLE_TYPE ADMF001 MYALIAS01 SYNONYM ADMF001 MYTABLE01 TABLE ADMF001 MYTABLE02 TABLE ADMF001 MYVIEW01 VIEW - Example: Listing tables, views, and aliases for a specified schema name
- Suppose that you want to display a list of tables, views, and aliases with a schema name of
DSN8A10. You do not want the output to
wrap on your display, and you do not want columns of up to 30 bytes to be truncated, so you
set the column widths on the display to at most 30 bytes. Use these commands to set the column
width and display the
list.
CHANGE MAXCOLUMNWIDTH TO 30 LIST TABLES FOR SCHEMA DSN8A10
Information like this is displayed:
TABLE_SCHEM TABLE_NAME TABLE_TYPE DSN8A10 AUX_BMP_PHOTO AUXILIARY TABLE DSN8A10 AUX_EMP_RESUME AUXILIARY TABLE DSN8A10 AUX_PSEG_PHOTO AUXILIARY TABLE DSN8A10 DSN_QUERY_AUX AUXILIARY TABLE DSN8A10 DSN_STATEMENT_CACHE_AUX AUXILIARY TABLE ...
