2016-01-12 57 views
0

我打電話我的shell腳本.sql文件到滑N無文件... 樣品看起來像如何從.sql文件寫入到LOG_MSSG shell腳本

SPOOL ON; 

..... -->file 1 

SPOOL OFF; 

SPOOL ON; 

.... -->file 2 

SPOOL OFF; 

SPOOL ON; 

..... --> file 3 

SPOOL OFF; 

SPOOL ON; 

.... --> file 4 

SPOOL OFF; 

現在我需要在這些卷軸之間寫日誌的消息......我怎樣才能做到這一點我的.sql文件裏面?

log message = "No of files :x" 

這裏:X是將具有表計數的值的變量。

+0

任何建議,請 – teepu

回答

0

您是否在尋找APPEND選項SPOOL

spool 'file1' ; 
...-> file1.sql 
spool off 
spool 'logfile.log' ; 
--> your log file 
spool off 
spool 'file1' APPEND; 
--> file1 again 
spool off