Toad World® Forums

Unused variable not detected (related to MEMBER OF)

CREATE OR REPLACE PACKAGE BODY test_package AS
PROCEDURE x1 AS
TYPE tab IS TABLE OF NUMBER;
BEGIN
IF( 1 MEMBER OF NEW tab() ) THEN
NULL;
END IF;
END x1;

PROCEDURE x2 AS
** v_unused BOOLEAN; – not detected**
BEGIN
NULL;
END x2;
END test_package;
/

Peter,

You were probably expecting rule 6405 (“Avoid defining variables that are not referenced inside the program”) to catch this. This old legacy rule still has to be converted to XPath (QP-158) and this is scheduled to be done in around a month or two.

Thanks,
Andre

The about code is correctly flagged as of next (or next next) beta.

Thanks,
Andre