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: A unique counter

Re: A unique counter

From: Alan Shein <alanshein_at_erols.com>
Date: Fri, 15 Oct 1999 15:40:39 -0400
Message-ID: <7u7vti$a71$1@autumn.news.rcn.net>


ROWID will not work. You need to create a sequence, and use it to populate your id field.

CREATE SEQUENCE cust_id_seq INCREMENT BY 1 START WITH 1 ;

You then use it like this:

INSERT INTO customer (Name, Contact, ID) VALUES ('ACME PIANO COMPANY', 'WYLE E COYOTE', cust_id_seq.NEXTVAL); Received on Fri Oct 15 1999 - 14:40:39 CDT

Original text of this message

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