Oracles @@Identity?

  • Thread starter Thread starter SDF
  • Start date Start date
S

SDF

Is there an equivalent? I have a sequence set up to create me a unique ID,
but I need to return that too!

Thanks,

Scott
 
Hi,

You should be able to select the CURRVAL from the sequence right after the
insert. For instance: select <mysequencenamegoeshere>.CURRVAL from dual;
AFAIK there is no true equivalent to @@Identity in Oracle

I hope this helps.
----------------------------------
 
SDF said:
Is there an equivalent? I have a sequence set up to create me a unique
ID,
but I need to return that too!

The most direct equivilent is my_sequence.currval. This will return the
last my_sequence.nextval that your session retrieved.

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top