This is the .sh script:
#!/bin/sh
LFPD=`TZ=CST date +%Y%m%d` #PROCESS_DATE
LFFD=`TZ=CST+24 date +%Y%m%d` #FOR_DATE
LFN="${LFFD}_detain_${LFPD}"
LFP=/:/detain/sd12/logs
LF=$LFP/$LFN.log
VALUE=`sqlplus -s sd12@phenix97/sd12 @detain.sql`
if [ -z "$VALUE" ]; then
echo "No Rows Copied"
exit 0
else
echo $VALUE >> $LF #LOG_FILE
fi
exit 0
so, the log file reads the output from 'detain.sql' which is:
sd12@phenix97:/detain/sd12/logs > cat detain.sql | more
insert into schema.table1 (select * from
schema.table1@DF_DBLINK.WORLD where for_date = to_date(trunc((sysdate)-1)));
commit;
insert into schema.table2 (select * from
schema.table2@DF_DBLINK.WORLD where for_date = to_date(trunc((sysdate)-1)));
commit;
.
.
.
.
insert into schema.tablen (select * from
schema.tablen@DF_DBLINK.WORLD where for_date = to_date(trunc((sysdate)-1)));
commit;
exit
Does the /n (new line) go in b/w each insert statement? I rem'ber trying that & it didn't work. Is there a way I can include something in the .sh to make $VALUE format in the way I orig. wanted? Please Advice