NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
D-25
DEFAULT Clause
literal
is a literal of a data type compatible with the data type defined for the associated
column.
For a character column, literal must be a string literal of no more than eight
bytes or the length of the column, whichever is less. If the character column is
associated with a double-byte character set, literal must contain an even number
of bytes. SQL pads literal with spaces (HEX 20) when inserting the value into
longer character fields. (SQL always uses HEX 20 for padding, whether a single-
byte or double-byte character set is associated with the expression.)
For a numeric column, literal must be a numeric literal that does not exceed the
defined length of the column. The number of digits to the right of the decimal point
must not exceed the scale of the column and the number of digits to the left of the
decimal point must not exceed the number in the length (or length minus scale, if
you specified scale for the column).
For a date-time column, literal must be a date-time literal with a precision that
matches the precision of the column.
For an INTERVAL column, literal must be an INTERVAL literal that has the
range of INTERVAL fields defined for the column.
CURRENT
(date-time columns only) specifies that the default value for the column is the
appropriate portion of the Guardian timestamp at the time of the operation that
assigns a value to the column.
If more than one date-time column is assigned a CURRENT default value in the
same operation, SQL uses the same timestamp as the basis of all CURRENT values
assigned in the operation, no matter how long the operation takes.
SYSTEM
specifies that the default value depends on the data type of the column, as follows:
NULL
specifies the null value as the default. Specifying NULL as the default adds two
bytes to the size of the column.
Data Type Default Value
Character
Fixed-length A string of blanks
Variable-length A zero-length string
Date-time Same as CURRENT option
Interval 0
Numeric 0