Toad World® Forums

Malfunction of Code Analysis Rule 5809

Just look that screenshot - the code anaylsis warning is worthless since the selected values don't have their origin in a table:

And here - for copy & paste - the code again as text:

DECLARE
V_HURZ PLS_INTEGER := 42;
V_BURPS PLS_INTEGER;
BEGIN
SELECT V_HURZ INTO V_BURPS FROM DUAL D;
END;

Hi Don,

The Code Analysis Rule is functioning correctly. Its purpose is to let you know when columns are being used in a SELECT statement but are not fully qualified. The fact that you're pulling from DUAL doesn't change the fact that the columns are unqualified and part of a SELECT statement. That doesn't mean you have to qualify them -- the rule is simply a warning to help you identify potential problem areas in code. The hint itself also includes the phrase "when needed". In this case, qualifying the column names isn't needed and the warning can be ignored.

-John

Hi John,

my opinion is a bit different. If you look into my code snippet again, you can see that there is no selection of any column, but the use of a PL/SQL variable in the select statement which is declared at the beginning of the code. So, there is not "no need" to qualify the variable, it's just impossible. The code analysis rule should distinguish between table / view / mat.view columns and variables. I'm not sure, but I think that the behaviour of the rule was different in TOAD 12.12...

Best regards
Rainer aka Don