Use curval to obtain the last selected value for the current oracle
session. Note that you cannot access curval until nextval has been used
at least once in the current oracle session.
select user_seq.curval
from dual
Daniel Chacón Sánchez wrote:
Hi I know this the struts mail list, but I have a question and I hope
that
someone know the answer
I'm using an oracle database, I have a sequence to obtain the nextval
that
will be the key of the row that I will insert, after the insert I need to
know which is that value so I can tell the user with which value the
row was
inserted. Is there a sure fire way to do this, or am I stuck with "select
max(id) from table" and hope nothing else has been inserted in that few
milliseconds it takes to go from my insert statement to my select
statement?
Some code, for better explanation:
CREATE SEQUENCE user_seq INCREMENT 1 MINVALUE 0 NOMAXVALUE START WITH
0 NOCACHE
NOCYCLE
insert into users values (user_seq .nextval, 'userName');
Then I need to know the value with which the row was inserted, how can
I do
that
Thanks! Sorry fot the out of topic question
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]