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: Iterating through array as input parameter to stored procedure.

Re: Iterating through array as input parameter to stored procedure.

From: Serge Rielau <srielau_at_ca.ibm.com>
Date: Mon, 05 Jun 2006 15:55:30 -0400
Message-ID: <4ejggvF1ebgbeU1@individual.net>


asgars_at_gmail.com wrote:
> Hi,
> I am passing an array into a stored procedure. Now i want to iterate
> through this array. This can very well be done by For Loop.
> But my problem is:
> I have to run the SELECT query based on each element in array (i.e. as
> many times as the number of elements in the array) and i want to
> accumulate all the rows retreived from each query into a cursor so that
> i can get it into a Dataset finally.
> I am stuck as donno how to proceed in this....
> Please can anyone help..?
>
> Or is there a better way to do it??
>

I would cast the VARRAY into a TABLE and join the beast with that subquery. Let the DBMS system worry whether nested loop join is really the right approach (which is what you force by keeping it in PL/SQL).

just my 2 cents as a theoretician
Serge

-- 
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ondemandbusiness/conf2006/
Received on Mon Jun 05 2006 - 14:55:30 CDT

Original text of this message

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