A DEFAULT specification is formed by specifying the keyword DEFAULT and a DEFAULT value The maximum length of a default value is 254 characters.
<default_spec>
::= DEFAULT <literal> | DEFAULT NULL
| DEFAULT USER | DEFAULT USERGROUP | DEFAULT SYSDBA
| DEFAULT DATE | DEFAULT TIME | DEFAULT TIMESTAMP
| DEFAULT UTCDATE | DEFAULT UTCDIFF | DEFAULT TIMEZONE
| DEFAULT TRUE | DEFAULT FALSE
| DEFAULT TRANSACTION | DEFAULT STAMP
| DEFAULT SERIAL[(<unsigned_integer>)]
If a DEFAULT specification has been made for a column, the default value (<literal>, NULL, USER,...) must be a value that can be inserted in the column.
DEFAULT Specification |
Explanation |
DEFAULT <literal> |
The literal must be comparable with the data type of the column. |
DEFAULT USER |
Gets the user name of the current user and can only be specified for columns that have the data type [VAR]CHAR(n) or CHAR(n) (n >= 32) |
DEFAULT USERGROUP |
Gets the user group name for members of a user group, or the user name for users who do not belong to a user group. This DEFAULT specification can only be specified for columns that have the data type [VAR]CHAR(n) (n >= 32). |
DEFAULT SYSDBA |
Gets the name of the SYSDBA user and can only be specified for columns that have the data type [VAR]CHAR(n) (n >= 32) (from version 7.4.04.02) |
DEFAULT DATE |
Gets the current date and can only be specified for columns that have the data type DATE |
DEFAULT TIME |
Gets the current time and can only be specified for columns that have the data type TIME |
DEFAULT TIMESTAMP |
Gets the current timestamp and can only be specified for columns that have the data type TIMESTAMP |
DEFAULT UTCDATE |
Gets the current UTC timestamp (Greenwich Mean Time) and can only be specified for columns that have the data type TIMESTAMP (from Version 7.4.04.02) |
DEFAULT UTCDIFF |
Gets the time difference (in hours) between your local time and UTC time and can only be specified for columns that have the data type FLOAT(p) (p >= 4) or FIXED(p,s) (s >= 2, p >= s+2) (from Version 7.4.04.02). |
DEFAULT TIMEZONE |
Gets the time difference (in hours) between your local time and UTC time and can only be specified for columns that have the data type FLOAT(p) (p >= 6) or FIXED(p,s) (s >= 0, p >= s+6). (ab Version 7.4.04.02) |
DEFAULT TRUE/DEFAULT FALSE |
Can only be specified for columns that have the data type BOOLEAN |
DEFAULT TRANSACTION |
Gets the ID of the current transaction and can only be specified for columns that have the data type CHAR(n) BYTE (n>=8) |
DEFAULT STAMP |
Gets an eight-character value that is unique within the database system. Can only be specified for columns that have the data type CHAR(n) BYTE (n>=8). If a table is defined without a key column, the database system implicitly creates a key column SYSKEY CHAR(8) BYTE. The key values in the SYSKEY column are only unique within a table; that is, the SYSKEY column in two different tables may contain the same values. If you want a unique key across the entire database system, you can define a key column with the DEFAULT specification STAMP. |
DEFAULT SERIAL [(<unsigned_integer)]
|
Gets a number generator for positive integers and can only be specified for columns that have the data type INTEGER, SMALLINT, and FIXED without decimal places (SERIAL). The first value generated by the generator can be defined by specifying an unsigned integer (must be greater than 0). If this definition is missing, 1 is defined as the first value. If an INSERT statement inserts the value in this column, you get the current number generator value and not the value 0. Each table must not contain more than one column with the DEFAULT specification DEFAULT SERIAL. |