I’ve just started using DBMS_UTILITY.FORMAT_ERROR_BACKTRACE and it’s a great utility when the code contains no comments, but unless I’m missing something it’s not terribly useful with regard to pinpointing the exact line number when the code contains comments.
Did you try it out? That's the best way to learn!
CREATE OR REPLACE PROCEDURE comments_throw_off_line# IS /* Here's my header Blah blah blah */ BEGIN DBMS_OUTPUT.put_line ('wow!'); /* And here's another comment because I really love to fill my code with meaningless comments! */ RAISE PROGRAM_ERROR; /* This is line 14 */ EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.put_line (DBMS_UTILITY.format_error_backtrace); END;
BEGIN comments_throw_off_line#; END;wow!ORA-06512: at "COMMENTS_THROW_OFF_LINE#", line 14