SQL/MX 3.2 Reference Manual (H06.25+, J06.14+)

SQL/MX Statements
HP NonStop SQL/MX Release 3.2 Reference Manual691117-001
2-101
Syntax Description of CREATE TABLE
HEADING 'heading-string'| NO HEADING
specifies a string heading-string of 0 to 128 characters to use as a heading for
the column if it is displayed with a SELECT statement in MXCI. The heading can
contain characters only from the ISO88591 character set. The default heading is
the column name. If you specify a heading that is identical to the column name,
INVOKE and SHOWDDL do not display that heading.
If you specify NO HEADING or HEADING ‘’, NonStop SQL/MX stores this as
HEADING ‘’, and the column name is displayed as the heading in a SELECT
statement. The behavior for HEADING ‘’ is different from that of NonStop SQL/MP,
which does not display anything for a heading in a SELECT statement if the
heading is specified as HEADING ‘’.
CONSTRAINT constraint
specifies a name for the column or table constraint. constraint must have the
same catalog and schema as table and must be unique among constraint names
in its schema. If you omit the catalog portion or the catalog and schema portions of
the name you specify in constraint, NonStop SQL/MX expands the constraint
name by using the catalog and schema for table. See Database Object Names
on page 6-13.
If you do not specify a constraint name, NonStop SQL/MX constructs an SQL
identifier as the name for the constraint in the catalog and schema for table.The
identifier consists of the fully qualified table name concatenated with a system-
generated unique identifier. For example, a constraint on table A.B.C might be
assigned a name such as A.B.C_123..._01... . Use the SHOWDDL statement to
display this generated constraint name. See SHOWDDL Command on page 4-82.
NOT NULL [[NOT] DROPPABLE]
is a column constraint that specifies that the column cannot contain nulls. If you
omit NOT NULL, nulls are allowed in the column. If you specify both NOT NULL
and NO DEFAULT, each row inserted in the table must include a value for the
column. See MXCI Parameters
on page 6-77 and Null on page 6-80.
DROPPABLE specifies that you can drop the NOT NULL constraint by using
ALTER TABLE at some later time. Dropping NOT NULL requires that you know the
name of the constraint, either by using the CONSTRAINT constraint clause
when the table is created or by using SHOWDDL to display the constraint name.
NOT DROPPABLE specifies that the NOT NULL constraint is permanent. Less
space is required to store a column if the column has a permanent NOT NULL
constraint, and updates and inserts are faster.
If the NOT NULL constraint does not include the [NOT] DROPPABLE clause, the
value of the NOT_NULL_CONSTRAINT_DROPPABLE_OPTION attribute in the
SYSTEM_DEFAULTS table is the default value for [NOT] DROPPABLE. If that
attribute does not exist in the SYSTEM_DEFAULTS table, DROPPABLE is used.