The following code can be compiled using SQL*Plus:
CREATE OR REPLACE PACKAGE my_test AS
some_exception EXCEPTION;
PRAGMA EXCEPTION_INIT ( some_exception, -20000 );
$IF TRUE $THEN $ELSE $END
END;
/
Â
However, compiling it with Toad 10.5.1.3 (F5 or F9 in the Editor) results in the following error:
Â
'[Error] Syntax check (3: 3): ERROR line 3, col 3, ending_line 3, ending_col 50: A EXCEPTION_INIT pragma can only appear in a routine or block specification'
By removing the line which uses Conditional Compilation ($IF), or by moving it before the PRAGMA, it allows the code to compile.