I got a requirement to use IN clause with different host variable values like below
If condition = true
Move "'T', 'V', 'W'" to :ws-variable
Else
Move "'A', 'C'" to :ws-variable
End-if
Move "'T', 'V', 'W'" to :ws-variable
Else
Move "'A', 'C'" to :ws-variable
End-if
I tried the below DB2 query but it's not accepting the syntax
Select employee_id into
:Ws-employee-id
From employee
Where
Employee_variable in :ws-variable
:Ws-employee-id
From employee
Where
Employee_variable in :ws-variable
I am getting error ws-variable cannot be used like this
As the number of values in 'IN' clause is changing, we cannot hard code the value in the host-variable
Can you please help
Thanks