Re: Nextval Question
Date: Tue, 3 Aug 1993 14:55:04 GMT
Message-ID: <CB6urt.FuE_at_vistachrome.com>
carmen_at_sra.com (Carmen Iannacone) writes:
> My question is, the only way I can get the sequence's current
> or next value is by issuing a query which includes the pseudo-
> column name in it. i.e. (SQL*Plus example) :
> SQL> select ticket.nextval from deli;
Try using DUAL instead of DELI. DUAL is a one-row table that might have the effect you desire.
> Do I have to create a special "one row" table and use that as the
> basis for the select? Are there other ways to access the pseudo-
> columns?
If you require guaranteed one-off sequence numbers, then yes you must use a special SEQUENCE table rather than a real SEQUENCE. All SEQUENCE does is guarantee uniqueness, not sequentialness.
Why? Because when you shutdown and startup the database, any cached values end up being toasted. You can run in NOCACHE mode on the sequence number, this is arguably ineffecient if you have a high service rate in your Deli. (Deli's here are busy busy busy.) :>
Andy
>------------------------------------------------------------------------
>Carmen Iannacone (703) 803-1544
>Associate Member of the Professional Staff 4300 Fair Lakes Court
>SRA Corporation Suite 500
>Fairfax, Virginia Fairfax, Va. 22033
-- Andrew Finkenstadt | andy_at_{homes.com,vistachrome.com,genie.geis.com} Systems Analyst | Vista-Chrome, Homes & Land Publishing Corporation | 1600 Capital Circle SW, Tallahassee Florida 32310 +1 904-575-0189 | GEnie Postmaster, Unix & Internet RoundTables SysopReceived on Tue Aug 03 1993 - 16:55:04 CEST