Re: Spooling from pl/sql procedure

From: Van Nieuwenhuyse <van_nieuwenhuyse_luytens_at_online.be>
Date: Thu, 7 Jan 1999 20:26:25 +0100
Message-ID: <7731t4$3g9$1_at_trex.antw.online.be>


You can not spool from within a procedure since ... the procedure is executed on
the server.

Instead you can use de dbms_output package (eg: dbms_output.put_line) to buffer output into memory, ounce the procedure finished the output will be printed
on your spool. Do not forget to execute the SET SERVEROUTPUT command first. Also you may need to enlarge the dbms_output buffer (see doc).

Other way is of course to use UTL_FILE_IO (but this only writes on files upon the
server).

Sunder heeft geschreven in bericht
<772v4l$6qg$1_at_news.fr.internet.bosch.de>...
>I am trying to spool the output of a select statement from inside a pl/sql
>procedure to a file. See below for the code. SPOOL does not work form
within
>a procedure.Can anybody tell me how I can accomplish this.
>
>
>declare
>mailid varchar2(100);
>cursor c1 is select name from table1;
>begin
> for orec in c1 loop
> spool file1.lis
> select * from table2 where name = orec.name;
> end loop;
>end;
>
>
>
Received on Thu Jan 07 1999 - 20:26:25 CET

Original text of this message