我可以使用 "where" 插入一个值吗
Can i insert a value using "where"
我可以使用
插入 (Table)
值(xyz)
其中 (xzy)
我正在根据复选框插入值 selection
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;
效果很好..但现在我想在该语句中使用 where Temporary='yes'..
我知道你可以使用 insert into (select x,y,z) where (xyz)
但我想要复选框中的特定值..
不,你不能使用 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),
...
请试试这个,只需select你的双重复选框值并根据需要应用条件
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;
我可以使用
插入 (Table) 值(xyz) 其中 (xzy)
我正在根据复选框插入值 selection
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;
效果很好..但现在我想在该语句中使用 where Temporary='yes'..
我知道你可以使用 insert into (select x,y,z) where (xyz) 但我想要复选框中的特定值..
不,你不能使用 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),
...
请试试这个,只需select你的双重复选框值并根据需要应用条件
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;