Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

DATABASE

STORAGE_MAP

DOMAIN

INDEX

SCHEMA

TABLE

ADD_STORAGE_AREA

ALTER_STORAGE_AREA

DROP_STORAGE_AREA

More Information

alter root file params1

alter root file params2

alter storage area params

storage area params

READ_ONLY

READ_WRITE

More Information

global buffer params

More Information

journal fast commit clause

More Information

Example

READ_ONLY

READ_WRITE

More Information

extension options

More Information

More Information

store clause

threshold clause

store lists clause

More Information

More Information

More Information

Example

COLLATING_SEQUENCE_IS

NO_COLLATING_SEQUENCE

More Information

default value

sql and dtr clause

USER

NULL

literal

More Information

More Information

index store clause

threshold clause

More Information

ADD_COLUMN

ADD_CONSTRAINT

ALTER_COLUMN

DROP_COLUMN

DROP_CONSTRAINT

More Information

table name

schema name

COLLATING_SEQUENCE_IS

COMPUTED_BY

data type

default value

col constraint

sql and dtr clause

USER

NULL

More Information

literal

More Information

More Information

references clause

table constraint

More Information

COLLATING_SEQUENCE_IS

More Information

data type

default value

add col constraint

sql and dtr clause

USER

NULL

More Information

literal

More Information

More Information

references clause

RDB/VMS SQL ALTER — VMS RDB_4.1_M

 Changes definitions for VAX SQL.

Additional information available:

DATABASESTORAGE_MAPDOMAININDEXSCHEMATABLE

DATABASE

 ALTER DATABASE -+-> PATHNAME path-name -+--+
                 +-> FILENAME file-spec -+  |
 +----------------<-------------------------+
 ++------------->--------------+------------+
  +-> alter-root-file-params1 -+            |
 +------------------------------------------+
 ++-------------->-------------+------------+
  +-> alter-root-file-params2 -+            |
 +------------------------------------------+
 ++-------------->----------------+---------+
  +-> alter-storage-area-params --+         |
 +---------------<--------------------------+
 +++--------------------------->------------------++>;
  |+-> ADD STORAGE AREA area-name ----------+     ||
  ||+---------------------------------------+     ||
  ||++----------->---------+> storage-area-params +|
  || +> FILENAME file-spec +                      ||
  |+> ALTER STORAGE AREA area-name --------+      ||
  ||+--------------------------------------+      ||
  ||+> alter-storage-area-params -----------------+|
  |+> DROP STORAGE AREA area-name ----------------+|
  +-----------------------------<------------------+

Additional information available:

ADD_STORAGE_AREAALTER_STORAGE_AREADROP_STORAGE_AREA

More Informationalter root file params1alter root file params2alter storage area params
storage area params

More Information

 Alters a database in any of the following ways:

  o  For both single-file and multifile databases, changes
     characteristics of the database root file associated with a
     database.  ALTER DATABASE allows you to override certain
     characteristics specified in the root file parameters of a CREATE
     DATABASE statement, such as whether the snapshot file is
     disabled.  In addition, ALTER DATABASE lets you control other
     characteristics that you cannot specify in CREATE DATABASE root
     file parameters, such as whether after-image journaling is
     enabled.

  o  For both single-file and multifile databases, changes storage
     area parameters.

  o  For multifile databases only, adds, alters, or drops storage
     areas.

ADD_STORAGE_AREA

 Specifies the name and file specification for a storage area you want
 to add to the database.  You can use the ADD STORAGE AREA clause only
 on multifile databases.  The area name cannot be the same as any
 other storage area definition in the database.

 The ADD STORAGE AREA clause creates two files, a data file with a
 file extension of .RDS and a snapshot file with a file extension of
 .SNP.  If you omit the FILENAME argument, the file specification
 takes the following defaults:

  o  Device:  the current device for the process

  o  Directory:  the current device for the process

  o  File name:  the name specified for the storage area


 The file specification is used for both the data and snapshot files
 that comprise the storage area (unless you use the SNAPSHOT FILENAME
 argument to specify a different file for the snapshot file).  Because
 the ADD STORAGE AREA clause may create two files with different file
 extensions, do not specify a file extension with the file
 specification.

ALTER_STORAGE_AREA

 Specifies the name of an existing storage area in the database that
 you want to alter.  You can use the ALTER STORAGE AREA clause only on
 multifile databases.

 The alter-storage-area-params are parameters that the ALTER STORAGE
 AREA clause changes.

alter root file params1

 alter-root-file-params1 =

  +-+-+-> MULTISCHEMA IS -----+--> ON ---+----------+-+-+>
  | | |                       +--> OFF --+          | | |
  | | +-> OPEN IS ------------+--> AUTOMATIC  -+----+ | |
  | | |                       +--> MANUAL -----+    | | |
  | | +-> READ WRITE -------------------------------+ | |
  | | +-> NUMBER OF USERS IS --> number-users ------+ | |
  | | +-> NUMBER OF BUFFERS IS --> number-buffers --+ | |
  | | +-> NUMBER OF VAXCLUSTER NODES IS ----------+ | | |
  | | |    +--------------------------------------+ | | |
  | | |    +-> number-nodes ------------------------+ | |
  | | +-> NUMBER OF RECOVERY BUFFERS IS ----------+ | | |
  | | |    +--------------------------------------+ | | |
  | | |    +-> number-buffers ----------------------+ | |
  | | +-> SNAPSHOT IS -+> ENABLED -+------->-----+-++ | |
  | | |                |           +> IMMEDIATE -+ |  | |
  | | |                |           +> DEFERRED --+ |  | |
  | | |                +> DISABLED ----------------+  | |
  | | +-> global-buffers-params ----------------------+ |
  | +----------------------------<--------------------+ |
  +-----> READ ONLY ------------->----------------------+

Additional information available:

READ_ONLYREAD_WRITE

More Informationglobal buffer params

More Information

 Parameters that control the characteristics of the database root file
 associated with the database, or characteristics stored in the root
 file that apply to the entire database.  You can specify these
 parameters for either single-file or multifile databases.

 Note that ALTER DATABASE does not allow you to change all root file
 parameters you can specify in CREATE DATABASE.  You must use the
 EXPORT and IMPORT statements to change the following root file
 parameters:

  o  BUFFER SIZE

  o  NUMBER OF USERS (for a single-file database)

  o  NUMBER OF VAXCLUSTER NODES (for a single-file database)

  o  SEGMENTED STRING STORAGE AREA

  o  PROTECTION IS ANSI

  o  PROTECTION IS ACL

global buffer params

 global-buffer-params=

  -> GLOBAL BUFFERS ARE -+-> ENABLED --+---+
                         +-> DISABLED -+   |
     +-------------------------------------+
     +-+------------------------------------------------+->
       +-> ( -> NUMBER IS number-glo-buffers -> , --+   |
            +---------------------------------------+   |
            +-> USER LIMIT IS max-glo-buffers ----> ) --+

READ_ONLY

 Use the READ ONLY option to change a read/write RDB$SYSTEM storage
 area (and the Rdb/VMS system relations stored in the area) to
 read-only.  You might choose the READ ONLY option if your database is
 never or rarely updated.  When the RDB$SYSTEM storage area is changed
 to read-only, locking conflicts occur less frequently, and the
 automatic updating of index and relation cardinality is inhibited.

 For information on changing a read/write storage area other than the
 RDB$SYSTEM storage area to read-only, see the "READ_ONLY" subtopic
 for "alter_storage_area_params".

READ_WRITE

 Use the READ WRITE option to change a read-only RDB$SYSTEM storage
 area (and the Rdb/VMS system relations stored in the area) to
 read/write.

 For information on changing a read-only storage area other than the
 RDB$SYSTEM storage area to read/write, see the "READ_WRITE" subtopic
 for "alter_storage_area_params".

alter root file params2

 alter-root-file-params2 =
 -+-+-> DICTIONARY IS ------+-> REQUIRED -------+----------+-+>
  | |                       +-> NOT REQUIRED ---+          | |
  | +-> ADJUSTABLE LOCK GRANULARITY IS -+-+-> ENABLED -----+ |
  | +-> CARRY OVER LOCKS ARE -----------+ +-> DISABLED ----+ |
  | +-> LOCK TIMEOUT INTERVAL IS number-seconds SECONDS ---+ |
  | +-> JOURNAL FILENAME file-spec ------------------------+ |
  | +-> JOURNAL ALLOCATION IS -> journal-blocks -> BLOCKS -+ |
  | +-> JOURNAL EXTENT IS ---> extent-blocks --> BLOCKS ---+ |
  | +-> NO JOURNAL ----------------------------------------+ |
  | +-> journal-fast-commit-clause ------------------------+ |
  +----------------------------------------------------------+

Additional information available:

More Informationjournal fast commit clause

More Information

 Parameters that control the characteristics of the database root file
 associated with the database, or characteristics stored in the root
 file that apply to the entire database.  You can specify these
 parameters for either single-file or multifile databases.

 DICTIONARY IS REQUIRED specifies that definition statements issued
 for the database must also stored in the data dictionary.

 ADJUSTABLE LOCK GRANULARITY Enables or disables whether or not the
 database system will automatically maintain as few locks as possible
 on database resources.  The default is ENABLED, and results in fewer
 locks against the database.

 JOURNAL FILENAME specifies the file for the database system to use as
 the after-image journal (.AIJ) file.  By default, when you create a
 database, after-image journaling is disabled.  Specifying an .AIJ
 file in the ALTER DATABASE statement enables after-image journaling.

 JOURNAL ALLOCATION IS specifies the number of blocks allocated for
 the .AIJ file.  The default is 0 blocks.

 JOURNAL EXTENT IS specifies the number of blocks of each .AIJ file
 extent.  The default extent for .AIJ files is 512 blocks.

 NOJOURNAL discontinues after-image journaling for databases that
 previously had it enabled.

journal fast commit clause

 journal-fast-commit-clause =

 -> JOURNAL FAST COMMIT --+-> ENABLED --+-----+
                          +-> DISABLED -+     |
  +-------------------------------------------+
  ++-----------------------------------------------------+>
   +> ( +-+-> CHECKPOINT INTERVAL IS n BLOCKS ----+-+> ) +
        | +-> CHECKPOINT TIMED EVERY n SECONDS ---+ |
        | +-> COMMIT TO JOURNAL OPTIMIZATION -----+ |
        | +-> NOCOMMIT TO JOURNAL OPTIMIZATION ---+ |
        | +-> TRANSACTION INTERVAL IS number-txns + |
        +--------------------- , <------------------+

Additional information available:

More InformationExample

More Information
 JOURNAL FAST COMMIT ENABLED specifies that Rdb/VMS keeps updated
 pages in the buffer pool and does not write the pages to disk each
 time a transaction commits.

 The updated pages can remain in the buffer pool until a
 user-specified threshold (called a checkpoint) is reached.  At
 checkpoint, Rdb/VMS writes all the updated pages for multiple
 transactions to disk.  If a transaction fails, Rdb/VMS rolls back the
 current, failed transaction and reprocesses all the committed
 transactions since the last checkpoint.

 Fast commit processing applies only to erase, modify, and store
 operations.  Transactions that include data definition statements,
 such as create logical area or create index operations, force a
 checkpoint at the end of the transaction.

 You can specify a checkpoint after a certain number of blocks using
 the CHECKPOINT INTERVAL IS clause or after a time period using the
 CHECKPOINT TIMED EVERY clause.  If you specify both types of
 checkpoints, Rdb/VMS checkpoints at whichever one it reaches first.

 If you enable COMMIT TO JOURNAL OPTIMIZATION when you enable fast
 commit, Rdb/VMS does not write commit information to the database
 root file.  This option enhances performance in database environments
 that are update intensive.  Because of the prerequisites for enabling
 the journal optimization option, general use databases or databases
 that have many read-only transactions may not benefit from this
 feature.  For more information see the VAX Rdb/VMS Guide to Database
 Maintenance and Performance.

 The TRANSACTION INTERVAL IS n clause specifies the size of the TSN
 range where n equals the number of TSNs (transaction sequence
 numbers).  Rdb/VMS uses transaction sequence numbers to ensure
 database integrity.  When you specify NO COMMIT TO JOURNAL
 OPTIMIZATION, TSNs are assigned to users one at a time.  When the
 journal optimization option is enabled, each user is pre-assigned a
 range of TSNs.  Assigning a range of TSNs avoids the single-threading
 problem because commit information need not be written to the
 database root for each transaction.  Rdb/VMS writes all transaction
 information to the .AIJ file except for each user's allocated TSN
 range, which it writes to the root.

 The transaction interval value (the TSN range) must be a number
 between 8 and 1024.  The default value is 256.  You need to decide
 which constraint has precedence on your database:  performance or
 running out of TSNs.

 As a general guideline, if your database has few users or if all user
 sessions are long, select a high transaction interval.  If your
 database has many users or if user sessions are short, select a
 smaller transaction interval.
Example
 The following example changes the CORPORATE_DATA database so that
 after-image journaling and fast commit processing are enabled.

 SQL> ALTER DATABASE FILENAME CORPORATE_DATA
 cont> JOURNAL FILENAME DISK01:[DEPT3.SQL]CORP_DATA.AIJ
 cont> JOURNAL FAST COMMIT ENABLED
 cont> (CHECKPOINT INTERVAL IS 100 BLOCKS,
 cont> CHECKPOINT TIMED EVERY 10 SECONDS);
 %RDMS-I-AIJMODSEQ, next AIJ file sequence number will be 2
 SQL>

alter storage area params

 alter-storage-area-params =

 -+-+-+-> READ WRITE -------------------------------------+-+-+->
  | | +-> EXTENT IS -+> extent-pages ---------> PAGES --+-+ | |
  | | |              +> (extension-options) ------------+ | | |
  | | +-> SNAPSHOT ALLOCATION IS -> snp-pages --> PAGES --+ | |
  | | +-> SNAPSHOT EXTENT IS  +> extent-pages -> PAGES -+-+ | |
  | |                         +> (extension-options) ---+   | |
  | +-----------------------------<-------------------------+ |
  +-----> READ ONLY ------------------------------------------+
  +-----> WRITE ONCE -----------------------------------------+

Additional information available:

READ_ONLYREAD_WRITE

More Informationextension options

More Information

 Parameters that change the characteristics of database storage area
 files.  You can specify the same storage area parameters for either
 single-file or multifile databases, but the effect of the clauses in
 this part of an ALTER DATABASE statement differs:

  o  For single-file databases, the storage area parameters change the
     characteristics for the single storage area in the database.

  o  For multifile databases, the storage area parameters change the
     characteristics of the RDB$SYSTEM storage area.  SQL generates an
     error if you specify RDB$SYSTEM as the area name in the ALTER
     STORAGE AREA clause, so specifying the parameters in this part of
     the ALTER DATABASE statement is the only way to change the
     parameters of the RDB$SYSTEM storage area using ALTER DATABASE.


 Note that ALTER DATABASE does not allow you to change all storage
 area parameters you can specify in CREATE DATABASE.  You must use the
 EXPORT and IMPORT statements to change the following root file
 parameters:

  o  ALLOCATION

  o  PAGE SIZE

  o  PAGE FORMAT

  o  THRESHOLDS

  o  INTERVAL

  o  SNAPSHOT FILENAME

READ_ONLY

 Permits you to change any read/write storage area (except the
 RDB$SYSTEM storage area) to read-only.

 For information on changing a read/write RDB$SYSTEM storage area to
 read-only, see the "READ_ONLY" subtopic for
 "alter_root_file_params1".

Additional information available:

More Information

More Information
 SQL provides support for both read-only databases and databases with
 one or more read-only storage areas.  You can take advantage of this
 read-only support if you have a stable body of data that is never (or
 rarely) updated.

 Read-only databases consist of:

  o  A read/write root file

  o  One or more read-only storage areas and no read/write storage
     areas


 Read-only databases can be published and distributed on CDROM media.

 Read-only storage areas:

  o  Do not have snapshot files (since data in a read-only storage
     area is not updated)

  o  Minimize locking problems in the read-only storage areas

  o  Are not backed up by RMU/BACKUP unless explicitly instructed
     (thus decreasing backup time for large areas of data that do not
     change)

  o  Are not restored by RMU/RESTORE unless explicitly instructed

  o  Are not recovered by RMU/RECOVER


 If you change a read/write storage area to read-only, you cannot
 specify the EXTENT, SNAPSHOT ALLOCATION, and SNAPSHOT EXTENT clauses.

 A database with both read/write and read-only storage areas can be
 fully recovered after a system failure ONLY if after-image journaling
 is enabled on the database.  If your database has both read/write and
 read-only storage areas but does not have after-image journaling
 enabled, you should do full backups (including read-only areas) at
 all times.  Doing full backups enables you to recover the entire
 database to its condition at the time of the previous backup.

 You must convert and remaster read-only storage areas with each
 upgrade of Rdb/VMS.

READ_WRITE

 Permits you to change any read-only storage area (except the
 RDB$SYSTEM storage area) to read/write.  You might change a read-only
 storage area to read/write to facilitate batch updates to
 infrequently changed data.

 For information on changing a read-only RDB$SYSTEM storage area to
 read/write, see the "READ_WRITE" subtopic for
 "alter_root_file_params1".

extension options

 extension-options =

 --> MINIMUM OF min-pages PAGES, --+
  +--------------------------------+
  +> MAXIMUM OF max-pages PAGES, --+
  +--------------------------------+
  +> PERCENT GROWTH IS growth ------>

 Changes the number of pages of each snapshot or storage area file
 extent.

DROP_STORAGE_AREA

 Deletes the specified storage area definition and the associated data
 and snapshot files.  You can use the DROP STORAGE AREA clause only on
 multifile databases.

 To protect against accidental data deletion, the ALTER DATABASE
 statement fails if you specify a DROP STORAGE AREA clause that names
 a storage area referred to in any storage map.  You must first use
 the ALTER STORAGE MAP statement to move the data to another storage
 area.

storage area params

 storage-area-params =

 -+-+-------------------------->-----------------------------+-+-->
  | +-> ALLOCATION IS ---> number-pages ----> PAGES ---------+ |
  | +-> PAGE SIZE IS ----> page-blocks -----> BLOCKS --------+ |
  | +-> PAGE FORMAT IS --+----> UNIFORM ----+----------------+ |
  | |                    +----> MIXED ------+                | |
  | +-> THRESHOLDS ARE ( val1 -+----------------------+-> ) -+ |
  | |                          +-> ,val2 -+----------++      | |
  | |                                     +-> ,val3 -+       | |
  | +-> INTERVAL IS -------> number-data-pages --------------+ |
  | +-> EXTENT IS ----+--> extent-pages ----> PAGES ----+----+ |
  | |                 +--> (extension-options)----------+    | |
  | +-> SNAPSHOT FILENAME ---> file-spec --------------------+ |
  | +-> SNAPSHOT ALLOCATION IS --> snp-pages --> PAGES ------+ |
  | +-> SNAPSHOT EXTENT IS -+-> extent-pages --> PAGES -+----+ |
  | |                       +-> (extension-options) ----+    | |
  | +-> WRITE ONCE ------------------------------------------+ |
  |                                                            |
  +------------------------------<-----------------------------+

 Parameters that control the characteristics of the storage area.

STORAGE_MAP

 ALTER STORAGE MAP map-name -+
 +---------------------------+
 ++-+-+-> store-clause ---------------------+-+--+-+>;
  | | +-> threshold-clause -----------------+ |  | |
  | | ++-> ENABLE --+-> COMPRESSION --------+ |  | |
  | | |+-> DISABLE -+                       | |  | |
  | | +-> NO PLACEMENT VIA INDEX -----------+ |  | |
  | | +-> PLACEMENT VIA INDEX index-name ---+ |  | |
  | | +-> REORGANIZE --> --+---->------+------+  | |
  | |                      +-> AREAS --+         | |
  | |                      +-> PAGES --+         | |
  | +--------------------<-----------------------+ |
  +> store-lists-clause ---------------------------+

Additional information available:

More Informationstore clausethreshold clausestore lists clause

More Information

 Changes an existing storage map.  A storage map controls which rows
 of a table are stored in which storage areas in a multifile database.

 In addition to changing storage maps, ALTER STORAGE MAP has options
 that change:

  o  Which index the database system uses when inserting rows in the
     table

  o  Whether the rows of the table will be stored in a compressed
     format

  o  Whether the data in the existing storage areas will be
     reorganized

  o  Which columns of the table will be stored in an area

store clause

 store-clause =

 -> STORE -+----------------------------------------+>
           ++> IN area-name ----+                   |
            | +-----------------+                   |
            | +-+-------------------------------+---+
            |   +-> ( -> threshold-clause -> ) -+   |
            |                                       |
            +-> across-clause ----------------------+
            +-> using-clause -----------------------+

Additional information available:

More Information

More Information

 A new storage map definition that replaces the existing storage map.
 The store clause allows you to specify which storage area files will
 be used to store rows from the table:

  o  All rows of a table can be associated with a single storage area.

  o  Rows of a table can be distributed among several storage areas.

  o  Rows of a table can be systematically distributed, or
     partitioned, among several storage areas by specifying upper
     limits on the values for a column in a particular storage area.
     This is called horizontal partitioning.

threshold clause

 threshold-clause =

  -+-> THRESHOLD -+-> IS -+-> ( --> val1 --> ) -----+->
   |              +-> OF -+                         |
   |                                                |
   +-> THRESHOLDS -+-> ARE -+-----------+           |
                   +-> OF  -+           |           |
     +----------------------------------+           |
     +-> ( --> val1 -+-----------------------+-> ) -+
                     +-> , val2 -+-----------+
                                 +-> , val3 -+

Additional information available:

More Information

More Information

 You can specify up to three SPAM thresholds for storage areas with
 mixed format pages and logical areas in storage areas with uniform
 format pages.  The value val represents the percentage of the
 partition.  You can only specify three thresholds for Rdb/VMS Version
 4.1.

 You can specify a default threshold for a new logical area using the
 THRESHOLDS ARE clause in the ALTER STORAGE MAP statement.  To specify
 thresholds for a particular storage area, each storage area mentioned
 in the STORE clause can be followed by a THRESHOLDS ARE clause.

 Thresholds are not allowed for segmented string storage areas.  The
 THRESHOLD clause only applies to new areas:  you cannot change a
 threshold for a logical area.

 Although a threshold clause associated with a particular area is
 enclosed in parentheses, the default threshold clause for a storage
 map is not.  (The threshold clause associated with a particular area
 appears within the store clause.)

store lists clause

 store-lists-clause =

 --> STORE LISTS -----+
 +--------------------+
 ++> IN area-name -+
  |  +-------------+
  |  +-+-----------------------------------------------+--+
  |    +-> FOR -> ( -+-> table-name -----------+-> ) --+  |
  |                  +-> table-name. col-name -+       |  |
  |                  +-------- , <-------------+       |  |
  +-------------------------<--------------------------+  |
  +-------------------------------------------------------+
  +> IN default-list-area -------------------->

Additional information available:

More InformationExample

More Information

 Directs the database system to store the lists from one or more
 tables or columns of tables in a specified storage area.

 You must specify the default list storage area at the end of each
 store lists clause.  SQL uses the default list storage area to store
 lists for which no storage area is specified.  The default list
 storage area is RDB$SYSTEM unless you used the LIST STORAGE AREA
 clause of the CREATE DATABASE statement to specify a different
 default list storage area.

Example

 The following example causes list data to be stored in several
 storage areas.  You cannot control which records are stored in which
 storage areas, nor can you use ALTER STORAGE MAP to move list data to
 another storage area.

 SQL> ALTER STORAGE MAP LISTS_MAP
 cont> STORE LISTS IN RDB$SYSTEM
 cont> FOR (RESUMES.RESUME)
 cont> IN RESUME_LISTS
 cont> FOR (RESUMES.RESUME)
 cont> IN RESUME_LISTS2
 cont> FOR (RESUMES.RESUME);
 SQL> SHOW STORAGE MAP LISTS_MAP
      LISTS_MAP
  For Lists
  Store clause:          STORE LISTS IN RDB$SYSTEM
      FOR (RESUMES.RESUME)
      IN RESUME_LISTS
      FOR (RESUMES.RESUME)
      IN RESUME_LISTS2
      FOR (RESUMES.RESUME)

 The following example creates a new column for an existing table, and
 alters the storage map to specify a storage area for that column.

 SQL> ALTER TABLE RESUMES ADD PICTURE LIST OF VARBYTE.
 SQL> ALTER STORAGE MAP LISTS_MAP
 cont> STORE LISTS IN RESUME_LISTS FOR (RESUMES.RESUME)
 cont> IN RESUME_LISTS2
 cont> FOR (RESUMES.PICTURE);

DOMAIN

 ALTER DOMAIN ----+
  +---------------+
  +->domain-name +-----------------+-+-----------------+--+
                 +-> IS data-type -+ +->default-value -+  |
  +-------------------------------------------------------+
  +-+--------------------------------------------+--+
    +---> COLLATING SEQUENCE IS sequence-name ---+  |
    +---> NO COLLATING SEQUENCE -----------------+  |
          +-----------------------------------------+
          +--+--------------------------+--> ;
             ++-> sql-and-dtr-clause --++
              +-------<----------------+

Additional information available:

COLLATING_SEQUENCE_ISNO_COLLATING_SEQUENCE

More Informationdefault valuesql and dtr clause

More Information

 Alters a domain definition.  This allows you to change the data type,
 optional default value, collating sequence, or SQL and DATATRIEVE
 formatting parameters for all columns defined using the domain,
 simply by changing the domain itself.  For example, if you want to
 change the data type for EMPLOYEE_ID from CHAR(5) to CHAR(6), you
 need only alter the data type for ID_DOM.  You do not have to alter
 the data type for the column EMPLOYEE_ID in the tables DEGREES,
 EMPLOYEES, JOB_HISTORY, SALARY_HISTORY, nor do you have to alter the
 column MANAGER_ID in DEPARTMENTS.

 You can alter any named domain once you have attached to the database
 that includes the domain.  If you want to alter a domain that is
 referred to in an index definition, you must first drop the index.

 If a domain definition is stored in the data dictionary, the ALTER
 DOMAIN statement alters the domain definition in the data dictionary.

default value

 default-value =

 DEFAULT --+-->literal -----------+->
           +-->USER  -------------+
           +-->NULL  -------------+
           +-->CURRENT_DATE ------+
           +-->CURRENT_TIME ------+
           +-->CURRENT_TIMESTAMP -+

Additional information available:

USERNULL

literalMore Information

literal

 A value expression that is either numeric, character string, or date.

USER

 The user name of the process that invokes interactive SQL or runs a
 program.

NULL

 A null value.
 4CURRENT_DATE
 DATE data type value containing year, month, and day for date
 'today'.
 4CURRENT_TIME
 TIME data type value containing hour, minute, and second for time
 'now'.
 4CURRENT_TIMESTAMP
 TIMESTAMP data type value containing year, month, and day for date
 'today' and hour, minute, and second for time 'now' currently defined
 in Rdb/VMS.

More Information

 The default value of a column is the value stored in the database if
 an insert operation on a row specifies no value for that column.  You
 can use literals, the NULL keyword, the current timestamp, or the
 user name as default values.  If you do not specify a default value,
 SQL assigns NULL as the default value.

 If you specify a default value for a column in a table, it overrides
 any default value specified for the domain on which the column is
 based.

 You might have any of several possible reasons for specifying a
 default value for a column; for instance, you may want to store the
 most commonly used value, or you may want to store a value that
 highlights (visually displays) the fact that no value was stored.

COLLATING_SEQUENCE_IS

 Specifies a new collating sequence for the named domain.

 The VMS National Character Set (NCS) Utility provides a set of
 pre-defined collating sequences and also lets you define collating
 sequences of your own.  The COLLATING SEQUENCE clause accepts both
 pre-defined and user-defined NCS collating sequences.

 Before you use the COLLATING SEQUENCE clause in an ALTER DOMAIN
 statement, you must first specify the NCS collating sequence for SQL
 using the CREATE COLLATING SEQUENCE statement.  The sequence-name
 argument in the COLLATING SEQUENCE clause must be the same as the
 sequence-name in the CREATE COLLATING SEQUENCE statement

NO_COLLATING_SEQUENCE

 Specifies that the named domain will use the standard default
 collating sequence:  that is, ASCII.  Use the NO COLLATING SEQUENCE
 clause to override the collating sequence defined for the database in
 the CREATE DATABASE or ALTER DATABASE statement, or the domain in the
 CREATE DOMAIN statement.

sql and dtr clause

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





 Optional formatting clauses allow you to modify data displays or
 query characteristics for interactive SQL users and DATATRIEVE users.

 A query header specifies a string that interactive SQL or DATATRIEVE
 displays in place of the column name when it retrieves values from a
 column.  An edit string specifies a string that controls how
 interactive SQL or DATATRIEVE formats the display of values in a
 column.

 DEFAULT VALUE and QUERY NAME are active only from DATATRIEVE.

INDEX

 ALTER INDEX index-name -+
 +-----------------------+
 +-+--------------------------------+-+-----------------------+-> ;
   +++-> NODE SIZE number-bytes --+++ +-> index-store-clause -+
    |+-> PERCENT FILL percentage -+|
    |+-> USAGE -+-> UPDATE -+-----+|
    |           +-> QUERY --+      |
    +----------------<-------------+

Additional information available:

More Informationindex store clause

More Information

 Changes an index.  The ALTER INDEX statement allows you to change:

  o  The characteristics of index nodes (sorted indexes only)

  o  The names of the storage area or storage areas that contain the
     index

  o  Thresholds for the logical storage areas that will contain the
     index


 You cannot change:

  o  The columns that comprise an index

  o  Whether the index is UNIQUE

  o  A hashed index to a sorted index

  o  A sorted index to a hashed index


 You cannot alter an index when there are other active users of the
 database.

index store clause

 index-store-clause = STORE -+
 +---------------------------+
 ++-> IN area-name ---+----------------------------------+---+->
  |                   +-> ( -> threshold-clause -> ) ----+   |
  |                                                          |
  +-> USING -> ( -+-> column-name -+-> ) -------------+      |
                  +--------<-------+                  |      |
  +---------------------------------------------------+      |
  ++> IN area-name -+-------------------------------+-+      |
   |                +-> ( -> threshold-clause -> ) -+ |      |
   | +------------------------------------------------+      |
   | +-> WITH LIMIT OF -> ( -+-> literal -+-> ) ------+---+  |
   |                         +------<-----+           |   |  |
   +---------------------<----------------------------+   |  |
                                                          |  |
 +--------------------------------------------------------+  |
 +--> OTHERWISE IN area-name -----+                          |
     +----------------------------+                          |
     +-+----------------------------------+------------------+
       +-> ( --> threshold-clause ---> ) -+

Additional information available:

threshold clauseMore Information

threshold clause

 threshold-clause =

  -+-> THRESHOLD -+-> IS -+-> ( --> val1 --> ) -----+->
   |              +-> OF -+                         |
   |                                                |
   +-> THRESHOLDS -+-> ARE -+-----------+           |
                   +-> OF  -+           |           |
     +----------------------------------+           |
     +-> ( --> val1 -+-----------------------+-> ) -+
                     +-> , val2 -+-----------+
                                 +-> , val3 -+

More Information

 A storage map definition for the index.  You can specify a store
 clause for indexes in a multifile database only.  The STORE clause in
 a CREATE INDEX statement allows you to specify which storage area
 files will be used to store the index entries:

  o  All index entries can be associated with a single storage area.

  o  Index entries can be systematically distributed, or partitioned,
     among several storage areas by specifying upper limits on the
     values for a key in a particular storage area.

  o  You can specify a different SPAM threshold for each logical area
     that is created by a storage map.  You can specify a default
     threshold for any new logical area using the THRESHOLDS ARE
     clause in the ALTER INDEX statement.

     To specify thresholds for a particular storage area, each storage
     area mentioned in the STORE clause can be followed by a
     THRESHOLDS ARE clause.  The value val represents the percentage
     of the partition.  You can only specify three thresholds for
     Rdb/VMS Version 4.1.

 If you omit the storage map definition, the default is to store all
 the entries for an index in the main RDB$SYSTEM storage area.

SCHEMA

 The ALTER SCHEMA statement is supported only for upward
 compatibility.  For information on altering databases see the Help
 topic on ALTER DATABASE.

TABLE

 ALTER TABLE --> table-name --+
 +----------------------------+
 +-+-+-> ADD -+-> COLUMN col-definition -------------+--> ;
   | |        +-> CONSTRAINT table-constraint -------+
   | +-> ALTER alter-col-definition -----------------+
   | +-> DROP -+-> COLUMN column-name ---------------+
   |           +-> CONSTRAINT constraint-name -------+
   +---------------------<---------------------------+

Additional information available:

ADD_COLUMNADD_CONSTRAINTALTER_COLUMNDROP_COLUMN
DROP_CONSTRAINT

More Informationtable nameschema name

More Information

 The ALTER TABLE statement changes an existing table definition.  You
 can:

  o  Add columns

  o  Add constraints to tables or columns

  o  Modify columns

  o  Delete columns

  o  Delete constraints

table name

 table-name =

 -+------------------------+-> name-of-table --+->
  +-+-> schema-name -+> . -+                   |
  | +-> alias -------+                         |
  +---> " alias.name-of-table " ---------------+

schema name

 schema-name  =
  -+----------------------------------------+-+
   +------> catalog-name ------------+-> . -+ |
   +-> " -> alias.catalog-name -> " -+        |
   |   +--------------------------------------+
   |   +--------------> name-of-schema --------+->
   +-> " -> alias.name-of-schema -> " ---------+

ADD_COLUMN

 The ADD COLUMN clause creates an additional column in the table.  SQL
 adds the column to the right of the existing columns in the table.

 col-definition =

  -> column-name ----+
     +---------------+
     +-+-> data-type ---+-+------------------+-+
     | +-> domain-name -+ +-> default-value -+ |
     | +---------------------------------------+
     | ++-------------------+-+-----------------------+-+->
     |  ++> col-constraint ++ +-> sql-and-dtr-clause -+ |
     |   +--------<--------+                            |
     +--> COMPUTED BY value-expr -----------------------+

 Specify a name for the column, a data type or domain name, and
 optional default value, column-constraints, and SQL and DATATRIEVE
 formatting clauses for the column specified by the column name.

Additional information available:

COLLATING_SEQUENCE_ISCOMPUTED_BY

data typedefault valuecol constraintsql and dtr clause

data type

 data-type =
  -+-> CHAR -+--------+---------------------------+-->
   |         +-> (n) -+                           |
   +-> VARCHAR (n) -------------------------------+
   +-> LONG VARCHAR ------------------------------+
   +-> TINYINT --------------+-----+--------+-----+
   +-> SMALLINT -------------+     +-> (n) -+     |
   +-> INTEGER --------------+                    |
   +-> BIGINT ---------------+                    |
   +-> QUADWORD -------------+                    |
   +-> LIST OF BYTE VARYING -+                    |
   +-> DECIMAL -+-+-----------------------------+-+
   +-> NUMERIC -+ +-> ( --> n -+--------+-> ) --+ |
   |                           +-> , n -+         |
   +-> FLOAT -+--------+--------------------------+
   |          +-> (n) -+                          |
   +-> REAL --------------------------------------+
   +-> DOUBLE PRECISION --------------------------+
   +-> date-time-data-types ----------------------+

default value

 default-value =

 DEFAULT --+-->literal -----------+->
           +-->USER  -------------+
           +-->NULL  -------------+
           +-->CURRENT_DATE ------+
           +-->CURRENT_TIME ------+
           +-->CURRENT_TIMESTAMP -+

Additional information available:

USERNULL

More InformationliteralMore Information

More Information
 The default value of a column is the value stored in the database if
 an insert operation on a row specifies no value for that column.  You
 can use literals, the NULL keyword, the current timestamp, or the
 user name as default values.  If you do not specify a default value,
 SQL assigns NULL as the default value.

 If you specify a default value for a column in a table, it overrides
 any default value specified for the domain on which the column is
 based.

 You might have any of several possible reasons for specifying a
 default value for a column; for instance, you may want to store the
 most commonly used value, or you may want to store a value that
 highlights (visually displays) the fact that no value was stored.
literal
 A value expression that is either numeric, character string, or date.
USER
 The user name of the process that invokes interactive SQL or runs a
 program.
NULL
 A null value.
 5CURRENT_DATE
 DATE data type value containing year, month, and day for date
 'today'.
 5CURRENT_TIME
 TIME data type value containing hour, minute, and second for time
 'now'.
 5CURRENT_TIMESTAMP
 TIMESTAMP data type value containing year, month, and day for date
 'today' and hour, minute, and second for time 'now' currently defined
 in Rdb/VMS.
More Information
 A value to be stored in a column if the row that is inserted does not
 include a value for that column.  You can use literals, the NULL
 keyword, the current timestamp, or the user name as default values.

 If you do not specify a default value, a column inherits any default
 value from the domain.  If you do not specify a default value for
 either the column or domain, SQL assigns NULL as the default value.

col constraint

 col-constraint =

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

Additional information available:

More Informationreferences clause

More Information
 A col-constraint is a constraint definition that applies to the
 specified column.  The five types of column constraints are PRIMARY
 KEY, NOT NULL, UNIQUE, CHECK, and foreign key constraints.  Foreign
 key constraints are created with the REFERENCES clause.  You can also
 optionally specify a name for a constraint definition.

 The PRIMARY KEY column constraint declares a column to be a primary
 key.  SQL requires that values in this column be unique and not null.
 Therefore, you need not specify the UNIQUE and NOT NULL column
 constraints for a primary key column.

 The NOT NULL column constraint restricts values in the column to
 non-null values.

 The UNIQUE column constraint specifies that values in the column
 named must be unique.  You can use either UNIQUE or PRIMARY KEY
 keywords to define a column as a unique key for a table.

 The CHECK column constraint specifies a predicate that column values
 inserted into the table must satisfy.  Predicates in CHECK table
 constraints can refer directly only to the column with which they are
 associated.

 The optional CONSTRAINT constraint-name specifies a name for a column
 constraint that is used in several ways:

  o  The INTEG_FAIL error message specifies the name when an INSERT,
     UDPATE, or DELETE statement violates the constraint

  o  ALTER TABLE DROP CONSTRAINT statements specify the name to drop a
     table constraint

  o  SHOW TABLE statements display the names of column and table
     constraints


 The name of the constraint is used in error messages and ALTER TABLE
 DROP CONSTRAINT, SHOW TABLE, DECLARE TRANSACTION and SET TRANSACTION
 statements.  The CONSTRAINT clause is optional.  If you omit the
 constraint name, SQL creates a name.  However, DIGITAL recommends
 that you always name column and table constraints.  The constraint
 names generated by SQL may be obscure and, in programs, may change
 between compilation and running.
references clause
 references-clause =

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

 Specifies the name of a column or columns that are a unique key or
 primary key in the referenced table.  When the REFERENCES clause is
 selected as a column-constraint, the column specified in the
 col-definition clause becomes a foreign key for the referencing table
 (the table being defined).  When the REFERENCES clause is selected as
 a table constraint, the column name or column names specified in the
 FOREIGN KEY clause become a foreign key for the referencing table.

 The referenced_table_name is the name of the table that contains the
 unique key or primary key referenced by the referencing table.  You
 must have the SQL access right REFERENCES or CREATETAB to the
 referenced table.

 For a column constraint, the referenced_column_name is the name of
 the column that is a unique key or primary key in the referenced
 table.  For a table constraint, the the referenced_column_name is the
 name of the column or columns that are a unique key or primary key in
 the referenced table.  The unique key can be defined with either the
 UNIQUE or PRIMARY KEY keywords.  If you omit the
 referenced_column_name, the primary key is selected by default.

sql and dtr clause

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





 Optional formatting clauses allow you to modify data displays or
 query characteristics for interactive SQL users and DATATRIEVE users.

 A query header specifies a string that interactive SQL or DATATRIEVE
 displays in place of the column name when it retrieves values from a
 column.  An edit string specifies a string that controls how
 interactive SQL or DATATRIEVE formats the display of values in a
 column.

 DEFAULT VALUE and QUERY NAME are active only from DATATRIEVE.

COLLATING_SEQUENCE_IS

 The COLLATING SEQUENCE IS clause specifies a collating sequence.

 A collating sequence is the sequence in which characters are ordered
 for sorting, merging, and comparing.  The VMS National Character Set
 (NCS) provides a set of predefined collating sequences and lets you
 define collating sequences of your own.

COMPUTED_BY

 The COMPUTED BY clause specifies that the value of this column is
 calculated from values in other columns and constant expressions.
 You can use the ALTER TABLE COMPUTED BY clause to add a computed
 column to an existing table, but you cannot use it to alter an
 existing column into a computed column.
 In a COMPUTED BY clause, the column name that you supply in your
 column definition must be different from the name of any other
 existing column in the table.
 Any column that you refer to in the definition of a computed column
 cannot be deleted from that table unless you first delete the
 computed column.
 SQL does not allow UNIQUE or PRIMARY KEY constraints, REFERENCE
 clauses, default values, or default values for DATATRIEVE in computed
 columns.

ADD_CONSTRAINT

 The ADD CONSTRAINT clause adds a table constraint definition that
 applies to the whole table.  The four types of table constraints are
 PRIMARY KEY, UNIQUE, CHECK, and FOREIGN KEY constraints.  You can
 also optionally specify a constraint name.

 The PRIMARY KEY constraint is used to declare a column or columns as
 a primary key for the table being defined.  Any foreign key that
 refers to this column must refer to this primary key.

 The UNIQUE table constraint specifies that the combination of values
 for the columns named must be unique in a row.  You can use either
 the UNIQUE or PRIMARY KEY keywords to define one or more columns as a
 unique key for a table.

 The CHECK table constraint specifies a predicate that column values
 inserted into the table must satisfy.  Predicates in CHECK table
 constraints can refer to any column in the table.  Column select
 expressions within the predicate can refer to other tables in the
 database.

 The FOREIGN KEY table constraint specifies the column or columns that
 you want to declare as a foreign key in the table you are defining.

 The optional CONSTRAINT table-constraint clause specifies a name for
 a table constraint.

Additional information available:

table constraint

table constraint

 table-constraint =

 -+-> PRIMARY KEY -> ( -+-> column-name -+-> ) ------+--+
  |                     +------- , <-----+           |  |
  +-> UNIQUE -> ( -+-> column-name -+-> ) -----------+  |
  |                +------- , <-----+                |  |
  +-> CHECK (predicate) -----------------------------+  |
  +-> FOREIGN KEY -> ( -+-> column-name -+-> ) --+   |  |
                        +------- , <-----+       |   |  |
    +-----------------------<--------------------+   |  |
    +-> references-clause ------------->-------------+  |
    +------------------<--------------------------------+
    +-+-------------------------------+->
      +-> CONSTRAINT constraint-name -+

Additional information available:

More Information

More Information
 A table-constraint is a constraint definition that applies to the
 whole table.  The four types of table constraints are PRIMARY KEY,
 UNIQUE, CHECK, and FOREIGN KEY constraints.  You can also optionally
 specify a constraint name.  A column must be defined in a table
 before you can specify the column in a table constraint definition.
 <P> The name specified is used in several ways:

  o  The INTEG_FAIL error message specifies the name when an INSERT,
     UDPATE, or DELETE statement violates the constraint

  o  ALTER TABLE DROP CONSTRAINT statements specify the name to drop a
     table constraint

  o  SHOW TABLE statements display the names of column and table
     constraints

ALTER_COLUMN

 The ALTER COLUMN clause modifies the column specified by the column
 name:

 alter-col-definition =

 -> column-name -+-------->-------+-+--------->--------+--+
                 +-> data-type ---+ +-> default-value -+  |
                 +-> domain-name -+                       |
   +------------------------------------------------------+
   +--++------------>------------+-+-+
      |+-> add-col-constraint ---+ | |
      +-------------<--------------+ |
   +---------------------------------+
   +--+------------>--------------------+--->
      +-+-> sql-and-dtr-clause ------+--+
        +--------------<-------------+

Additional information available:

COLLATING_SEQUENCE_IS

More Informationdata typedefault valueadd col constraintsql and dtr clause

More Information

 You can modify some elements of a column definition but not others:

  o  You cannot change the column name.

  o  You can change an explicitly specified data type to another, but
     use care (see notes in this argument description).

  o  You can add or modify the default value.

  o  You can change the domain referred to by a column, provided the
     domain exists in the database

  o  You can substitute an explicit data type for a column that
     previously referred to a domain name

  o  If you do not want to change the data type or domain of an
     existing column, you do not need to specify a data type or domain
     name.

  o  You cannot change an existing column constraint.  However, you
     can drop the existing constraint and add a new column constraint
     using the ALTER COLUMN statement to achieve the same result.

  o  You can specify any column to be NOT NULL.  The only way you can
     alter an existing constraint to be not null is by using the ALTER
     TABLE statement.

  o  You can change a formatting clause by redefining clauses or
     overriding existing clauses with NO options.  If you add a new
     clause, existing clauses are unaffected.

data type

 data-type =
  -+-> CHAR -+--------+---------------------------+-->
   |         +-> (n) -+                           |
   +-> VARCHAR (n) -------------------------------+
   +-> LONG VARCHAR ------------------------------+
   +-> TINYINT --------------+-----+--------+-----+
   +-> SMALLINT -------------+     +-> (n) -+     |
   +-> INTEGER --------------+                    |
   +-> BIGINT ---------------+                    |
   +-> QUADWORD -------------+                    |
   +-> LIST OF BYTE VARYING -+                    |
   +-> DECIMAL -+-+-----------------------------+-+
   +-> NUMERIC -+ +-> ( --> n -+--------+-> ) --+ |
   |                           +-> , n -+         |
   +-> FLOAT -+--------+--------------------------+
   |          +-> (n) -+                          |
   +-> REAL --------------------------------------+
   +-> DOUBLE PRECISION --------------------------+
   +-> date-time-data-types ----------------------+

default value

 default-value =

 DEFAULT --+-->literal -----------+->
           +-->USER  -------------+
           +-->NULL  -------------+
           +-->CURRENT_DATE ------+
           +-->CURRENT_TIME ------+
           +-->CURRENT_TIMESTAMP -+

Additional information available:

USERNULL

More InformationliteralMore Information

More Information
 The default value of a column is the value stored in the database if
 an insert operation on a row specifies no value for that column.  You
 can use literals, the NULL keyword, the current timestamp, or the
 user name as default values.  If you do not specify a default value,
 SQL assigns NULL as the default value.

 If you specify a default value for a column in a table, it overrides
 any default value specified for the domain on which the column is
 based.

 You might have any of several possible reasons for specifying a
 default value for a column; for instance, you may want to store the
 most commonly used value, or you may want to store a value that
 highlights (is visual displays) the fact that no value was stored.
literal
 A value expression that is either numeric, character string, or date.
USER
 The user name of the process that invokes interactive SQL or runs a
 program.
NULL
 A null value.
 5CURRENT_DATE
 DATE data type value containing year, month, and day for date
 'today'.
 5CURRENT_TIME
 TIME data type value containing hour, minute, and second for time
 'now'.
 5CURRENT_TIMESTAMP
 TIMESTAMP data type value containing year, month, and day for date
 'today' and hour, minute, and second for time 'now' currently defined
 in Rdb/VMS.
More Information
 A value to be stored in a column if the row that is inserted does not
 include a value for that column.  You can use literals, the NULL
 keyword, the current timestamp, or the user name as default values.

 If you do not specify a default value, a column inherits any default
 value from the domain.  If you do not specify a default value for
 either the column or domain, SQL assigns NULL as the default value.

add col constraint

 col-constraint =

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

Additional information available:

More Informationreferences clause

More Information
 The add-col-constraint clause specifies a constraint definition that
 applies to an existing column.  The syntax and explanation for the
 add-col-constraint clause are the same as for the col-constraint
 clause.

 The five types of column constraints are PRIMARY KEY, NOT NULL,
 UNIQUE, CHECK, and foreign key constraints.  Foreign key constraints
 are created with the REFERENCES clause.  You can also optionally
 specify a name for a constraint definition.

 The PRIMARY KEY column constraint declares a column to be a primary
 key.  SQL requires that values in this column be unique and not null.
 Therefore, you need not specify the UNIQUE and NOT NULL column
 constraints for a primary key column.

 The NOT NULL column constraint restricts values in the column to
 non-null values.

 The UNIQUE column constraint specifies that values in the column
 named must be unique.

 The CHECK column constraint specifies a predicate that column values
 inserted into the table must satisfy.  Predicates in CHECK table
 constraints can refer directly only to the column with which they are
 associated.

 The optional CONSTRAINT constraint-name specifies a name for a column
 constraint that is used in several ways:

  o  The INTEG_FAIL error message specifies the name when an INSERT,
     UDPATE, or DELETE statement violates the constraint

  o  ALTER TABLE DROP CONSTRAINT statements specify the name to drop a
     table constraint

  o  SHOW TABLE statements display the names of column and table
     constraints


 The name of the constraint is used in error messages and ALTER TABLE
 DROP CONSTRAINT, SHOW TABLE, DECLARE TRANSACTION and SET TRANSACTION
 statements.  The CONSTRAINT clause is optional.  If you omit the
 constraint name, SQL creates a name.  However, DIGITAL recommends
 that you always name column and table constraints.  The constraint
 names generated by SQL may be obscure and, in programs, may change
 between compilation and running.
references clause
 references-clause =

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

 Specifies the name of a column or columns that are a primary key or
 unique key in the referenced table.  When the REFERENCES clause is
 selected as a column-constraint, the column specified in the
 col-definition clause becomes a foreign key for the referencing table
 (the table being defined).  When the REFERENCES clause is selected as
 a table constraint, the column name or column names specified in the
 FOREIGN KEY clause become a foreign key for the referencing table.

 The referenced_table_name is the name of the table that contains the
 unique key or primary key referenced by the referencing table.  You
 must have the SQL access right REFERENCES or CREATETAB to the
 referenced table.

 For a column constraint, the referenced_column_name is the name of
 the column that is a unique key or primary key in the referenced
 table.  For a table constraint, the referenced_column_name is the
 name of the column or columns that are a unique key or primary key in
 the referenced table.  The unique key can be defined with either the
 UNIQUE or PRIMARY KEY keywords.  If you omit the
 referenced_column_name, the primary key in the referenced table is
 used.

sql and dtr clause

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





 Optional formatting clauses allow you to modify data displays or
 query characteristics for interactive SQL users and DATATRIEVE users.

 A query header specifies a string that interactive SQL or DATATRIEVE
 displays in place of the column name when it retrieves values from a
 column.  An edit string specifies a string that controls how
 interactive SQL or DATATRIEVE formats the display of values in a
 column.

 DEFAULT VALUE and QUERY NAME are active only from DATATRIEVE.

COLLATING_SEQUENCE_IS

 Specifies a new collating sequence for the named domain.

DROP_COLUMN

 The DROP COLUMN statement deletes the specified column.

DROP_CONSTRAINT

 The DROP CONSTRAINT statement deletes the specified column constraint
 or table constraint from the table definition.

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026