Re: Autogenerated Value
From: George Lewycky <gelewyc_at_nyct.com>
Date: 23 May 2006 14:56:44 -0700
Message-ID: <1148421404.143493.165150_at_j33g2000cwa.googlegroups.com>
Date: 23 May 2006 14:56:44 -0700
Message-ID: <1148421404.143493.165150_at_j33g2000cwa.googlegroups.com>
I agree SEQUENCE is probably your easiest solution for this unless you want it conditionally based.
I have some links and examples on my website also.
http://www.geocities.com/samoracle/swSequence.htm http://www.oracle.com/technology/products/rdb/pdf/0307_sequences.pdf
Creating and viewing user sequence numbers
SQL> create sequence crmemo_counter
2 minvalue 0
3 maxvalue 999999999999
4 start with 1
5 increment by 1
6 cache 20
7 /
Sequence created.
SQL> select * from user_sequences;
SEQUENCE_NAME MIN_VALUE MAX_VALUE INCREMENT_BY C OCACHE_SIZE LAST_NUMBER
------------------------------ --------- --------- ------------ - - ---------- ----------- CRMEMO_COUNTER 0 1.000E+12 1 N N 20 1 INVOICE_COUNTER 0 1.000E+12 1 N N 20 1 POR_REQ_NUMBER_S 1 1.000E+27 1 N N 0 100000 RA_TRX_NUMBER_1000_S 1 999999999 1 N Y 20 2
George
http://georgenet.net/oracle Received on Tue May 23 2006 - 23:56:44 CEST