You can use the built-in position function:
if(position(val IN valList) > 0)then
Note that you need to avoid false positives when only part of the number matches, i.e. setpoints '123,456,789'
for position '2'
return true, which you probably don't want. To avoid this, you can add a comma (since you divided the comma of the value in the varchar field) as a prefix and suffix into the search strings, i.e.
val = ',' || cast(var_int1 as varchar(10)) || ','; valList = ',' || valList || ','; if(position(val IN valList) > 0)then ...
source share