Code Analysis: Rule 5914

I believe that the following example should not be marked with 5914 - Use untransformed column values in the WHERE clause.

DECLARE
tab dbms_sql.varchar2a;
BEGIN
tab(1) := ‘X’;

FOR i IN 1 … tab.COUNT LOOP
FOR c IN (
SELECT 1
FROM dual
** WHERE dummy = tab(i)**
)
LOOP
NULL;
END LOOP;
END LOOP;
END;

Hi Peter,

The implicit declaration in the FOR loop is missing. In the XPath expression, could you please replace the line

(VAR_DECL, CONST_DECL, TYPE_SPEC, EXCEPTION_DECL, CURSOR, CURSOR_SPEC/@value)

by

(VAR_DECL, CONST_DECL, TYPE_SPEC, EXCEPTION_DECL, CURSOR, CURSOR_SPEC, LOOP_INDEX_DECL)/QNAME/@value)

? If this helps then I’ll add it to the stock XPath base code.

Thanks!
Andre

[QP-1827]

Yes, this seems to work.

Thanks, it’s in.

Andre