U kunt de where
. schrijven clausule als:
where (case when (:stateCode = '') then (1)
when (:stateCode != '') and (vw.state_cd in (:stateCode)) then 1
else 0)
end) = 1;
Of verwijder de case
volledig:
where (:stateCode = '') or
((:stateCode != '') and vw.state_cd in (:stateCode));
Of, nog beter:
where (:stateCode = '') or vw.state_cd in (:stateCode)