SQL$HELP_OLD72.HLB  —  ALTER  TABLE  Format
  ALTER TABLE --> <table-name> -+
  +-----------------------------+
  +-+-+-> ADD -+-> COLUMN col-definition ----------------+-+->
    | |        +-> CONSTRAINT table-constraint ----------+ |
    | |        +-> ( -+-> col-definition -+-> ) ---------+ |
    | |               +------- , <--------+              | |
    | +-> ALTER COLUMN --> alter-col-definition ---------+ |
    | +-> MODIFY -> ( -+-> alter-col-definition --+-> ) -+ |
    | |                +------------ , <----------+      | |
    | +-> DROP -+-> COLUMN <column-name> ----------------+ |
    | |         +-> CONSTRAINT <constraint-name> --------+ |
    | +-> enable-clause ---------------------------------+ |
    | +-> disable-clause --------------------------------+ |
    | +-> RENAME TO <new-table-name> --------------------+ |
    | +-> COMMENT IS -+> '<quoted-string>' -+------------+ |
    |                 +----- / -------------+              |
    +-------------------------- <--------------------------+

  col-definition =

  --> <column-name> --+
      +---------------+
      +-> add-column-type -+---------------------------+-+-+
      |                    +-> DEFAULT value-expr  ----+ | |
      |                    +-> column-identity   ------+ | |
      +---> COMPUTED BY value-expr ----------------------+ |
      +----------------------------<-----------------------+
      +--+-------------------++--------------------+-------+
         +-> col-constraint -++-> position-clause -+       |
      +----------------------------<-----------------------+
      +--+------------------------+-------------------------->
         +-> sql-and-dtr-clause --+

  add-column-type =

  --+-> data-type -----------------------------------+-->
    +-> <domain-name> -------------------------------+
    +-> <references-clause> -------------------------+
    +-> AUTOMATIC --+-----------+--> AS value-expr --+
                    +-> INSERT -+
                    +-> UPDATE -+

  column-identity =

  --> IDENTITY --+--------------------------------------------------+-->
                 +- ( <start-with> --+----------------------+-> ) --+
                                     +-> , <increment-by> --+

  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 --+

  literal =

  --+-> numeric-literal ----+--->
    +-> string-literal -----+
    +-> date-time-literal --+
    +-> interval-literal ---+

  col-constraint=

  ----+--------------------------------+-+
      +> CONSTRAINT <constraint-name> -+ |
    +---------------<--------------------+
    +-> PRIMARY KEY -----------------+
    +-> UNIQUE ----------------------+
    +-> NOT NULL --------------------+
    +-> NULL ------------------------+
    +-> CHECK (predicate) -----------+
    +-> references-clause -----------+
    +--------------->----------------+
    +---------------<----------------+
    +----+----------------------------+-->
         +--> constraint-attributes --+

  references-clause =

  --> REFERENCES <referenced-table-name> -+
       +----------------------------------+
       +-+-----------------------------------------+->
         +-> ( -+> <referenced-column-name> +-> ) -+
                +----------- , <------------+

  constraint-attributes =

  -+-> DEFERRABLE -------------+------------------------------+-+->
   |                           +-> INITIALLY +-> IMMEDIATE --++ |
   |                                         +-> DEFERRED ---+  |
   +-> NOT DEFERRABLE ---------+-------------------------+------+
   |                           +-> INITIALLY IMMEDIATE --+      |
   +-> INITIALLY IMMEDIATE ----+-------------------+------------+
   |                           +-> DEFERRABLE -----+            |
   |                           +-> NOT DEFERRABLE -+            |
   +-> INITIALLY DEFERRED -----+-------------------+------------+
                               +-> DEFERRABLE -----+

  position-clause =

  -+-> AFTER --+--> COLUMN <column-name> ---->
   +-> BEFORE -+

  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 ---------->------------+

  alter-col-definition =

  -> <column-name> +----------------++-----------------------------++
                   +-> alt-col-type ++-> SET DEFAULT value-expr ---+|
                                     +-> DEFAULT value-expr -------+|
                                     +-> DROP DEFAULT value-expr --+|
  +--------------------------- <------------------------------------+
  +-+----------------------+---------+--------------------+--------+
    ++-> col-constraint -+-+         +-> position-clause -+        |
     +-------- <---------+                                         |
  +-------------------- <------------------------------------------+
  +-+-+-----------------------------> ------------------+-+---------->
    | +--> sql-and-dtr-clause --------------------------+ |
    | +--> NO QUERY HEADER -----------------------------+ |
    | +--> NO EDIT STRING ------------------------------+ |
    | +--> NO QUERY NAME ----+-> FOR --+-> DTR --------++ |
    | +--> NO DEFAULT VALUE -+         +-> DATATRIEVE -+  |
    +------------------------- <--------------------------+

  alt-col-type =

  -+-> data-type -------------------+-+---------------------+-+-->
   +-> <domain-name>  --------------+ +-> column-identity --+ |
   +-> COMPUTED BY value-expr --------------------------------+
   +-> AUTOMATIC -+------------+----> AS value-expr ----------+
                  +-> INSERT --+
                  +-> UPDATE --+

  enable-clause =

  --> ENABLE ---+
  +-------<-----+
  +-+-> ALL TRIGGERS -----------------------------------------------+->
    +-> TRIGGER <trigger-name> ------------------------------------++
    +-+---------------+-+-> ALL CONSTRAINTS ----------------------++
      +-> VALIDATE ---+ +-> CONSTRAINT <constraint-name> ---------+
      +-> NOVALIDATE -+ +-> PRIMARY KEY --------------------------+
                        +-> UNIQUE ->( -+-> <column-name> -+-> ) -+
                                        +------- , <-------+

  disable-clause =

  --> DISABLE ---+-> ALL TRIGGERS -------------------------+-->
                 +-> TRIGGER <trigger-name> ---------------+
                 +-> ALL CONSTRAINTS ----------------------+
                 +-> CONSTRAINT <constraint-name> ---------+
                 +-> PRIMARY KEY --------------------------+
                 +-> UNIQUE ->( -+-> <column-name> -+-> ) -+
                                 +------- , <-------+
Close Help