OldMcDonald
OldMcDonald

Reputation: 574

Oracle APEX 5.0 - SQL query based on (multiple) checkbox values

I have a list of values and it works as a list.

select KEY, VALUE
from keytable
WHERE key = :LOV_KEYLIST

This works perfectly fine.

However, if I do the LOV as checkboxes, it doesn't work at all. Those checkboxes are a new item and I want them to change my select query from my interactive report.

How can I select multiple checkboxes and only get shown the rows where the values from the checkboxes apply?

Thanks.

Upvotes: 2

Views: 8635

Answers (2)

user15917263
user15917263

Reputation: 1

You can try the code

 column in (
          
          select regexp_substr(:P100_VERSION,'[^:]+', 1, level) ID from dual
connect by regexp_substr(:P100_VERSION, '[^:]+', 1, level) is not null
          
          
        )

Upvotes: 0

because it multivalues (val1:val2:val3:valN..), http://docs.oracle.com/cd/E14373_01/appdev.32/e13363/check_box.htm#CHDBGDJH

try this:

select KEY, VALUE
from keytable
-- check all posible values in checkbox item
WHERE (instr(':'||:LOV_KEYLIST||':',':'||key||':') >0 
         -- if value is null show All rows
         or :LOV_KEYLIST is null)

Upvotes: 5

Related Questions