This content has been marked as final. Show 3 replies
Easyest way, I think, is to use dynamic Record Groups that can handle dynamic SQL queries.
Resolve the issue
Use REF CURSOR to change cursor dynamically.
Another option might be to add your condition to your query and omit the if and the ref cursor:
select [...] from [...] where (:block1.item1 IN ('A','B','C') AND :block2.item2 ='D' and ([condition one goes here)) or (:block1.item1 ='A' AND :block2.item2 IN ('B','C','D') and ([condition two goes here))