SQL/MX 3.1 Reference Manual (H06.23+, J06.12+)

SQL/MX Statements
HP NonStop SQL/MX Release 3.1 Reference Manual663850-001
2-15
Syntax Description of ALTER TABLE
enclosing it in double quotes. For example: mycat."sql".myview. See
Identifiers on page 6-56.
data-type
specifies the name and data type for the new column in the table.
data-type is the data type of the values that can be stored in column. See
Data Types on page 6-17.
DEFAULT default
specifies a default value for the column. The added column must have a
default value. You can declare the default value explicitly by using the
DEFAULT clause or you can enable null to be used as the default by omitting
both the DEFAULT and NOT NULL clauses. If you omit the DEFAULT clause
and specify NOT NULL, NonStop SQL/MX returns an error. For existing rows
of the table, the added column takes on its default value.
If you set the default to the datetime value CURRENT_DATE,
CURRENT_TIME, or CURRENT_TIMESTAMP, NonStop SQL/MX uses
January 1, 1 A.D. 12:00:00.000000 as the default date and time for the existing
rows.
For any row that is added after the column is added, if no value is specified for
the column as part of the add row operation, the column will receive a default
value based on the current timestamp at the time the row is added.
If you set the default value to USER, CURRENT_USER, or SESSION_USER,
NonStop SQL/MX uses " " (blank) as the default value for the existing rows.
For any row that is added after the column is added, if no value is specified for
the column as part of the add row operation, the column will receive the current
Guardian user ID for its value. See DEFAULT Clause on page 7-2.
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-string can contain characters only from the ISO88591
character set. The default heading is column, 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 ‘’.