On this page

DESCR

Core command DESC DESCRIBE

Describes the columns of a table: name, type, size, nullability and default value.

Syntax

DESCR [<schema>.]<table> [ALPHA]

Quick start

DESCR CUSTOMER;

Lists the columns of CUSTOMER, in table order.

Arguments

ArgumentRequiredValuesDefault
<table>YesThe exact table name, in any caseNone
<schema>.NoThe schema of the table, followed by a dotThe current schema
ALPHANoSorts the columns by name, ignoring caseTable order

Examples

DESCR CUSTOMER;
DESC CUSTOMER ALPHA;
DESCR PUBLIC.CUSTOMER;

Details

Columns shown

Each column's name, type, size, nullability and default value. Size is the declared length for character and binary columns, and precision,scale for DECIMAL and NUMERIC columns (for example 10,2); for other types it is the size the JDBC driver reports.

By default the columns are in table order, their position as the database reports it. With ALPHA, the same columns, with the same information, are sorted by name, ignoring case, for a quicker lookup in a wide table; only the order of the rows changes.

How the table name is found

SHOW PK, SHOW FK, SHOW REFERENCES and SHOW INDEXES find the table exactly the same way.

  • Without a schema, only the connection's current schema is searched; a table with the same name in another schema is not shown. Qualify the name (DESCR OTHERSCHEMA.TOTO) to describe a table of another schema.
  • The name is tried as typed, then in upper case, then in lower case, and the first variant that names an existing table is used. When it is not the one you typed, the console says which table was found.
  • There is no wildcard or partial name: _ and % are ordinary characters of the name. DESCR FOO_BAR never describes FOOXBAR, and DESCR TRY never describes COUNTRY.

Errors

DESCR fails when no table name is given, when anything other than ALPHA follows the table name, when no case variant names an existing table, or when the name matches tables in several schemas.

Used in these how-tos

Last modified in release 5.5.0.

Found something wrong or unclear on this page? , with the page address.