Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle don't seem to have counter (serial) field ?

Re: Oracle don't seem to have counter (serial) field ?

From: R. Alan Popiel <alan_at_ast.lmco.com>
Date: 1997/01/31
Message-ID: <5ct6k6$m9d@tel.ast.lmco.com>#1/1

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US