Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to get current program line number in exception?
In article <3cc6d2b6$0$233$ed9e5944_at_reading.news.pipex.net>, "Niall says...
>
>Tom Kyte suggests in his book that there is no way to do this short of not
>handling the exceptions. (p1181) if I read him correctly.
under normal circumstances -- 100% correct.
see
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:1932043078402
for non-normal stuff.
>"Vasily Poushko" <vasily_at_genesyslab.ru> wrote in message
>news:aa6bqk$i5t$1_at_octopus.co.ru...
>> Your answer is not correct.
>> Please check it by yourself.
>>
>> "Sunil" <sunil_franklin_at_hotmail.com> wrote in message
>> news:diyx8.4$Cv2.110_at_news.oracle.com...
>> > Will 'format_call_stack' help. It gives you the line number .
>> >
>> >
>> >
>> >
>> > "Vasily Poushko" <vasily_at_genesyslab.ru> wrote in message
>> > news:aa6aar$hgi$1_at_octopus.co.ru...
>> > > How to get current program line number in exception?
>> > >
>> > > Hello. I'd like to get current program line number, where raised
>> > exception.
>> > >
>> > > My code is:
>> > > create or replace procedure qqq
>> > > as
>> > > n varchar2(1) := '12';
>> > > begin
>> > > null;
>> > > exception when others
>> > > dbms_out.put_line(sqlerrm);
>> > > end;
>> > > /
>> > >
>> > > execute qqq;
>> > >
>> > > output will be:
>> > > ORA-06502: PL/SQL: numeric or value error: character string buffer too
>> > small
>> > >
>> > > but I would like to get:
>> > > ORA-06502: PL/SQL: numeric or value error: character string buffer too
>> > small
>> > > ORA-06512: at "SCOTT.QQQ", line 2
>> > > ORA-06512: at line 2
>> > >
>> > > How can I do this?
>> > >
>> > >
>> > >
>> >
>> >
>>
>>
>
>
-- Thomas Kyte (tkyte@oracle.com) http://asktom.oracle.com/ Expert one on one Oracle, programming techniques and solutions for Oracle. http://www.amazon.com/exec/obidos/ASIN/1861004826/ Opinions are mine and do not necessarily reflect those of Oracle CorpReceived on Wed Apr 24 2002 - 15:39:54 CDT
![]() |
![]() |