oracle数据库中想一次插入多行数据该怎么操作?
比如:insert into mytb1
(id,name,age,address)
values
(002,'li4',20,'hebeilu'),
(003,'zhang5',22,'qihelu') ;
收起declare
type t_t1 is record (
v_id int,
v_name varchar2(30),
v_age number(3),
v_address varchar2(60)
);
type it1 is table of t_t1 index by pls_integer;
v_rows it1;
begin
select 002,\'li4\',20,\'hebeilu\' into v_rows(1) from dual;
select 003,\'zhang5\',22,\'qihelu\' into v_rows(2) from dual;
forall i in 1..v_rows.count
insert into mytb1 values( v_row(i).v_id,v_rows(i).v_name,v_rows(i).v_age,v_rows(i).v_address);
commit;
end;
/