Amit:
Yes, absolutely. You have to declare the column type to be one of:
SERIAL - 4 byte integer compatible auto-incrementing data type. Range: -2^31 to 2^31-1
SERIAL8 - 10 byte INT8 compatible auto-incrementing data type. Note that the range of SERIAL8 is the same as BIGSERIAL which only uses 8 bytes and so is preferred.
BIGSERIAL - 8 byte BIGINT compatible auto-incrementing data type. Range: -2^63 to 2^63-1
A table can have at most one of each auto-incrementing type column. If you insert a zero or fail to insert to any of the serial type columns the next sequential value is automatically inserted. Sequences were added to Informix for compatibility with Oracle and are mainly used when the same set of values is needed to be unique across multiple tables in Informix. Serial types are preferred.
Art
------------------------------
Art S. Kagel, President and Principal Consultant
ASK Database Management Corp.
www.askdbmgt.com------------------------------
Original Message:
Sent: Thu June 10, 2021 06:22 AM
From: AMIT PATEL
Subject: AUTO INCREMENT Value
Hello All,
I'm working on Informix 11.70.
I have created an sequence and for incremented value I'm using (Sequence_name.nextval) every time.
But is possible in Informix that if I enter '0' or NULL then also field value should increment automatically by 1 or any integer value.
Kindly suggest.
Thanks
Amit Patel
------------------------------
AMIT PATEL
------------------------------
#Informix