DECLARE --+-> <table-name> -+-> TABLE --+ +-> <view-name> --+ | +-------------------------------------+ +-> ( -++-> declare-col-definition -++-> ) --> |+-> table-constraint -------+| +---------- , <---------------+ declare-col-definition = --> <column-name> --> data-type -++------------------------++-> |+-> col-constraint ------+| |+-> sql-and-dtr-clause --+| +----------- <-------------+ data-type = -+-> char-data-types -----------------------------------------+--> +-> TINYINT --------------+-----+------------+---------------+ +-> SMALLINT -------------+ +-> ( <n> ) -+ | +-> INTEGER --------------+ | +-> BIGINT ---------------+ | +-> FLOAT ----------------+ | +-> NUMBER -+----------------------------------+-------------+ | +-> ( -+-> <p> -+-+----------+-> ) + | | +-> * ---+ +-> , <d> -+ | +-> LIST OF BYTE VARYING --+------------+--+--------------+--+ | +-> ( <n> ) -+ +-> AS BINARY -+ | | +-> AS TEXT ---+ | +-> DECIMAL -++------------------------------+---------------+ +-> NUMERIC -++-> ( --> <n> +----------+-> ) + | | +-> , <n> -+ | +-> REAL ----------------------------------------------------+ +-> DOUBLE PRECISION ----------------------------------------+ +-> date-time-data-types ------------------------------------+ char-data-types = -+-> CHAR -------------++------------++--------------------------------+-+-> +-> CHARACTER --------++-> ( <n> ) -++-> CHARACTER SET char-set-name -+ | +-> CHAR VARYING -----+ | +-> CHARACTER VARYING + | +-> VARCHAR --+> ( <n> ) ---+--------------------------------+----------+ +-> VARCHAR2 -+ +-> CHARACTER SET char-set-name -+ | +-> LONG VARCHAR ------------------------------------------------------+ +-> NCHAR --------------+-+------------+--------------------------------+ +-> NATIONAL CHAR ------+ +-> ( <n> ) -+ | +-> NATIONAL CHARACTER -+ | +-> NCHAR VARYING --------------+-+------------+------------------------+ +-> NATIONAL CHAR VARYING ------+ +-> ( <n> ) -+ | +-> NATIONAL CHARACTER VARYING -+ | +-> RAW -> ( <n> ) -----------------------------------------------------+ +-> LONG -+--------+----------------------------------------------------+ +-> RAW -+ date-time-data-types = --+-> DATE -+----------+-----------------+--> | +-> ANSI -+ | | +-> VMS ---+ | +-> TIME ---> frac --------------------+ +-> TIMESTAMP --> frac ----------------+ +-> INTERVAL ---> interval-qualifier --+ frac = --+---------------------------+-> +--> ( <numeric-literal> ) -+ interval-qualifier = --+-> YEAR ---> prec --+-------------+-----------------+-> | +-> TO MONTH -+ | +-> MONTH --> prec ----------------------------------+ +-> DAY ----> prec --+-------------------------------+ | +-> TO -+-> HOUR ---------------+ | +-> MINUTE -------------+ | +-> SECOND -> frac -----+ +-> HOUR ---> prec --+-------------------------------+ | +-> TO -+-> MINUTE -------------+ | +-> SECOND -> frac -----+ +-> MINUTE -> prec --+-------------------------------+ | +-> TO SECOND ------> frac -----+ +-> SECOND -> seconds-prec --------------------------+ prec = --+---------------------------+-> +--> ( <numeric-literal> ) -+ seconds-prec = --+--------------------------------------+--> +-> ( <numeric-literal-1> ---+ | +-------------------------+ | ++--------------------------+-> ) --+ +> , <numeric-literal-2> --+ col-constraint= ----+--------------------------------+-+ +> CONSTRAINT <constraint-name> -+ | +---------------<--------------------+ +-> PRIMARY KEY -----------------+ +-> UNIQUE ----------------------+ +-> NOT NULL --------------------+ +-> NULL ------------------------+ +-> CHECK (predicate) -----------+ +-> references-clause -----------+ +--------------->----------------+ +---------------<----------------+ +----+----------------------------+--> +--> constraint-attributes --+ constraint-attributes = -+-> DEFERRABLE -------------+------------------------------+-+-> | +-> INITIALLY +-> IMMEDIATE --++ | | +-> DEFERRED ---+ | +-> NOT DEFERRABLE ---------+-------------------------+------+ | +-> INITIALLY IMMEDIATE --+ | +-> INITIALLY IMMEDIATE ----+-------------------+------------+ | +-> DEFERRABLE -----+ | | +-> NOT DEFERRABLE -+ | +-> INITIALLY DEFERRED -----+-------------------+------------+ +-> DEFERRABLE -----+ sql-and-dtr-clause = -+-> QUERY HEADER IS -+> <quoted-string> +-------------------+-> | +------ / <--------+ | +-> EDIT STRING IS <quoted-string> -------------------------+ | | +-> QUERY NAME FOR -+-> DTR --------+-> IS <quoted-string> -+ | +-> DATATRIEVE -+ | +-> DEFAULT VALUE FOR -+-> DTR --------+-> IS literal ----+ +-> DATATRIEVE -+ table-constraint = ---+-----------------------------------+----+ +-> CONSTRAINT <constraint-name> ---+ | +------------------------------------------+ +--> table-constraint-clause --------------+ +------------------------------------------+ +---+---------------------------+-------------> +-> constraint-attributes --+ table-constraint-clause = -+----------------------------------------------+--> +-> PRIMARY KEY -> ( -+> <column-name> +-> ) --+ | +------- , <-----+ | +-> UNIQUE -> ( -+> <column-name> +-> ) -------+ | +------- , <-----+ | +-> CHECK (predicate) -------------------------+ +-> FOREIGN KEY -> ( -+> <column-name> +-> ) + | +------- , <-----+ | | +--------------------<---------------------+ | +-> references-clause ---------->------------+