Hi I tested the Refactor function where you can let TOAD (12.5.1.1 for Oracle) convert decode-statements into CASE statements.
Luckily I did some testing before production and I found errors in the converted code.
Try this:
select decode(:var,null,‘Nothing’,‘Value’) from dual
If :var is null, the the result should be ‘Nothing’
TOAD converted this into : SELECT CASE WHEN :var = NULL THEN ‘nothing’ ELSE ‘Value’ END FROM DUAL;
The clause “WHEN :var = NULL” will always return ‘Value’ even if :var is null. The correct syntax should be “WHEN :var is NULL”.
Pls fix…
Jens