简体   繁体   中英

How to write LOG_MSSG from .sql file to shell script

I am calling a .sql file in my shell scripting to SPOOL n no of files... the sample look like

SPOOL ON;

..... -->file 1

SPOOL OFF;

SPOOL ON;

.... -->file 2

SPOOL OFF;

SPOOL ON;

.....  --> file 3

SPOOL OFF;

SPOOL ON;

....  --> file 4

SPOOL OFF;

Now I need to write log message in between these spools... How can I achieve that inside my .sql file?

log message = "No of files :x"

Here :X is a variable which will have a value of table count.

Are you looking for APPEND option for SPOOL ?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM