Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: question on automating sequence numbers
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
![]() |
![]() |