I used the following WHERE
clause
WHERE (TYPE1 = :P3_ITEM1 OR :P3_ITEM1 IS NULL)
to filter my query on TYPE1 and it worked fine to display the records of same TYPE1 when page item P3_ITEM1 is not null.
Now I need to add two more filters for TYPE2 and TYPE3. Normally only one page item P3_ITEM1, P3_ITEM2, or P3_ITEM3 is not null, so I need to filter on whichever on is not null.
I tried
WHERE (TYPE1=:P3_ITEM1 OR :P3_ITEM1 IS NULL) OR
(TYPE2=:P3_ITEM2 OR :P3_ITEM2 IS NULL) OR
(TYPE3=:P3_ITEM3 OR :P3_ITEM3 IS NULL)
but it did not work.
I tried using CASE statement in my WHERE clause but no success so far. Can anyone help?
WHERE CASE
WHEN (:P3_ITEM1 IS NOT NULL) THEN (TYPE1=:P3_ITEM1)
WHEN (:P3_ITEM2 IS NOT NULL) THEN (TYPE2=:P3_ITEM2)
WHEN (:P3_ITEM3 IS NOT NULL) THEN (TYPE3=:P3_ITEM3)