[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: returning a
1)Write a Procedure (PL/SQL) with declared OUT Parameter.
2)Create a CallableStatement and register the OUT parameter.
3)Execute the Statement and fetch the out parameter
Thanks
Sreekanth Munigati
-----Original Message-----
From: David Wible [mailto:davdouglas69@hotmail.com]
Sent: Thursday, April 17, 2003 3:50 PM
To: ajug-members@ajug.org
Subject: returning a
Hello to all. If I issue a script to Oracle how can I get this to work?
I need to set the "set serveroutput on" before running the statement. Which
I've commented out here...
//sql.append(" set serveroutput on; \n");
sql.append(" declare v_NewPKey NUMBER;\n");
sql.append(" BEGIN\n");
sql.append(" INSERT INTO LOCATION(LOCT_NAME) VALUES ('test loc') RETURNING
LOCT_ID INTO v_NewPKey;\n");
sql.append(" commit;\n");
sql.append(" dbms_output.put_line(v_NewPKey);\n");
sql.append(" end;\n");
The issue is we have a trigger inserting the nextval from a sequence and we
need to marshall back the v_NewPKey as a result set. Anyway to get this
done in one call?
thanks,
David
_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail