tag:blogger.com,1999:blog-8677649049588007585.post3198711446659820395..comments2023-06-18T16:15:22.432+01:00Comments on PL/SQL Challenge: Use REGEXP_SUBSTR to get line number on which error was raised?(408)Steven Feuersteinhttp://www.blogger.com/profile/16619706770920320550noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-8677649049588007585.post-21413504911529040732010-06-23T23:55:47.027+01:002010-06-23T23:55:47.027+01:00The bottom line is that the REGEXP_SUBSTR techniqu...The bottom line is that the REGEXP_SUBSTR technique will ONLY work with dynamically-executed statements, so it is not a general solution.Steven Feuersteinhttps://www.blogger.com/profile/16619706770920320550noreply@blogger.comtag:blogger.com,1999:blog-8677649049588007585.post-1704170420272248842010-06-19T11:27:44.562+01:002010-06-19T11:27:44.562+01:00Hi Steven,
I feel, DBMS_UTILITY.FORMAT_ERROR_BACK...Hi Steven,<br /><br />I feel, DBMS_UTILITY.FORMAT_ERROR_BACKTRACE is more reliable in tacing the EXACT line number<br />where error has occured.<br /><br />In the above example, the REGEXP_SUBSTR displays "error found in line 1", <br />where as the actual error is at line number four.Since identifier I_DONT_EXIST is not declared.<br />If we use the following in the EXCEPTION section,the exact line number can be get.<br /><br />DBMS_OUTPUT.PUT_LINE( DBMS_UTILITY.FORMAT_ERROR_BACKTRACE);<br /><br />Thanks,<br />Soumyakantsoumyakantahttps://www.blogger.com/profile/02460273880262440886noreply@blogger.com