SQL/MX 2.x Reference Manual (H06.04+)

SQL/MX Clauses
HP NonStop SQL/MX Reference Manual540440-003
7-3
Considerations for DEFAULT
DEFAULT CURRENT_TIME
specifies the default value for the column as the value returned by the
CURRENT_TIME function at the time of the operation that assigns a value to the
column. This default can occur only with a column whose data type is TIME.
DEFAULT CURRENT_TIMESTAMP
specifies the default value for the column as the value returned by the
CURRENT_TIMESTAMP function at the time of the operation that assigns a value
to the column. This default can occur only with a column whose data type is
TIMESTAMP.
DEFAULT {CURRENT_USER | USER}
specifies the default value for the column as the value returned by the
CURRENT_USER or USER function at the time of the operation that assigns a
value to the column. This default can occur only with a column whose data type is
fixed or variable length CHARACTER.
NO DEFAULT
specifies the column has no default value. You cannot specify NO DEFAULT in an
ALTER TABLE statement. See ALTER TABLE Statement on page 2-10.
Considerations for DEFAULT
Default Value on a CREATE TABLE Statement
When the DEFAULT clause for a column is not specified, the column definition and the
NOT_NULL_CONSTRAINT_DROPPABLE_OPTION in the SYSTEM_DEFAULTS table
affects the default value in these ways:
See CREATE TABLE Statement on page 2-74.
Column Definition Default Value
column data-type Default null.
column data-type
NOT NULL DROPPABLE
Default null.
column data-type
NOT NULL NOT DROPPABLE
No default.
column data-type
NOT NULL
Default null when NOT_NULL_
CONSTRAINT_DROPPABLE_OPTION is
set to ON.
column data-type
NOT NULL
No default when NOT_NULL_
CONSTRAINT_DROPPABLE_OPTION is
set to OFF (the default).