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 -> SEQUENCE Question...

SEQUENCE Question...

From: Kathy Graham <kathy_graham_at_hpl.hp.com>
Date: Mon, 05 Oct 1998 15:51:04 -0700
Message-ID: <36194D58.81094E01@hpl.hp.com>


Hi Folks;

    Doing my first full-blown project and have a quick question regarding sequences. I have established a sequence to create primary keys for a job-tracking application. I have successfully inserted a record using the sequence. So here is the question.

How do I get THAT record back for reporting purposes. I tried to do something along the lines of:

select * from job_info where job_id = job_numbers.currval

but received an error that the sequence did not belong there. I know that I could possibly do this in two statements maybe by pulling in the currval into a variable and then executing with the value of the variable, but I am trying to do this in a single SQL statment if it is possible.

Also, I am concerned about some strange behaviour I am seeing. Maybe due to caching? For example the last record used sequence number 10. NEXTVAL reports as 11 but CURRVAL is 7?????

In any case, any help I can get on getting my record back that I just inserted would be a big help. Thanks in advance....

Kathy Graham
kathy_graham_at_nomail.hpl.hp.com <----remove nomail for replies Received on Mon Oct 05 1998 - 17:51:04 CDT

Original text of this message

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