Hi,
Parameter
| Parameter value |
|---|
| Oracle version | Enterprise Edition Release 11.2.0.1.0 - 64bit |
| OS | Linux Fedora Core 17 (X86_64) |
I would like to know, is there any way to force SQL*Plus to provide the actual line number in the source file whenever there is an error? I often put at the first line of my script SET SQLBLANKLINES ON so that I may be able to put several consecutive blank lines lines in my code (I do this sometimes, when I find it to be appropriate in order to make my code more readable or to group a sequence of instructions which I believe make their logical link more understandable for the reader)
Now the problem is that SQL*Plus ignores these blank lines and whenever there is an error, the line number provided in the error message, doesn't correspond to the actual line number in the source file but it seems to be the last non blank line in the file. Consider the following example:
SET SQLBLANKLINES ON;
DECLARE
var PLS_INTEGER := 10;
BEGIN
var := 20
END;
/
In the above code at line 9 (by counting also the blank lines) there is an error (no semicolon at the end of var := 20) but when I run the script in
SQL*Plus here is the error message that I get
SQL> @myscript.sql;
END;
*
ERROR at line 8:
ORA-06550: line 8, column 1:
PLS-00103: Encountered the symbol "END" when expecting one of the following:
* & = - + ; < / > at in is mod remainder not rem
<an exponent (**)> <> or != or ~= >= <= <> and or like like2
like4 likec between || multiset member submultiset
The symbol ";" was substituted for "END" to continue.
SQL>
So as you can see the error message indicate that the error was found at the line 8 whereas in the file it is really at the line 9
As long as the number of lines in the script is limited, this may not be a problem and one can find rapidly the actual line number in the code raising the error but for a code including hundreds (or even thousands) of lines and with many comments and blank lines, finding the actual line number given by SQL*Plus error message becomes tricky.
So my question: Is there any way to make SQ*LPlus trace correctly the line numbers as they appear in the source file?
Thanks in advance,
Regards,
Dariyoosh