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 -> Nextval, Triggers and Inserts

Nextval, Triggers and Inserts

From: <april.mcclellan_at_HydroOne.com>
Date: 2 Mar 2001 20:29:54 +0100
Message-ID: <2F96BE4C7CC6D211A55F0008C7A43976017424B6@OHSC-EX4>

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?

Probably simple.....

April McClellan

-- 
Posted from thor.hydroone.com [192.75.116.12] 
via Mailgate.ORG Server - http://www.Mailgate.ORG
Received on Fri Mar 02 2001 - 13:29:54 CST

Original text of this message

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