Mar 5, 2010 5:01 AM
Need help in creating Log file
-
Like (0)
Hi All,
I want to create a log file for a sql script which is running from a file. Please help me to do that.
I tried with the below script.
----------------------------------------------------------------------------------------------------------
LOG_TEXT=`${NZ_DB_CONNECT} -A -t -f testing_script.sql`
echo $LOG_TEXT > DROP_TABLE_LOG.TXT
--------------------------------------------------------------------------------------------------------------
but the feedback message( or error message) from the sql script is not captured in the DROP_TABLE_LOG only the file gets created. please help me.
Thanks
Venkat
Hi Venkat,
Try
${NZ_DB_CONNECT} -A -t -f testing_script.sql -o log_txt
echo $LOG_TEXT > DROP_TABLE_LOG.TXT
The '-o <Output-filename>' option will send the output of the SQL script to the file.

