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: question on automating sequence numbers

Re: question on automating sequence numbers

From: TommCarr <tommcarr_at_aol.com>
Date: 1997/07/08
Message-ID: <19970708231800.TAA20396@ladder02.news.aol.com>#1/1

I do this within each package that inserts new records into a table. There is a procedure called AddRecord that looks like this:

Procedure AddRecord(

                     NewID     out     number,
                     Attr_1      in        whatever,
                     Attr_n      in        whatever );

This procedure is actually very simple. It performs whatever security checks that may be necessary (is this user allowed to create new records?) and executes the INSERT statement. The insert trigger performs data validation and, if the record passes, gets the NEXTVAL from the appropriate sequence and allows the insert. Back in the AddRecord procedure, we get the CURRVAL from the sequence and return it through the out parameter. As I said, really very simple.

Tomm Carr
In giving freedom to the slave we assure freedom to the free, honorable alike in what we give and what we preserve. ---- Abraham ByGod Lincoln Received on Tue Jul 08 1997 - 00:00:00 CDT

Original text of this message

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