SQL/MP Reference Manual

HP NonStop SQL/MP Reference Manual523352-013
U-16
User-Defined Keys
Only direct relations are stored. Indirect relations can be determined by following a
path from one relation to another.
The lock length for the USAGES table is set to zero to indicate that the entire primary
key length should be used for locking.
Guardian names in USAGES are fully qualified and use uppercase characters. Names
of SQL programs in OSS files are stored as the corresponding ZYQ Guardian names,
not OSS pathnames.
User-Defined Keys
A user-defined primary key is made up of the columns specified in the PRIMARY KEY
clause of the CREATE TABLE statement when the table is created. Values for a
user-defined primary key must be unique within the table. Only a table stored in a
key-sequenced file can have a user-defined primary key.
Each column in the primary key has an ordering characteristic (either ascending or
descending) that determines the order for storing and retrieving the rows. If multiple
rows share the same value for the first column of the primary key, the value and the
ordering characteristic of the second column determines the order for storing or
retrieving the rows, and so forth.
The columns in a primary key cannot contain null values and cannot be updated.
The length of a primary key cannot exceed 255 bytes. To calculate the length of the
key, add the number of bytes in the columns that make up the key. For each
varying-length character column, add 2 to the byte count determined by the number
and size of the characters allowed in the column. (SQL uses the two additional bytes to
store the character count.)
The system does not generate a SYSKEY for a table that has a user-defined primary
key.
Utilities
SQLCI includes a variety of utilities that perform database maintenance tasks and that
access editors and other commonly used Guardian utilities from within an SQLCI
session.
These SQLCI commands access SQLCI utilities:
CLEANUP INVOKE
CONVERT LOAD
COPY MODIFY CATALOG
DISPLAY USE OF MODIFY LABEL
DOWNGRADE CATALOG MODIFY REGISTER
DOWNGRADE SYSTEM CATALOG PERUSE