
DESCRIBE TABLE (Db2 command line processor)
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
- table-creator
- The user ID of the table creator. The default is the user ID under which the Db2 command line processor line processor session is running.
- table-name
- The name of the table for which column information is returned.
- Example: Displaying column information for the DSN8C10.DEPT table
- Suppose that you want to display information about Db2 sample table DSN8C10.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 DSN8C10.EMP
The following information is displayed:
COLUMN_-
NAME
TABLE_SCHEM TYPE_NAME COLUMN_-
SIZEDECIMAL_-
DIGITSIS_NULLABLE DEPTNO DSN8C10 CHAR 3 <null> NO DEPTNAME DSN8C10 VARCHAR 36 <null> NO MGRNO DSN8C10 CHAR 6 <null> YES ADMRDEPT DSN8C10 CHAR 3 <null> NO LOCATION DSN8C10 INTEGER 16 <null> YES
