Setting a DEFAULT
Value
The optional DEFAULT
clause allows you to specify the default value for the table column.This value will be added to the column when an INSERT
statement is executed and that column was omitted from the INSERT
command or DEFAULT
was used instead of a value expression.The default value will also be used in UPDATE
when DEFAULT
is used instead of a value expression.
The default value can be a literal of a compatible type, a context variable that is type-compatible with the data type of the column, or NULL
, if the column allows it.If no default value is explicitly specified, NULL
is implied.
An expression cannot be used as a default value.