Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Procedure to show and spool all the results
jackfung188_at_gmail.com wrote:
> Hi All,
>
> I want to write a procedure which is able to spool all the select
> statement into a text file.
>
> eg. the result I want in the spool file:
> select * from customer where customer_id=xx;
> select * from order where customer_id=xx;
> select * from product where product_id=yy;
>
> The procedure should allows me to put the xx and yy value when i
> execute the procedure. I heard it's impossible to do unless using ref
> cursor? If so, how can I do it?
>
> Thanks.
You can't. Spool is not available in PL/SQL.
Look at UTL_FILE instead.
http://www.psoug.org
click on Morgan's Library
click on UTL_FILE
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace 'x' with 'u' to respond)Received on Tue Mar 22 2005 - 15:14:47 CST