Hello,
I am trying to build an application with 2 regions one with filters and other is the data region. When I am trying to run the application by default it is showing all the data from the table. Is there any option or something i can do to load the output page with empty filters and empty data region. The data should be shown based on the values we pass.
I wrote the below code in data region.
SELECT * FROM mfg0001
WHERE
(INSTR(':'||:P4_UOM||':',':'||UOM||':')>0 or :P4_UOM is NULL)
and (INSTR(':'||:P4_PROD_LINE||':',':'||PROD_LINE||':')>0 OR :P4_PROD_LINE is NULL)
and (INSTR(':'||:P4_ITEM||':',':'||ITEM||':')>0 OR :P4_ITEM is NULL)
and (INSTR(':'||:P4_BATCH_STATUS||':',':'||BATCH_STATUS||':')>0 OR :P4_BATCH_STATUS is NULL)
and (INSTR(':'||:P4_SHIFT||':',':'||SHIFT||':')>0 OR :P4_SHIFT is NULL)
and ((:P4_PDF is null OR :P4_PDT is null) or
(PLANNED_START_DATE between :P4_PDF and :P4_PDT));

From the above screenshot we can see that no filters are mandatory and by default the data is being loaded into the page.
By using below code i was getting no data found initially but the filter in which m including "1=2" is becoming mandatory like we have to pass the value in it to get the output in expected way.
SELECT * FROM mfg0001
WHERE
(INSTR(':'||:P4_UOM||':',':'||UOM||':')>0 or 1=2)
and (INSTR(':'||:P4_PROD_LINE||':',':'||PROD_LINE||':')>0 OR :P4_PROD_LINE is NULL)
and (INSTR(':'||:P4_ITEM||':',':'||ITEM||':')>0 OR :P4_ITEM is NULL)
and (INSTR(':'||:P4_BATCH_STATUS||':',':'||BATCH_STATUS||':')>0 OR :P4_BATCH_STATUS is NULL)
and (INSTR(':'||:P4_SHIFT||':',':'||SHIFT||':')>0 OR :P4_SHIFT is NULL)
and ((:P4_PDF is null OR :P4_PDT is null) or
(PLANNED_START_DATE between :P4_PDF and :P4_PDT));

Can someone suggest if this the procedure or is there any thing i have to get this.
Thankyou