If a case statement is used in the where clause of the select of the DDDW datawindow, an error occurs.
ex)
/* failed select */
select a.major_cd as major_cd,
a.minor_cd as minor_cd,
a.cd_nm as cd_nm
from cob01t a
where a.use_yn = 'Y'
and a.major_cd like case :as_arg2 when '*' then :as_arg2 else :as_arg1 end
and a.minor_cd <> '*'
and nvl(a.rel_cd1, '%') like case :as_arg2 when '*' then :as_arg2 else :as_arg1 end
order by a.minor_cd
/* success select */
select a.major_cd as major_cd,
a.minor_cd as minor_cd,
a.cd_nm as cd_nm
from cob01t a
where a.use_yn = 'Y'
and a.major_cd like :as_arg1
and a.minor_cd <> '*'
and nvl(a.rel_cd1, '%') like :as_arg1
order by a.minor_cd
You can think of the '%' in front as a meaningless string.
And since '%' may come after or an exact value may come, nvl(rel_cd1, '%') is just performed to handle the comparison failure.
Good luck!