oralceカーソル使用

877 ワード




create or replace procedure transportData_1
is
cursor mycursor is select * from zjx_1;
v_user  zjx_1%rowtype;
begin 
open mycursor;
loop
fetch mycursor into v_user;
exit when mycursor%notfound;    
insert into Zjx_3  values(v_user.name,v_user.age);
end loop;
Exception
    When others then
       Rollback;
close mycursor;
end ;


create or replace procedure transportData
is
cursor mycursor is select * from zjx_1;
begin 

for zjx_1 in mycursor loop
insert into zjx_2  values(zjx_1.Name,zjx_1.age);
end loop;
Exception
    When others then
       Rollback;

end transportData;


create table zjx_3(
name varchar2(10),
age number
)