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: Sequence.Nextval Question

Re: Sequence.Nextval Question

From: Matthias Gresz <GreMa_at_t-online.de>
Date: 1997/11/07
Message-ID: <63ug1h$amq$1@news02.btx.dtag.de>#1/1

Dianne Siebold wrote:
>
> We are using Oracle 7.3 and VB 5.0 for a C/S application. Within the
> database, we have created sequences to use when adding new records to the
> table. The problem is, when a record is added to a table and the
> SEQUENCE.NEXTVAL is used, how can that value be returned to the front end
> in order to add records to other tables with that value.
>
> It was suggested that SEQUENCE.CURRVAL will return the current value, but
> with 50+ users adding records to the table, it seems possible that between
> the NEXTVAL and CURRVAL, a user could add another record and the CURRVAL
> returned would be incorrect.
>
> Please let me know if you have run into this problem and how it can be
> resolved. TIA for any assistance.

Hi,

one workaround could be:

determing the nextval prior to inserting the record and removing the insert trigger and inserting the record with PK set to the known nextval.

If you'll get smarter solution I'd be very pleased to know about.

-- 
Regards

M.Gresz    :-)
Received on Fri Nov 07 1997 - 00:00:00 CST

Original text of this message

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