Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SQL Plus Error Logging

jshaJan 4 2013 — edited Jan 6 2013
Hi,

I am having trouble logging the sql errors from sqlplus. I am executing a sql script from a bat file using sqlplus with following command: sqlplus dbusrid/dbpass @export_data.sql >> log.log
The script is outputting the results of a select to a csv file using spool as follows:

set echo off
set feedback off
set pagesize 0
set termout off
set heading off
set trimspool on

spool c:\temp\output.csv

select col1 || ',' || col2 || ',' || col3 from
table;

spool off

If a sql error occurs then the output.csv is populated with the error. Is it possible to populate an error log with sql errors instead of or in addition to the output.csv?
Ideally I would like all error output to be logged in the log.log file which is being populated from the bat file cmd mentioned above.
I am new to oracle and sqlplus so Im sorry if this is a trivial question but I cannot seem to find the correct method.

Thanks,

J

Edited by: user1099073 on Jan 3, 2013 10:53 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 3 2013
Added on Jan 4 2013
2 comments
1,111 views