Connecting Tech Pros Worldwide Forums | Help | Site Map

how to captue oracle errors in log file in unix script

Newbie
 
Join Date: Sep 2006
Posts: 5
#1: Sep 8 '06
hi all

I am calling a procedure within script.Even if the prcoedure is not executed successfully. In log file it is recorded as procedure successfully executed .How to capture errors in log file

$SQP $clf_user_name/$clf_password@$db_server <<EOF> file_out_before.log
update table set col='a';
commit;
exec BatchImportCursor('$criteriano','$filename');
commit;
EOF

CREATE OR REPLACE PROCEDURE BatchImportCursor(CRITERIA_NUMBER VARCHAR2 , FILE_NAME VARCHAR2) IS
variable declaration
begin
:
:
exception when others then
:
:
end


but when i execute procedure in backend it gives me an error invalid sql statemetns or numeric or value error.These error has to be recorded in log file

I tried the coding given int this forum
$SQP $clf_user_name/$clf_password@$db_server <<EOF
whenever sqlerror exit 1
update table set col='a';
commit;
exec BatchImportCursor('$criteriano','$filename');
commit;
EOF

if [ $error -ne 0 ]; then
echo "Error" > error.log
fi

but when it execute the script it gives me an error expecting arguement.

How to capture the oracle statement errors in script

Help please

Newbie
 
Join Date: Sep 2006
Posts: 5
#2: Sep 8 '06

re: how to captue oracle errors in log file in unix script


hi

I got the solution.
Reply