Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 » UltraLiteJ » UltraLiteJ Reference » UltraLiteJ API reference » ColumnSchema interface



Specifies the column is auto incrementing.

final byte ColumnSchema.COLUMN_DEFAULT_AUTOINC

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