plsql question on printing the line number when an exception occours
Hi All,
My database : oracle 10G
here is my question :
Explaining my problem using a simple procedure, such as :
create or replace procedure p_hello_world
as
[some variables declared]
begin
[lots of code here]
exception
when others
dbms_output.put_line('Exception occurred for procedure p_hello_world');
dbms_output.put_line('sqlerrm'||sqlerrm);
dbms_output.put_line('sqlcode'||sqlcode);
-- suppose I want to print the line number where the exception is occurred, could I do that, if yes please help me with this
end;
Now this is the same construct that I am using for my utility, I have a comment in the exception block above where I need to print the line number wherever the exception has occurred, now since I am using when others clause, my procedure would always succeed even if some exception occurs, but using this technique I am not able to quickly debug my code however printing the line number would help me a great deal, please help me with this as its going to save me from great trouble.
Regards
Rahul