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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Plus spool

Status
Not open for further replies.

pzom

Programmer
Joined
Oct 29, 2000
Messages
7
Location
US
I have these files:

========================================
BATCH1.BAT which contains:
@ECHO OFF

d:\oracle\ora81\bin\SQLPLUSW.EXE user/password@orcl1 @d:\dir1\sql_programs\JOB1.sql
========================================


========================================
and JOB1.SQL which contains:

set serveroutput on size 1000000
col x noprint new_value _x
select 'd:\dir2\sql_programs\logs\LOG_' || to_char(sysdate, 'YYYYMMDD') || '.LOG' x FROM DUAL;
column dat1 new_value filename;
spool &_x
execute SCHEMA1.PACKAGE1.PROC1;
spool off;
exit;
========================================


This would create a log LOG_YYYYMMDD.LOG into the directory. This job runs every 10mins everyday.

However, it overwrites the previous file that was created. I wanted to have just 1 file generated for each day. How would I modify the scripts so it would append new log instead of overwritting.

Thanks,
Pzom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top