The Oracle stack trace line number does not match the source code!

I got a stack trace from Oracle saying that there was a problem on line 299. No problem, I looked at this line in the package in question and said that it is a line in the initialization block that sets the variable to 1 and does not call the procedure that caused the error.

There seems to be a mismatch between what the server is doing and what I see when viewing the source of the package, based on the line number in the stack trace.

As I looked at the package: I used PL / SQL Developer and clicked “View Pacakge” on the package name in the object browser. When I looked at the same package in the control source, the error on line 299 makes sense (this is a procedure call that failed).

So my question is: is WTF going on? Why am I getting source code that doesn't seem to match the stack trace line numbers when I query Oracle for the pacakge source?

(oracle 10g)

+3
source share
2 answers

So, it turned out that my script was referencing API_USR.SOME_PACKAGE, and I logged in as READONLY_USR, and READONLY_USRan older version SOME_PACKAGE. When I looked API_USR.SOME_PACKAGEthrough READONLY_USR, I got the correct source code.

face palm

+1
source

I think that you already have the source of this package open in the PL / SQL developer. When you select View Source again, it activates a previously opened editor without rebooting the source.

+1
source

Source: https://habr.com/ru/post/1784769/


All Articles