Re: HELP: How to generate sequential Primary Keys on a maste

From: Thomas Kyte <tkyte_at_oracle.com>
Date: 6 Apr 2002 11:23:36 -0800
Message-ID: <a8nhvo013oh_at_drn.newsguy.com>


[Quoted] In article <1018105530.6006snx_at_aleytys.pc.my>, philip_at_aleytys.pc.my says...
>
>In article <6asrau4lfelqqtptocr3h3hqbt1ccdncth_at_4ax.com>
>postbus_at_sybrandb.demon-verwijderdit.nl writes:
>>On Mon, 01 Apr 2002 16:09:51 GMT, IF <tlfbi98_at_terra.es> wrote:
>
>>>We cannot use Oracle Sequences because we cannot lose any value in the
>>>sequence. Therefore, in order to generate the sequential values for
>>>the primary key, we have to use a value stored in another table.
>
>>rubbish. Create sequence ... nocache ordered.
>
>So, um will a transaction rollback also rollback a sequence? There
>are certain occasions where your external auditor (unless it's AA)
>won't accept "That's the way sequences work" as a reason why there
>are missing numbers in your financial transactions.
>

[Quoted] and what happened in the "olden" days when people did it on paper and made a mistake and crumpled up the invoice and thru it out (like I do with checks in my checkbook).

[Quoted] Whatever the answer is -- do the same thing in your computer system -- create a "voided" invoice or whatever you need later, after the fact.

[Quoted] I don't see what sequential buys you -- even for an auditor. Heck, just issue "update invoice_table set invoice_number = rownum" when they walk in the door if you like. Using something else as the primary key of course (the invoice_id column is for the auditor who doesn't have a clue about computer systems, the primary key is for us). That would be easier then artificially trying to generate a sequence number without gaps in a high end OLTP system.

>Philip
>
>---=====================================================================---
> Philip Chee: Tasek Corporation Berhad, P.O.Box 254, 30908 Ipoh, MALAYSIA
> e-mail: philip_at_aleytys.pc.my Voice:+60.5.291.1011 Fax:+60.5.291.9932
> Guard us from the she-wolf and the wolf, and guard us from the thief,
> oh Night, and so be good for us to pass.
>--
> þ 20442.88 þ New mail not found. Start whine pout sequence? (Y/N)

--
Thomas Kyte (tkyte_at_us.oracle.com)             http://asktom.oracle.com/ 
[Quoted] Expert one on one Oracle, programming techniques and solutions for Oracle.
http://www.amazon.com/exec/obidos/ASIN/1861004826/  
Opinions are mine and do not necessarily reflect those of Oracle Corp 
Received on Sat Apr 06 2002 - 21:23:36 CEST

Original text of this message