Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does PL/SQL Have an Equivalent for Spool ? 2

Status
Not open for further replies.

JohnBates

MIS
Feb 27, 2000
1,995
US
hi Oracle experts,

This may be the wrong forum for this question; if so, please let me know.

This is my crummy little procedure in a 10g database:
It was originally a command line script.

Notice the Spool CleanDB11.log line is inactivated. Apparently the Spool keyword is for SQL Plus and cannot be used in a procedure - is that correct?

Is there an equivalent keyword for Spool in PL/SQL ?

Thanks. John

--Spool CleanDB11.log


UPDATE AFTSCHINF SET DELETED_ON = sysdate where DELIND='Y' AND DELETED_ON is null;


DELETE FROM AFTSCHINF WHERE delind = 'Y' AND DELETED_ON < (SYSDATE -7);


COMMIT;
 
Spool CleanDB11.log line is inactivated. Apparently the Spool keyword is for SQL Plus and cannot be used in a procedure - is that correct?

That's correct. You can however, put, it before the start of the procedure and any output produced by the procedure will be written to the log file. Therefore, you could use dbms_output statements (with a "set serveroutput on") to produce some output from your procedure e.g.

Code:
spool test.log
set serveroutput on size 1000000

begin
   dbms_output.put_line('results');
end;
/

spool off
 
Dagon, that'w more like what I had hoped for - a workaround.

I may have questions about implementing your idea later.

Thanks. John
 
It's not really a workaround - this is exactly how the software is designed to work !


 
Thanks for this info Dagon. I had been searching for a way to spool in PL/SQL.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top