【发布时间】:2017-10-20 07:16:15
【问题描述】:
我正在使用游标在表中插入数据,因为如果记录失败,我只想丢弃该记录并继续插入其余记录。
所以我使用光标来检索信息。
有没有办法一次插入光标的所有列而不是一一选择?
cursor c1 is
select a,b,c,d,e from ab where a = 'something';
begin
for var_c1 in c1 loop
begin
insert into ba (a,b,c,d,e)
values (var_c1.all);
-- instead of values (var_c1.a, var_c1.b, var_c1.c,var_c1.d, var_c1.e)
exception when others then continue;
end;
end;
【问题讨论】:
-
我会建议你做一些阅读,这肯定会帮助你自己解决你的问题。阅读此oracle.com/technetwork/issue-archive/2012/12-sep/…
标签: oracle for-loop plsql insert cursor