Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Trying to create a report Which has to show data region empty when loaded.

NaveenpJul 24 2017 — edited Jul 24 2017

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));

11.PNG

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));

Capture (1).PNG

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

Thankyou

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 21 2017
Added on Jul 24 2017
1 comment
169 views