Du kan skrive
where (case when (:stateCode = '') then (1)
when (:stateCode != '') and (vw.state_cd in (:stateCode)) then 1
else 0)
end) = 1;
Alternativt kan du fjerne sagen
helt:
where (:stateCode = '') or
((:stateCode != '') and vw.state_cd in (:stateCode));
Eller endnu bedre:
where (:stateCode = '') or vw.state_cd in (:stateCode)