The statement below doesn't work. I keep getting a sqlcode -171, sqlstate 42815. It will only run if I reverse the positions of code_value and :ws-all-codes. However, that result is not what I want. I want to find the string represented by the column name(code_value) in the string :ws-all-codes (which contains '22a 22b 22c'), not vice versa. Help, I'm dying here.
select distinct dcn, code_value
from zcbrs00.query_codes c where
doc_type = 30 and
query_control_cd = 4040 and
locate(c.code_value,:ws-all-codes) <> 0