Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sequence numbers in Informix?

478 views
Skip to first unread message

Robert Randall

unread,
Aug 31, 1993, 11:34:20 AM8/31/93
to

I am a new user to the Informix line of products. As usual, the manuals
are a bit cumbersome. Could someone please tell me if Informix has a
sequence number generation facility. For example, in Oracle, you can
create a sequence and perform a select against it that returns the next
unique seqence number.

Thanks in advance for the help!


--
Robert Randall rob...@apertus.com
Apertus Technologies 612-828-0224 / 612-379-2678
7275 Flying Cloud Drive Eden Prairie, MN 55344

Dennis Pimple

unread,
Aug 31, 1993, 5:16:34 PM8/31/93
to
rob...@apertus.com (Robert Randall) writes:


>I am a new user to the Informix line of products. As usual, the manuals
>are a bit cumbersome. Could someone please tell me if Informix has a
>sequence number generation facility. For example, in Oracle, you can
>create a sequence and perform a select against it that returns the next
>unique seqence number.

>Thanks in advance for the help!

Informix supports a SERIAL datatype, which when inserted (with a value 0) will
insert the next highest number no prevously used in that table. See the SQL
manuals for more.


================
Dennis J. Pimple
Informix CSE / Denver

Dave Snyder

unread,
Sep 1, 1993, 6:54:20 AM9/1/93
to
In article <CCMr9...@apertus.com> rob...@ns.apertus.com writes:
}
} I am a new user to the Informix line of products. As usual, the manuals
} are a bit cumbersome. Could someone please tell me if Informix has a
} sequence number generation facility. For example, in Oracle, you can
} create a sequence and perform a select against it that returns the next
} unique seqence number.
}
Informix allows for SERIAL data types. When you insert a record that has
a 0 in the serial field into a table, Informix replaces that 0 with a unique
sequence number. The sqlca.sqlerrd[2] variable contains the number assigned
by the Informix engine.

A reminder...
sqlca.sqlerrd[2] for Informix-4GL
sqlca.sqlerrd[1] for Informix-ESQL/C

DAS
--
David Snyder @ Snide Computer Services - Folcroft, PA Current Release
is db4glgen-3.15
UUCP: ..!uunet!das13!dave INTERNET: dave....@snide.com

0 new messages