Oracle APEX: Multiple Conditions?

2.7k views Asked by At

I wish to have a region displayed only if

SELECT * FROM REI_LABOUR_RATE_REQUEST
WHERE BILLING_PARTNER = :P6_FILTER_DEALER

returns at least one row and the element :P6_FILTER_YEAR is not NULL. I tried this by writing:

SELECT * FROM REI_LABOUR_RATE_REQUEST
WHERE BILLING_PARTNER = :P6_FILTER_DEALER
AND :P6_FILTER_YEAR != NULL;

but that somehow never returns any row.

2

There are 2 answers

0
Markus Appel On BEST ANSWER

As @Tony Andrews says:

:P6_FILTER_YEAR != NULL will never be true. use :P6_FILTER_YEAR IS NOT NULL instead. In fact the condition is redundant here, because BILLING_PARTNER = :P6_FILTER_DEALER will only be true when :P6_FILTER_YEAR is not null anyway.

0
Blurryface On

Did you try having a conditional display on the region with the type being "Value of item IS NOT NULL" and P6_FILTER_DEALER as the expression.

This should work as long as the value of the item is submitted and the item has the value stored in the session.

Region Source:

SELECT * FROM REI_LABOUR_RATE_REQUEST
WHERE BILLING_PARTNER = :P6_FILTER_DEALER