|
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
|