-
I've written a sql to run a few heartbeat checks on our oracle database. Within the sql I've added a spool command. I'd like the filename to include the today's date so that it does not overwrite other outputs from the previous days. A batch file will run the sql. Here is the sample:
spool u:\oracle\analyzescripts\heartbeat×tamp.lis
--
--
spool off
Haven't run the script yet but would like to know if I've missed anything. Will this work with batch files?
Thanks
x indicates an ampersand.
[Edited by pando on 03-18-2002 at 09:14 AM]
-
Duplicate Thread, closing.
-
ops I deleted the other one :p
anyways it should be smth like
define s_srd1=srd1
define s_spool=c:\tmp\monitor\
column today new_value _date
select to_char(sysdate, '_yyyy_fmmonth_dd') today
from dual;
spool xs_spoolxs_srd1x_DATE
x indicates an ampersand
-
make a batch that will run sql 1:
sql 1:
------------------------------------------
alter session set nls_date_format='whatyouwant';
set head off
spool aaa.sql
select 'spool u:\oracle\analyzescripts'||sysdate||'.lis' from dual;
select '@sql2' from dual;
select 'spool off' from dual;
spool off
set head on
@aaa.sql
----------------------------------------------------------
sql2 being the script you want to launch
Hope it helps
Cheers
Fabien
-
Thanks for the prompt reply. I prefer using this forum as one gets replies as soon as a question is posted. Thanks everyone for all your hard work.