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

Home -> Community -> Usenet -> c.d.o.server -> Re: Complex PLSQL-JSP problem .

Re: Complex PLSQL-JSP problem .

From: Nuno Souto <nsouto_at_optushome.com.au.nospam>
Date: Sat, 29 Jun 2002 21:27:03 +1000
Message-ID: <3d1d9b01$0$28009$afc38c87@news.optusnet.com.au>


In article <77a43c6a.0206290014.2543c8d0_at_posting.google.com>, you said (and I quote):
>
> The ranking function is not a simple "ORDER BY". I apply a function to
> each of the rows in the supplier table. The supplier who satisfies my
> conditions the best is ranked first.

hmmmm, means PL/SQL in my mind.

>
> What is the best method of doing this via JSP?
>

I dunno. I don't understand JSPs that well. But you can always use a stored procedure called from your servlet or EJB and call it from the JSP?
> **Create a temporary table with the ranked suppliers and then populate
> from this temporary table. The temporary table is created by calling a
> Stored procedure.
> Now, how do i generate the temporary table name and make sure its
> unique?

Roundabout way, I'd say. But if you want a unique name, take your session id from v$session and your username from USER and concat both. Guaranteed to be unique.

>
> **PLSQL Table-- How do i return a PLSQL Table to populate a JSP page?

You use a REF CURSOR to return the result into JDBC. You use GetResultSet in the Java side. In PL/SQL, there is a trick to open a cursor in a PL/SQL table and return rows as if in normal SELECT. Can't remember it at the moment, maybe someone else can chip-in? IIRC, it has to do with the bulk stuff.

>
> Some sample code or tips is deeply appreciated.
>

Have a look at Tom's site and do a search there. I'm quite sure I've seen something about this there.

http://asktom.oracle.com/pls/ask/f?p=4950:1:

is the place. Don't ask what that fluff after "ask/" means...

-- 
Cheers
Nuno Souto
nsouto_at_optushome.com.au.nospam
Received on Sat Jun 29 2002 - 06:27:03 CDT

Original text of this message

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