2016-01-12 58 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