SQL Plus Error Logging
jshaJan 4 2013 — edited Jan 6 2013Hi,
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