I have this code in MicroFocus COBOL:
move 'select * from TABLE where a = ? and b = ? and c = ? to w-sql
exec sql
open cur_read_2 using :w-a,
:w-b,
:w-c
end-exec
But this select can be variable, so I can have here for example only
... where a = ? ...
or
... where a = ? and c = ? ...
So, can I somehow setup exec-sql part dynamically, to have proper number of host-variables here? In actual case I have 7 WHERE variables and full list of combinations is possible.