struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Chacón Sánchez" <danielc...@gmail.com>
Subject Out of topic, Oracle SEQUENCE
Date Fri, 15 Sep 2006 16:17:12 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message