Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Return ROWID in Java
Hi all, I'm new to Oracle systems and I need a little help for build a Java
application using this db. I have to insert a new record and to retrieve the
current pk automatically created by a sequence associated to the field -
say: AccountID.
I think I can try to do it by executing a PL/SQL block of code, and then call it using a Java callable statement to retrieve the value, stored in a PL/SQL variable ... something like this:
declare
rid ROWID;
begin
insert into Accounts (AccountFirstName, AccountLastName, AccountLogin,
AccountPassword, AccountEmail) VALUES ('val',val','val','val','val') return
ROWID into rid;
end;
This piece of code doesn't work ... anyone can post me a suggestion or an example?
Thanks a lot! Massimo Received on Tue Feb 17 2004 - 08:17:51 CST