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: Auto-increment sequence

Re: Auto-increment sequence

From: Bob Redding <bobreddi_at_bellsouth.net>
Date: Sun, 17 Nov 2002 11:01:06 -0500
Message-ID: <CPOB9.17167$dr6.1563@news.bellsouth.net>


Bottom line, if you need to have your primary keys (ids) sequential without gaps, don't use sequences. Use a control file instead and increment the id programmatically. This is what I do for invoice numbers, so auditors don't freak out.

"Mike Trozzo" <lock_and_load62_at_hotmail.com> wrote in message news:aqun2j$pr5$04$1_at_news.t-online.com...
> Hi,
>
> I wrote a sequence to generate unique ID numbers for a table, along with a
> before insert trigger. I'm also writing an application in Delphi to
access
> this database. I'm using 9i and Delphi 5.
>
> My problem is this: When I run the insert procedure, and come up against
a
> not null violation, the sequence increments anyway, and the next time I
> successfully insert a record, the previous number is skipped. How do I
> avoid this problem and keep the number in sequence?
>
> Thanks,
> Mike Trozzo
>
>
Received on Sun Nov 17 2002 - 10:01:06 CST

Original text of this message

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