You are on page 1of 1

Create or Replace Procedure Povoa_Local_dept is

--
cursor c_departamento is
Select id_departamento
from departamento;
--
cursor c_local is
select id_local
from local;
--
begin
--
for r_departamento in c_departamento loop
--
for r_local in c_local loop
--
insert into local_dept (id_local_dept, id_local, id_departamento)
values (seq_local_dept.nextval, r_local.id_local,
r_departamento.id_departamento);
--
end loop;
--
end loop;
--
commit;
--
end;
/

You might also like