Toad World® Forums

(Build 1824) Conditional Compilation Problems


#1

Hi

The problem I will report works in the previous Beta build.

1- When trying to run a big script it stopped with ORA-00900 in a function in a package body.
2- The outline and collapsing appears wrongly only after that function (with that function as the root)

I manage to find the reason for the error and to create a simple code example

CREATE OR REPLACE PACKAGE a
IS
FUNCTION b (a IN NUMBER)
RETURN NUMBER
$IF (DBMS_DB_VERSION.version=11 AND DBMS_DB_VERSION.release>2)
OR DBMS_DB_VERSION.version>11
$THEN
RESULT_CACHE
$END;

FUNCTION a (a IN NUMBER)
    RETURN NUMBER;

END a;

CREATE OR REPLACE PACKAGE BODY a
IS
FUNCTION b (a IN NUMBER)
RETURN NUMBER
$IF (DBMS_DB_VERSION.version=11 AND DBMS_DB_VERSION.release>2)
OR DBMS_DB_VERSION.version>11
$THEN
RESULT_CACHE
$END
IS
BEGIN
RETURN a;
END b;

FUNCTION a (a IN NUMBER)
    RETURN NUMBER
IS
BEGIN
    RETURN a;
END a;

END a;

If no conditional compilation is used ($IF…$END) it runs correctly.

Besides this I have 1 question:
From sometime to this part SQLNav seems to parse all the script before it start running it and stop if an error is found (I tried with “stop and error” on and off). Is there a way to avoid this?

Regards


#2

Nice pickup Filipe. The parser was broken by mistake after last beta release. We will try to address this if we can.

Thanks,
Vincent


#3

Hi again

I hope you can fix it before 6.3 launch, because we have lots of scripts with $IF and with this problem we cannot run them

Regards


#4

Hi

I’m not sure if you also noticed that in packages the collapsing code is not working in those elements that has condition compilation (for instance in the declaration of functions and procedures)

Filipe


#5

Hi Filipe,

We have fixed the issues you reported here. Please check out next release.

Thanks,
Vincent


#6

Great! Thanks