Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> SEQUENCE Question...
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