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 -> Returning data from temp_tables

Returning data from temp_tables

From: BGT <bgt0990_at_optonline.net>
Date: Fri, 03 Aug 2007 12:10:21 -0700
Message-ID: <1186168221.081837.307170@w3g2000hsg.googlegroups.com>


I'm trying to retrieve the results from a temp table where I stored results gathered from a cursor but am having trouble. Below are the highlights of the code I'm trying to run. How can I get my results back from the temp-table and into a cursor to pass back to the caller. THERE IS LOTS OF WORKING CODE MISSING

       PROCEDURE list_mailable(maillist OUT return_cur) IS
      TYPE rec_table is TABLE of  result_master%ROWTYPE;

      result_temp           rec_table;

    c3rec result_master%ROWTYPE;

    c1rec C2rec.labno%type;

    OPEN list_cur FOR SQLString

            USING c1rec;
    LOOP
    FETCH list_cur INTO c3rec;
    EXIT WHEN list_cur%NOTFOUND;
    result_temp(vMailable) := c3rec;
    END LOOP; But everything I have tried to retrieve the rows back into another cursor has failed.

Failure #1

      open list_cur FOR select * from result_temp;
      loop
      FETCH LIST_CUR into maillist;
      EXIT WHEN list_cur%NOTFOUND;
      END LOOP;

Failure #2

      FOR x in 0 .. vMailable LOOP
      select *
      bulk collect into maillist
      from result_temp(X)
      END LOOP;

Failure #3
      FOR x in 0 .. vMailable LOOP
      FETCH result_temp(X) into maillist
      END LOOP;

Can anyone point me in the right direction?

Barry Received on Fri Aug 03 2007 - 14:10:21 CDT

Original text of this message

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