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: append a cursor (URGENT)

Re: append a cursor (URGENT)

From: DA Morgan <damorgan_at_x.washington.edu>
Date: Fri, 04 Feb 2005 17:47:06 -0800
Message-ID: <1107567862.959763@yasure>


sonukapoor_at_gmail.com wrote:

> Hello,
>
>
> I am using a stored procedure, which gets an array passed. Now I need
> to run the Select statement for each of the items in the array and
> return the complete result. Here is how it looks like:
>
> CREATE OR REPLACE PACKAGE BODY CUSTOM.MYPACK2 AS
> PROCEDURE Array_test(p_array IN numarray, thecur out outcur)
> IS
> i number;
> BEGIN
>
> for i in 1 .. p_array.count loop
> open thecur for
> SELECT
> somefield
> from
> sometable
> where
> someotherfield in (p_array(i))
> end loop;
> END Array_Test;
>
> END MYPACK2;
>
> However this returns me only the result for the last entry from my
> array. I think its because the cursor get overridden each time. Now Is
> it possible to append the cursor so that I can get the complete result
> or is there any other to achieve this?
>
> Please help this is very Urgent for me.
>
> Thanks in advance

http://www.psoug.org
click on Morgan's Library
click on CAST

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace 'x' with 'u' to respond)
Received on Fri Feb 04 2005 - 19:47:06 CST

Original text of this message

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