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
 
Back
Top