Sybase IQ now supports IDENTITY columns. An IDENTITY or AUTOINCREMENT column is a unique identifier for incoming data. It acts as a primary key for data that has no other primary key. The column stores a sequential value—for example, an invoice number or employee number—that is generated automatically and is never reused, even when rows are deleted from the table.
Many applications require a unique identifier, so that a unique record can be created for data coming into the database from multiple sources at different times of the day. An identity column is an easily maintained means of providing a unique identifier, and is consistent with Adaptive Server Enterprise.
Sybase IQ supports a single IDENTITY/AUTOINCREMENT column per table.
To insert values into or to update an IDENTITY/AUTOINCREMENT column, you must set the IDENTITY_INSERT option equal to the tablename. For example, if you use the table employees to run explicit inserts:
SET TEMPORARY OPTION IDENTITY_INSERT = 'employees'
To create a unique HG index on each IDENTITY_INSERT column you must set the IDENTITY_ENFORCE_UNIQUENESS option ON.
For more information, see CREATE TABLE statement, IDENTITY_INSERT option, IDENTITY_ENFORCE_UNIQUENESS option, and “Global variables” in the Sybase IQ Reference Manual.