Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle don't seem to have counter (serial) field ?
In article <32F0B672.7D32_at_siav.it>, SIAV srl <siav_at_siav.it> wrote:
>I'm an italian developer and I don't know oracle .
>There is a counter (serial) field in Oracle ?
>What is the equivalent in Oracle ?
>
>Replay ASAP at siav_at_siav.it ?
>Thank you ! Davide Mietto
The Oracle equivalent to the Informix serial datatype is called a "sequence". Each sequence is a pseudo-table with two columns, CURRVAL and NEXTVAL. Accessing sequence_name.nextval increments the sequence and returns the new value; accessing sequence_name.currval just returns the current value. Look in the SQL language reference under CREATE SEQUENCE.
Regards,
Alan
+---------------------------+-----------------------------------------------+ | R. Alan Popiel | Internet: alan_at_ast.lmco.com | | Lockheed Martin, SLS | Voice: 303-977-9998 || P.O. Box 179, M/S 3810 | Standard disclaimers apply. Cutesy ones, too. | | Denver, CO 80201-0179 USA | Your mileage may vary. Void where prohibited. |
+---------------------------+-----------------------------------------------+Received on Fri Jan 31 1997 - 00:00:00 CST