Toad Editor Navigator Conditional Define Bug

The Editor's Navigator doesn't seem to be able to handle nested conditional defines for versioning. It ends up showing nothing.

Open this simple example in the Editor, you'll see the Navigator is empty:

create or replace package P_TEST is
$IF DBMS_DB_VERSION.VER_LE_11 $THEN
$ELSIF DBMS_DB_VERSION.VER_LE_12_1 $THEN
  function Some12_1cOnlyCode return varchar2;
$ELSIF DBMS_DB_VERSION.VER_LE_12_2 $THEN
$ELSE
  function Some18cOnlyCode return varchar2;
$END
end;
/

create or replace package body P_TEST is
$IF DBMS_DB_VERSION.VER_LE_11 $THEN
$ELSIF DBMS_DB_VERSION.VER_LE_12_1 $THEN
  function Some12_1cOnlyCode return varchar2 is
  begin
    return '12.1c';
  end;
$ELSIF DBMS_DB_VERSION.VER_LE_12_2 $THEN
$ELSE
  function Some18cOnlyCode return varchar2 is
  begin
    return '18c';
  end;
$END  
end;
/

Thanks, Paul. I've logged this. The parser doesn't seem to like those empty IF/ELSIF. When I restructure that so that each path contains code then it parses OK.

1 Like

Thanks Michael, yes I suspected as much.

This approach to versioning is quite common; and unlike PL/SQL's if / else blocks, empty $IF/$ELSE/$ELSIF is syntactically allowed - even Oracle use this approach, so it would be great to get it addressed.

Hi Paul,

The problem were the "empty" conditional compilation directives (those with nothing between $THEN and $ELSE/ELSIF/END). I'm now seeing the following:

Is this correct now?

It's fixed in QP5.dll version 5.366, to show up soon.

Thanks,
Andre

1 Like

I just installed Toad 14.1.120.923 and the bug still exists. I take it this fix didn't make it into the 14.1 release?