Lists packages or tables associated with the current database.
Authorization
For the system catalog SYSCAT.PACKAGES (LIST PACKAGES) and SYSCAT.TABLES (LIST TABLES), one of the following is required:
Required Connection
Database. If implicit connect is enabled, a connection to the default database is established.
Command Syntax
>>-LIST----+-PACKAGES-+---+--------------------------------+----> '-TABLES---' | .-USER-----------------. | '-FOR--+-ALL------------------+--' +-SCHEMA--schema-name--+ '-SYSTEM---------------' >-----+--------------+----------------------------------------->< '-SHOW DETAIL--'
Command Parameters
Examples
The following is sample output from LIST PACKAGES:
Bound Total Isolation
Package Schema by sections Valid Format level Blocking
---------- --------- -------- ------------- -------- -------- --------- --------
P1 SMITH SMITH 1 Yes 0 CS U
1 record(s) selected.
The following is sample output from LIST TABLES:
Table/View Schema Type Creation time ------------------ ---------------- ---------- ---------------------------- DEPARTMENT SMITH T 1997-02-19-13.32.25.971890 EMP_ACT SMITH T 1997-02-19-13.32.27.851115 EMP_PHOTO SMITH T 1997-02-19-13.32.29.953624 EMP_RESUME SMITH T 1997-02-19-13.32.37.837433 EMPLOYEE SMITH T 1997-02-19-13.32.26.348245 ORG SMITH T 1997-02-19-13.32.24.478021 PROJECT SMITH T 1997-02-19-13.32.29.300304 SALES SMITH T 1997-02-19-13.32.42.973739 STAFF SMITH T 1997-02-19-13.32.25.156337 9 record(s) selected. |
Usage Notes
LIST PACKAGES and LIST TABLES commands are available to provide a quick interface to the system tables.
The following SELECT statements return information found in the system tables. They can be expanded to select the additional information that the system tables provide. To enhance SELECT statements use the descriptions of the Catalog Views found in the SQL Reference and the Administration Guide.
select tabname, tabschema, type, create_time from syscat.tables order by tabschema, tabname; select pkgname, pkgschema, boundby, total_sect, valid, format, isolation, blocking from syscat.packages order by pkgschema, pkgname; select tabname, tabschema, type, create_time from syscat.tables where tabschema = 'SYSCAT' order by tabschema, tabname; select pkgname, pkgschema, boundby, total_sect, valid, format, isolation, blocking from syscat.packages where pkgschema = 'NULLID' order by pkgschema, pkgname; select tabname, tabschema, type, create_time from syscat.tables where tabschema = USER order by tabschema, tabname; select pkgname, pkgschema, boundby, total_sect, valid, format, isolation, blocking from syscat.packages where pkgschema = USER order by pkgschema, pkgname;