Search code examples
oracle-databaseoracle-apexoracle-apex-5

Oracle Apex: How to put a dynamic value in filter


is it possible to add a dynamic value on filter. I'm trying to save a report with a filter using the current user:

enter image description here


Solution

  • A solution to this problem is to include the variable as a column in your query and then filter on that column. Example: Your select would be something like

    SELECT 
      your_value1,
      CASE WHEN created_by = :APP_USER THEN 1 ELSE 0 END AS is_current_user
    FROM 
      your_table
    

    If you then set a filter on is_current_user you'll only get the rows where created_by = :APP_USER.