solidDB Help : solidDB reference : SQL: Statements : DESCRIBE
  
DESCRIBE
DESC[RIBE] [type‑option] [context‑specifier.]object [format‑option]
where:
type‑option::= CATALOG | CREDENTIALS [USING password]| SCHEMA | TABLE | VIEW | PROCEDURE |
   FUNCTION | TRIGGER
context‑specifier::= catalog | [catalog.]schema | [[catalog.]schema.]
object::= catalog | schema | table | view | procedure | function | trigger
format‑option::= [NICE (default) | RAW]
Access requirements
Database user
Usage
Use the DESCRIBE statement to get details of a database object.
Parameters, clauses, keywords, and variables
format‑option: Determines the output format:
NICE: Format that is brief and simplified and useful for ad-hoc queries over the metadata of the database.
RAW: Format that is more specific and more verbose. It outputs information that would normally be acquired by using solidDB Data Dictionary (soldd) or complex SQL queries.
Note In many cases, only a single output format is available. In those cases, the output format that is available is produced despite the output format that is specified by the user.
type-option: Details the database object
CATALOG catalog: (NICE format) Prints the catalog name, the creator, the owner, and the list of schemas in the specified catalog.
CREDENTIALS: (NICE format) Returns the authentication token for the user who runs the statement. The statement is always successful. All users have privileges to run the statement. If you use external authentication, you must use the DESCRIBE CREDENTIALS USING password format of the statement.
SCHEMA schema: (NICE format) Prints the schema name, the catalog name to which it belongs, the creator and the owner.
TABLE table:
(NICE format) 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 secondary key.
(RAW format) Prints the CREATE TABLE statement and the CREATE statements of associated indexes and constraints.
VIEW view:
(NICE format) Prints the columns of the view
(RAW format) Prints the CREATE VIEW statement.
PROCEDURE procedure: (RAW format) Prints the CREATE PROCEDURE statement.
FUNCTION function: (RAW format) Prints the CREATE FUNCTION statement.
TRIGGER trigger: (RAW format) Prints the CREATE TRIGGER statement.
Examples
The following example outputs the user credentials.
DESCRIBE CREDENTIALS;
CREDENTIALS
-----------
RZuRGUGK4TAGsJewKIHor9jg7rp-Lo-VhXt3PHN1qg079oZZ_IQoi1CWAPVzUXMTH41UdSdl1PA=
1 rows fetched.
The following example outputs information on a table named PERSON in NICE format.
DESCRIBE TABLE 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 RAW format.
DESCRIBE PERSON RAW;
  CREATE TABLE "DBA"."DBA"."PERSON" (
    "FIRSTNAME" VARCHAR(30),
    "LASTNAME" VARCHAR(60) NOT NULL,
    "HOME_CITY" INTEGER,
    FOREIGN KEY("HOME_CITY")
        REFERENCES "DBA"."DBA"."CITY"("CITY"),
    PRIMARY KEY ("LASTNAME") );
1 rows fetched.
Go up to
SQL: Statements