blob: b0d967f439c9ee00830ce8977b36a4c6cbe6ab69 [file] [log] [blame]
4.14.4 Identity columns
The columns of a base table BT can optionally include not more than one identity column. The declared type of an identity column is either an exact numeric type with scale 0 (zero), INTEGER for example, or a distinct type whose source type is an exact numeric type with scale 0 (zero). An identity column has a start value, an increment, a maximum value, a minimum value, and a cycle option.
An identity column is associated with an internal sequence generator SG. Let IC be the identity column of BT. When a row R is presented for insertion into BT, if R does not contain a column corresponding to IC, then the value V for IC in the row inserted into BT is obtained by applying the General Rules of Subclause 9.21, "Generation of the next value of a sequence generator", to SG. The definition of an identity column may specify GENERATED ALWAYS or GENERATED BY DEFAULT.
NOTE 24: "Start value", "increment", "maximum value", "minimum value", and "cycle option" are defined in Subclause 4.21, "Sequence generators".
NOTE 25: The notion of an internal sequence generator being associated with an identity column is used only for definitional purposes in this International Standard.