Sudhakar wrote:
 
> Could any one please tell me how to get the last inserted value for a
> sequence generator.
> 
> I inserted a record using sequence.NEXTVAL.
> 
> How to use sequence.NEXTVAL and sequence.CURRVAL combination 
> to get the last
> inserted id. I have gone thorugh
> 
> http://www.sapdb.org/how_tos/numbergen/createsequenceanweisung_eng.htm
page
> but couldn't find out
>
> how to use.

sequence.CURRVAL   IS    the last inserted id
==>
INSERT INTO <tabname> VALUES (<values>, sequence.NEXTVAL, <values>)

and then

SELECT sequence.CURRVAL INTO :last_id FROM DUAL
   or
INSERT INTO <tabname_2> VALUES (<values>, sequence.CURRVAL, <values>)

Elke
SAP Labs Berlin
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to