Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Nextval, Triggers and Inserts

Re: Nextval, Triggers and Inserts

From: Daniel A. Morgan <dmorgan_at_exesolutions.com>
Date: Fri, 02 Mar 2001 17:54:39 -0800
Message-ID: <3AA04EDE.2CD8DB33@exesolutions.com>

> I have written a function to retrieve the next value (BidNo) from a
> sequence.
> This BidNo should also reside in a table (Table1) which has only one field,
> the BidNo (which is a sequence).
> I pass the value back to an Access database and use it as part of a record
> in another table (Table2).
> When I go to insert the new record into Table2 it fails since the sequence
> value is not in Table1 as I suppose I have just selected it, not inserted
> it.
>
> My function uses this statement : SELECT seq_tblBidGenerator.nextval INTO
> BidNo FROM dual;
>
> How do I retrieve the next value in a sequence AND insert it into a table
> with one field (which should trigger the next sequence) all at the same
> time, ensuring that the value retrieved from nextval is equal to the value
> inserted into Table1?

Your posting leaves me with more questions than answers. Where is table1, where is table2. Why on earth if you are good enough, technically, to write an Oracle function are you messing around in Microsoft Access? And why don't you just put your SELECT sequence.NEXTVAL into your insert statement in the first place.

Daniel A. Morgan Received on Fri Mar 02 2001 - 19:54:39 CST

Original text of this message

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