[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: returning a
I'm exploring how to implement something similar;
I'd like to design a thin JSP 'view' layer on top of PL/SQL business
logic that can return single values or result sets. I'm familiar with
CallableStatement returning a single value.
It's the returning a result set or array or ?? part of using
CallableStatement and PL/SQL that I don't have first hand experience
with. Any thoughts on how to return the result of a pl/sql of Select
foo, bar from baz where ... the result is a list.
The reason for this apparent odd design is simple. There's some value
in substituting PL/SQL's IAS feature with a JSP 'view' layer. FYI;
PL/SQL's IAS module allows HTML to be co-mingled with pl/sql down in
the data base. Oracle's IAS architecture was probably the worlds
simplest design, DB, business logic and view all in one component.
IAS works quite well actually and is very performant, but also very
monolithic.
Thanks, curt
sreekanth.munigati@ps.ge.com wrote:
>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
>
>
>
--
Curt Smith
csmith@javadepot.com
(w) 404-463-0973
(h) 404-294-6686