Thank you Nitz and Zabach for your reply.
I modified your query a little bit as follows as I am working in java.
SELECT sequence.CURRVAL AS CURRVALID FROM DUAL. So I can directly get the
insertedid using the ResulSet.getInt("CURRVALID");
I assume DUAL is a system table which stores the CURRVAL for the sequence
generator. Correct me if I am wrong.
Thanks,
Sudhakar
----- Original Message -----
From: "Nitz, Matthias" <[EMAIL PROTECTED]>
To: "'Sudhakar'" <[EMAIL PROTECTED]>
Sent: Thursday, June 06, 2002 2:11 AM
Subject: AW: sequence generators and LAST_INSERTED_ID()
> Hi,
>
> the last inserted value is the current value of the sequence, therefor
just
> use the expression: myseq.CURRVAL where you need the current value of the
> sequence.
>
> Best regards
>
> Matthias
>
> > -----Urspr�ngliche Nachricht-----
> > Von: Sudhakar [mailto:[EMAIL PROTECTED]]
> > Gesendet: Donnerstag, 6. Juni 2002 00:15
> > An: [EMAIL PROTECTED]
> > Betreff: sequence generators and LAST_INSERTED_ID()
> >
> >
> > hi,
> >
> > 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.
>
> Any help is appreciated.
>
> Thank you
> Sudhakar
>
>
>
>
> _______________________________________________
> sapdb.general mailing list
> [EMAIL PROTECTED]
> http://listserv.sap.com/mailman/listinfo/sapdb.general
>
>
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general