Identity in Informix

Viewed 2679

I'm using Informix and I want to create a table like this:

CREATE TABLE increment_table 
 (
    id SERIAL NOT NULL, 
    increment_column INTEGER IDENTITY (START WITH 2000, INCREMENT BY 1), 
    name VARCHAR(255) NOT NULL,
    PRIMARY KEY (id)
 );

But when I run the statement, the result is a syntax error after the INTEGER keyword. I suppose is because Informix does not support this keyword IDENTITY.

Can you help me in some ideas of how can I create an auto increment column, with this characteristics:

  1. The column need to increment automatically in every insert.
  2. The column isn't primary key.
  3. Allows me set the initial number of start and the value of increment.
  4. Can edit the value of the column.
  5. The table already have a serial column.
0 Answers
Related