Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now
Sign InSign Up

OrclQA.Com

OrclQA.Com Logo OrclQA.Com Logo

OrclQA.Com Navigation

  • Oracle
  • Oracle Apex
  • Python
  • Questions
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Ask Question
  • Add Post
  • Oracle
  • Oracle Apex
  • Python
  • Questions
shashi
shashi

shashi

  • 16 Questions
  • 23 Answers
  • 0 Best Answers
  • 120 Points
View Profile
  • 0
shashiProfessional
Asked: March 23, 20232023-03-23T14:08:20+05:30 2023-03-23T14:08:20+05:30

How to pass dynamic where clause in IR report

  • 0

How to pass dynamic where clause to IR report from application item.Can you please suggest.

Example

select col1,colo2
from table
where col1 in(:P1_ITEM)

P1_ITEM contains in clause select query

question
  • 2
  • 64
  • 0
  • 0
  • Share
    • Share on Facebook
    • Share on Twitter
    • Share on LinkedIn
Answer

2 Answers

  1. OrclQA Wiki

    OrclQA Wiki

    • 6 Questions
    • 4 Answers
    • 0 Best Answers
    • 73 Points
    View Profile
    OrclQA Wiki Professional
    2023-03-23T15:17:28+05:30Added an answer on March 23, 2023 at 3:17 pm

    To pass a dynamic WHERE clause in an Interactive Report, you can use the following steps:

    1. Create a hidden page item to store the dynamic WHERE clause:

      a. Navigate to the Page Designer in APEX. b. Under "Items," click "Create" (the "+" icon) and choose "Hidden." c. Set the "Name" property for the hidden item, for example, "P1_DYNAMIC_WHERE." d. Save the changes.

    2. Create or edit an existing Interactive Report region:

      a. Navigate to the Page Designer in APEX. b. Under "Regions," click "Create" (the "+" icon) and choose "Interactive Report." c. Set the "Title" property for the Interactive Report region. d. In the "Source" section, set the "Type" property to "SQL Query." e. Write your SQL query, using the hidden page item to represent the dynamic WHERE clause. For example:

    SELECT column1, column2, column3
    FROM your_table
    WHERE 1=1
    AND &P1_DYNAMIC_WHERE.
    
    1. Set the dynamic WHERE clause value:

    You can set the value of the hidden page item (P1_DYNAMIC_WHERE) using a Dynamic Action, PL/SQL code, or JavaScript. Here's an example of setting the value using JavaScript:

    // Define your dynamic WHERE clause.
    var dynamicWhere = "column1 = 'value1' AND column2 = 'value2'";
    
    // Set the value of the hidden page item.
    apex.item('P1_DYNAMIC_WHERE').setValue(dynamicWhere);
    
    // Refresh the Interactive Report to apply the dynamic WHERE clause.
    apex.region('your_interactive_report_static_id').refresh();

    Replace "your_interactive_report_static_id" with the actual Static ID of your Interactive Report region.

    This should allow you to pass a dynamic WHERE clause in your Interactive Report in Oracle APEX.

    • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
  2. shashi

    shashi

    • 16 Questions
    • 23 Answers
    • 0 Best Answers
    • 120 Points
    View Profile
    shashi Professional
    2023-03-26T10:41:32+05:30Added an answer on March 26, 2023 at 10:41 am

    Hi ,

    Thanks but i need to pass the condition in IN clause can you please suggest.

    • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter

You must login to add an answer.

Forgot Password?

Sidebar

Explore

  • Ask Question
  • Add Post

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
© 2022 OrclQA.Com. All Rights Reserved.
Privacy Policy - About Us