By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,271 Members | 1,302 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,271 IT Pros & Developers. It's quick & easy.

how to captue oracle errors in log file in unix script

P: 5
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
Sep 8 '06 #1
Share this Question
Share on Google+
1 Reply

P: 5
hi

I got the solution.
Sep 8 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.