Line Numbers for PL/SQL code

Hi Greg, Tom,

I’ve had a quick look at the inability to jump to the error line using Tom’s anonymous block. When I introduce an error and run the code with F5, I get the pop-up that tells me there’s an error at line 34 in my case.

In the editor, my cursor jumps to line 3, DECLARE, and highlights it. But this is line 3 and not line 34. Hmm.

If we go to the messages tab, after dismissing the pop-up, and click there, it causes the highlighted line to move back to line 3 (assuming I moved it of course).

Double clicking opens up the “jump to” edit area at the top of the screen.

I then select all and copy in the messages tab and past it into a editor. I see this:

[Error] ORA-00942: table or view does not exist
ORA-06512: at line 34
(3: 0): declare

Error at line 3

… SQL here …

ORA-00942: table or view does not exist
ORA-06512: at line 34

So that’s the problem, I think. Oracle is reporting that the error is actually at line 3 as well as at line 34. Line 34 doesn’t match a code line, in my case, because I have comments and blank lines to make the code readable. I suspect, but I’m guessing, that Toad picks up the bit with the (3: 0) in it, to get the line and column where the error occurred.

This could simply be a problem with an anonymous block of course, I haven’t done any rigorous testing to determine what circumstances Toad/Oracle get it wrong! :wink:

HTH