If conditional compilation is used, the code formatter formats incorrectly:
CREATE OR REPLACE PACKAGE BODY test
AS
FUNCTION is_active
RETURN BOOLEAN
AS
l_n NUMBER;
BEGIN
$IF DBMS_DB_VERSION.ver_le_10
$THEN
SELECT COUNT(*) INTO l_n FROM DUAL;
$ELSIF DBMS_DB_VERSION.ver_le_11
$THEN
SELECT COUNT(*) INTO l_n FROM dual;
$ELSE
l_n = 0;
$END
RETURN (l_n > 0);
END;
FUNCTION is_available
RETURN BOOLEAN
AS
BEGIN
$IF DBMS_DB_VERSION.ver_le_10
$THEN
RETURN TRUE;
$ELSIF DBMS_DB_VERSION.ver_le_11
$THEN
RETURN true;
$ELSE
RETURN FALSE;
$END
END;
END;
If I've just the second function the formatting looks ok:
CREATE OR REPLACE PACKAGE BODY test
AS
FUNCTION is_available
RETURN BOOLEAN
AS
BEGIN
$IF DBMS_DB_VERSION.ver_le_10
$THEN
RETURN TRUE;
$ELSIF DBMS_DB_VERSION.ver_le_11
$THEN
RETURN TRUE;
$ELSE
RETURN FALSE;
$END
END;
END;
BR
Dirk