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

Re: Returning data from temp_tables

From: DA Morgan <damorgan_at_psoug.org>
Date: Fri, 03 Aug 2007 13:16:55 -0700
Message-ID: <1186172213.701321@bubbleator.drizzle.com>


BGT wrote:
> 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;
>
> -- This Cursor works fine
>
> 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

If the concept behind this is that you are doing something in a manner you in another RDBMS product such as SQL Server push yourself away from the keyboard. Go to another computer and start with the Oracle concepts books at http://tahiti.oracle.com. Sybrand is absolutely correct.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Fri Aug 03 2007 - 15:16:55 CDT

Original text of this message

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