Home » SQL & PL/SQL » SQL & PL/SQL » how to generate text file using spool command using Pl/SQL procedure
how to generate text file using spool command using Pl/SQL procedure [message #233545] Thu, 26 April 2007 09:21 Go to next message
rajareddy_24
Messages: 23
Registered: April 2007
Location: bangalore
Junior Member
How can use a SPOOL command with DBMS_OUTPUT.PUT_LINE with PL/SQL to produce text file on oracle client machine.
Re: how to generate text file using spool command using Pl/SQL procedure [message #233547 is a reply to message #233545] Thu, 26 April 2007 09:34 Go to previous messageGo to next message
BlackSwan
Messages: 25043
Registered: January 2009
Location: SoCal
Senior Member
>How can use a SPOOL command with DBMS_OUTPUT.PUT_LINE with PL/SQL to produce text file on oracle client machine.
You don't.
SPOOL is a SQL*PLUS command.
DBMS_OUTPUT is a PL/SQL procedure which runs inside the database serever system; which typically can not write to the disk on a client's PC.
Re: how to generate text file using spool command using Pl/SQL procedure [message #233556 is a reply to message #233545] Thu, 26 April 2007 10:30 Go to previous message
Michel Cadot
Messages: 64130
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
SQL> host type my_script.sql
>>>
spool my_output_file.lst
begin
  dbms_output.put_line('my result');
end;
/
spool off
<<<
SQL> @my_script
my result
SQL> host type my_output_file.lst
>>>
my result
<<<
SQL>  

Lines between >>> and <<< are added and result of "type" command.

Regards
Previous Topic: adding new colum / salary increase by 15% expressed
Next Topic: Find multiple stings in a CLOB
Goto Forum:
  


Current Time: Wed Dec 07 08:36:45 CST 2016

Total time taken to generate the page: 0.10939 seconds