Можете да напишете where
клауза като:
where (case when (:stateCode = '') then (1)
when (:stateCode != '') and (vw.state_cd in (:stateCode)) then 1
else 0)
end) = 1;
Като алтернатива премахнете case
изцяло:
where (:stateCode = '') or
((:stateCode != '') and vw.state_cd in (:stateCode));
Или още по-добре:
where (:stateCode = '') or vw.state_cd in (:stateCode)