我可以使用“ where”

时间:2019-03-14 17:49:49

标签: oracle oracle-apex oracle-apex-5.1

我可以使用

插入(表)               值(xyz)               其中(xzy)

我要根据复选框选择插入值

begin
  for idx in 1 .. apex_application.g_f01.count
  loop
    if apex_application.g_f01(idx) is not null then
       insert into CONSOLIDATE
         (filenumber, 
          INCOMINGDATE,
          filename
         )
         values
         (apex_application.g_f01(idx),
          apex_application.g_f03(idx),
          apex_application.g_f04(idx)


         );
    end if;
  end loop;
end;

效果很好..但是现在我想在该语句中使用Temporary ='yes'。

我知道您可以在(xyz)中使用插入到(选择x,y,z)中 但是我想要复选框中的特定值。

2 个答案:

答案 0 :(得分:1)

不是,您不能使用WHERE,但是可以使用CASE,例如

values
     (case when apex_application.g_f01(idx) in ('A', 'B', 'C') then apex_application.g_f01(idx)
           else null
      end,
      apex_application.g_f01(idx),
      ...

答案 1 :(得分:1)

请尝试此操作,只需从双中选择您的复选框值,然后在必要时应用条件即可

begin
  for idx in 1 .. apex_application.g_f01.count
  loop
    if apex_application.g_f01(idx) is not null then
       insert into CONSOLIDATE
         (filenumber, 
          INCOMINGDATE,
          filename
         )
         SELECT
          apex_application.g_f01(idx),
          apex_application.g_f03(idx),
          apex_application.g_f04(idx)
         FROM DUAL
         WHERE apex_application.g_f01(idx) = 'XYZ'  ;
    end if;
  end loop;
end;