The DESCRIBE statement describes a database object, such as catalog, schema, table, view, procedure, or function: it prints the column definitions for the specified table or view, or the specifications for the specified function or procedure.
The result of DESCRIBE depends of the output format, NICE or RAW.
▪NICE format is brief and simplified. It can be used to make quick ad-hoc queries over the metadata of the database.
▪RAW format is more specific and more verbose. It outputs information that would normally be acquired by using solidDB® Data Dictionary (soldd) or complex SQL queries.
Both NICE and RAW formats are not available for all types.
DESCRIBECATALOGmy_catalog
prints the table name, the creator, the owner and the list of schemas of the specified catalog in NICE format.
DESCRIBESCHEMAmy_schema
prints the schema name, the catalog name to which it belongs, the creator and the owner in NICE format.
DESCRIBETABLEmy_table
prints the table name, the storage type used, list of parent tables, list of child tables, columns, column types, column precisions, column nullability, whether column is primary key and whether column is sec key in NICE format. In RAW format, the create statement is printed along with create statements of associated indexes and constraints.
DESCRIBEVIEWmy_view
prints the columns of the view in NICE format and the create statement in RAW format.
DESCRIBEPROCEDUREmy_procedure
prints the create statement in the RAW format.
DESCRIBEFUNCTIONmy_function
prints the create statement in the RAW format.
DESCRIBETRIGGERmy_trigger
prints the create statement in the RAW format.
Note In many cases, there is only single output format available. In those cases, the only output available is produced despite the output format specified by the user.
Examples
The following example outputs information on a table named PERSON in NICE format.
DESCRIBE PERSON; Table name : PERSON Table type : In-memory Memory usage: 7935 KB (total), 7925 KB (active), 6192 KB (rows), 1733 KB (indexes). Parent tables : CITY Child tables : OWNER, IN_RELATION
COLUMN TYPE PRECISION NULLABLE PRIMARY KEY SECONDARY KEY
FIRSTNAME VARCHAR 30 YES NO NULL LASTNAME VARCHAR 60 NO YES NULL HOME_CITY INT NULL YES NO 'CITY' 1 rows fetched.
The following example outputs information about a table named PERSON in RAWformat.