Command line processor DESCRIBE TABLE command
The DESCRIBE TABLE command returns information about the columns of a table.
For each column, DESCRIBE TABLE returns the following information:
- Column name
- Table qualifier
- Data type
- Length
- Scale
- Nullability: yes, no, or unknown
>>-DESCRIBE TABLE--+---------------+-.table-name--------------->< '-table-creator-'
- table-creator
- The user ID of the table creator. The default is the user ID under which the command line processor session is running.
- table-name
- The name of the table for which column information is returned.
- Example: Displaying column information for the DSN8A10.DEPT table
- Suppose that you want to display information about DB2® sample table DSN8A10.DEPT. You do not want the output to wrap on
your display, so you want the column widths in the output to be at most 14 bytes. Use these commands
to set the column width and display the parameter
information:
CHANGE MAXCOLUMNWIDTH TO 14 DESCRIBE TABLE DSN8A10.EMP
The following information is displayed:
COLUMN_-
NAMETABLE_SCHEM TYPE_NAME COLUMN_-
SIZEDECIMAL_-
DIGITSIS_NULLABLE DEPTNO DSN8A10 CHAR 3 <null> NO DEPTNAME DSN8A10 VARCHAR 36 <null> NO MGRNO DSN8A10 CHAR 6 <null> YES ADMRDEPT DSN8A10 CHAR 3 <null> NO LOCATION DSN8A10 INTEGER 16 <null> YES