COLUMN_DEFAULT_AUTOINC variable

Specifies the column is auto incrementing.

Syntax
final byte ColumnSchema.COLUMN_DEFAULT_AUTOINC
Remarks

When using AUTOINCREMENT, the column must be one of the integer data types, or an exact numeric type. On an INSERT, if a value is not specified for the AUTOINCREMENT column, a unique value larger than any other value in the column is generated. If an INSERT specifies a value for the column that is larger than the current maximum value for the column, the value is used as a starting point for subsequent inserts.

In UltraLiteJ, the autoincremented value is not set to 0 when the table is created, and AUTOINCREMENT generates negative numbers when a signed data type is used for the column. Therefore, declare AUTOINCREMENT columns as unsigned integers to prevent negative values from being used.

The default value of existing tables can be determined by querying the system table TableSchema.SYS_COLUMNS's column_default column.

See also