Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Return ROWID in Java

Return ROWID in Java

From: Massimo <massimo.visman_at_tin.it>
Date: Tue, 17 Feb 2004 14:17:51 GMT
Message-ID: <jopYb.246730$VW.9927307@news3.tin.it>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US