如何在交互式网格上显示所有数据,然后使用 oracle_apex 上的穿梭过滤器减少它?

How do I show all of the data on an interactive grid and then reduce it with shuttle filters on oracle_apex?

我有 5 个穿梭过滤器:项目、部分、阶段、组,Old_New。 我举一个例子:

项目过滤器 按钮 所选项目
项目 1 <---
项目 2 ---> 项目 2
项目 3

正如我目前所拥有的那样,只有在我填充过滤器后才会显示数据,但我希望情况正好相反。 我认为我的 where 子句出了什么问题,但我不知道如何将过滤器连接到查询。

  WITH T 
    AS (
       SELECT md.ID,
              md.MATERIAL_NUMBER,
              md.MATERIAL_DESCRIPTION,
              md.PROJECT,
              md.SECTION,
              md.PHASE,
              md.GROUP,
              md.OLD_NEW
         FROM MATERIAL_DATA md

    /* P30 is the page my filters are on */
       WHERE  (:P30_PROJECT like '%' || md.PROJECT || '%' or md.PROJECT is NULL)
              AND (:P30_SECTION like '%' || md.SECTION || '%' or md.SECTION is NULL)
              AND (:P30_PHASE like '%' || md.PHASE || '%' or md.PHASE is NULL)
              AND (:P30_GROUP like '%' || md.GROUP || '%' or md.GROUP is NULL)
              AND (:P30_OLD_NEW like '%' || md.OLD_NEW || '%' or md.OLD_NEW is NULL)
       )
SELECT DISTINCT ID,
       MATERIAL_NUMBER,
       MATERIAL_DESCRIPTION,
       PROJECT,
       SECTION,
       PHASE,
       GROUP,
       OLD_NEW
  FROM T

过滤器确实有效,但我的交互式网格是空的 table,直到每个过滤器都有数据填充“选定”部分。 谢谢您的帮助。 =)

我打赌你真的想要

WITH T 
    AS (
       SELECT md.ID,
              md.MATERIAL_NUMBER,
              md.MATERIAL_DESCRIPTION,
              md.PROJECT,
              md.SECTION,
              md.PHASE,
              md.GROUP,
              md.OLD_NEW
         FROM MATERIAL_DATA md

    /* P30 is the page my filters are on */
       WHERE  (:P30_PROJECT = md.PROJECT or :P30_PROJECT is NULL)
              AND (:P30_SECTION = md.SECTION or :P30_SECTION is NULL)
              AND (:P30_PHASE = md.PHASE  or :P30_PHASE is NULL)
              AND (:P30_GROUP = md.GROUP  or :P30_GROUP is NULL)
              AND (:P30_OLD_NEW = md.OLD_NEW  or :P30_OLD_NEW is NULL)
       )
SELECT DISTINCT ID,
       MATERIAL_NUMBER,
       MATERIAL_DESCRIPTION,
       PROJECT,
       SECTION,
       PHASE,
       GROUP,
       OLD_NEW
  FROM T

但我不知道您的各个页面项的确切值是什么以及您希望返回什么值。如果每个页面项目都有一个以冒号分隔的值列表,您会想要更像

WITH T 
    AS (
       SELECT md.ID,
              md.MATERIAL_NUMBER,
              md.MATERIAL_DESCRIPTION,
              md.PROJECT,
              md.SECTION,
              md.PHASE,
              md.GROUP,
              md.OLD_NEW
         FROM MATERIAL_DATA md

    /* P30 is the page my filters are on */
       WHERE  (md.PROJECT member of apex_string.split(:P30_PROJECT,':') or :P30_PROJECT is NULL)
              AND (md.SECTION member of apex_string.split(:P30_SECTION, ':') or :P30_SECTION is NULL)
              AND (md.PHASE member of apex_string.split(:P30_PHASE, ':') or :P30_PHASE is NULL)
              AND (md.GROUP member of apex_string.split(:P30_GROUP, ':') or :P30_GROUP is NULL)
              AND (md.OLD_NEW member of apex_string.split(:P30_OLD_NEW, ':') or :P30_OLD_NEW is NULL)
       )
SELECT DISTINCT ID,
       MATERIAL_NUMBER,
       MATERIAL_DESCRIPTION,
       PROJECT,
       SECTION,
       PHASE,
       GROUP,
       OLD_NEW
  FROM T