andrescarrero/DWH-PL-SQL — pull request #10 by marian09 (2013-03-19 02:51:08+00:00)
Title: Dimensión Centro_Costos

create or replace procedure llena_cc as cursor centroc is
(select distinct(ctr_id_centro) idc, ctr_descripcion descr from sif_centro_costos);

v_centrocc centroc%rowtype;

begin

open centroc;
loop
fetch centroc into v_centrocc;
exit when centroc%NOTFOUND;
dbms_output.put_line('IDC: '||v_centrocc.idc||' DESCR:'||v_centrocc.descr);
insert into centro_costos(nombre, cen_id_viejo)values(v_centrocc.descr, v_centrocc.idc);
end loop;
close centroc;
end llena_cc;