SQL/MX 3.1 Reference Manual (H06.23+, J06.12+)
SQL/MX Statements
HP NonStop SQL/MX Release 3.1 Reference Manual—663850-001
2-99
Syntax Description of CREATE TABLE
Syntax Description of CREATE TABLE
table
is the ANSI logical name for the new table and must be unique among names of
tables, views, SQL/MP aliases, and procedures within its schema. You cannot
specify a Guardian physical name although you can specify it with the LOCATION
clause.
column data-type
specifies the name and data type for a column in the table. At least one column
definition is required in a CREATE TABLE statement.
column is an SQL identifier. column must be unique among column names in the
table. If the name is an SQL/MX reserved word, you must delimit it by enclosing it
in double quotes. Such delimited parts are case-sensitive. For example: "join".
column cannot be SYSKEY if the clustering key contains SYSKEY.
data-type is the data type of the values that can be stored in column. A default
value must be of the same type as the column, including the character set for a
character column. See Data Types on page 6-17.
DEFAULT default | NO DEFAULT
specifies a default value for the column or specifies that the column does not have
a default value. See DEFAULT Clause on page 7-2.
identity-column-specification
specifies that the column is an IDENTITY column indicating that the system can
generate values for it using the internal sequence generator options. Nonstop
SQL/MX will generate unique values for this column by default. See IDENTITY
Column and Internal Sequence Generators on page 2-117 and Generating Values
for an IDENTITY Column on page 2-121.
GENERATED BY DEFAULT AS IDENTITY | GENERATED ALWAYS AS
IDENTITY
•
GENERATED BY DEFAULT AS IDENTITY
creates an IDENTITY column. This type accepts both system-generated values
and user-supplied values for the IDENTITY column. The system generates a
value for the IDENTITY column if the user does not provide one. The system
does not guarantee unique values for the IDENTITY column if the user
supplies a value for the IDENTITY column. The internal sequence generator is
created when an IDENTITY column is specified.
•
GENERATED ALWAYS AS IDENTITY
creates an IDENTITY column. This type accepts only system-generated
values. A user-supplied value is not allowed. The system guarantees unique










