CREATE OR REPLACE 
PACKAGE PG_MIGRACION AS 

    -- Definicion de las constantes que usaremos para ejecutar el proceso por partes:
    C_PROCESO VARCHAR2(50) := 'UNODOSTRESCUATROCINCOSEISSIETE';
    C_USUARIO VARCHAR2(10) := 'MIGRADO';
	
    PROCEDURE INICIA;
	
	PROCEDURE RELLENA_IDEXP_16;
	
	PROCEDURE RELLENA_ID_DIR_NOTIF_00;
END PG_MIGRACION;
/
/* SELECT CONSTRAINT_NAME, TABLE_NAME, R_CONSTRAINT_NAME, STATUS FROM USER_CONSTRAINTS WHERE R_CONSTRAINT_NAME = 'AD74A01T00_PK'
 
 
 select 'alter table '||tablE_name||' DISABLE constraint '||r_constraint_name||';' FROM USER_CONSTRAINTS WHERE R_CONSTRAINT_NAME = 'AD74A01T00_PK';
alter table AD74A71T00 DISABLE constraint AD74A01T00_PK;
alter table AD74A27T00 DISABLE constraint AD74A01T00_PK;
alter table AD74A89T00 DISABLE constraint AD74A01T00_PK;
alter table AD74A22T00 DISABLE constraint AD74A01T00_PK;
alter table AD74A26T00 DISABLE constraint AD74A01T00_PK;
alter table AD74A25T00 DISABLE constraint AD74A01T00_PK;
alter table AD74A24T00 DISABLE constraint AD74A01T00_PK;
alter table AD74A20T00 DISABLE constraint AD74A01T00_PK;
alter table AD74A21T00 DISABLE constraint AD74A01T00_PK;
alter table AD74A23T00 DISABLE constraint AD74A01T00_PK;
alter table AD74A00T00 DISABLE constraint AD74A01T00_PK;
alter table AD74A04T00 DISABLE constraint AD74A01T00_PK;
alter table AD74A16T00 DISABLE constraint AD74A01T00_PK;
alter table AD74A03T00 DISABLE constraint AD74A01T00_PK;
alter table AD74A75T00 DISABLE constraint AD74A01T00_PK;
alter table AD74A84T00 DISABLE constraint AD74A01T00_PK;
alter table AD74A85T00 DISABLE constraint AD74A01T00_PK;
alter table AD74A86T00 DISABLE constraint AD74A01T00_PK;

 select * from AD74A89T00 where id_solicitante_89 in (select id_solicitante_01 from ad74a01t00 where usu_alta_01 = 'MIGRADO')
 select * from AD74A24T00 where id_solicitante_24 in (select id_solicitante_01 from ad74a01t00 where usu_alta_01 = 'MIGRADO')
 select * from AD74A23T00 where id_solicitante_23 in (select id_solicitante_01 from ad74a01t00 where usu_alta_01 = 'MIGRADO')
 select * from AD74A00T00 where id_solicitante_00 in (select id_solicitante_01 from ad74a01t00 where usu_alta_01 = 'MIGRADO')
 select * from AD74A04T00 where id_solicitante_04 in (select id_solicitante_01 from ad74a01t00 where usu_alta_01 = 'MIGRADO')
 select * from AD74A03T00 where id_solicitante_03 in (select id_solicitante_01 from ad74a01t00 where usu_alta_01 = 'MIGRADO')
 select * from AD74A16T00 where ID_BENEFICIARIO_16 in (select id_solicitante_01 from ad74a01t00 where usu_alta_01 = 'MIGRADO')
  
 select * from AD74A71T00 where id_solicitante_71 in (select id_solicitante_01 from ad74a01t00 where usu_alta_01 = 'MIGRADO')
 select * from AD74A27T00 where id_solicitante_27 In (select id_solicitante_01 from ad74a01t00 where usu_alta_01 = 'MIGRADO')
 select * from AD74A22T00 where id_solicitante_22 in (select id_solicitante_01 from ad74a01t00 where usu_alta_01 = 'MIGRADO')
 select * from AD74A26T00 where id_solicitante_26 in (select id_solicitante_01 from ad74a01t00 where usu_alta_01 = 'MIGRADO')
 select * from AD74A25T00 where id_solicitante_25 in (select id_solicitante_01 from ad74a01t00 where usu_alta_01 = 'MIGRADO')
 select * from AD74A20T00 where id_solicitante_20 in (select id_solicitante_01 from ad74a01t00 where usu_alta_01 = 'MIGRADO')
 select * from AD74A21T00 where id_solicitante_21 in (select id_solicitante_01 from ad74a01t00 where usu_alta_01 = 'MIGRADO')
 select * from AD74A75T00 where id_solicitante_75 in (select id_solicitante_01 from ad74a01t00 where usu_alta_01 = 'MIGRADO')
 select * from AD74A84T00 where id_solicitante_84 in (select id_solicitante_01 from ad74a01t00 where usu_alta_01 = 'MIGRADO')
 select * from AD74A85T00 where id_solicitante_85 in (select id_solicitante_01 from ad74a01t00 where usu_alta_01 = 'MIGRADO')
 select * from AD74A86T00 where id_solicitante_86 in (select id_solicitante_01 from ad74a01t00 where usu_alta_01 = 'MIGRADO')



 
AD74A71T00_FK01	AD74A71T00	AD74A01T00_PK	ENABLED
AD74A27T00_FK01	AD74A27T00	AD74A01T00_PK	ENABLED
AD74A89T00_FK01	AD74A89T00	AD74A01T00_PK	ENABLED
AD74A22T00_FK01	AD74A22T00	AD74A01T00_PK	ENABLED
AD74A26T00_FK01	AD74A26T00	AD74A01T00_PK	ENABLED
AD74A25T00_FK01	AD74A25T00	AD74A01T00_PK	ENABLED
AD74A24T00_FK01	AD74A24T00	AD74A01T00_PK	ENABLED
AD74A20T00_FK01	AD74A20T00	AD74A01T00_PK	ENABLED
AD74A21T00_FK01	AD74A21T00	AD74A01T00_PK	ENABLED
AD74A23T00_FK01	AD74A23T00	AD74A01T00_PK	ENABLED
AD74A00T00_FK01	AD74A00T00	AD74A01T00_PK	ENABLED
AD74A04T00_FK01	AD74A04T00	AD74A01T00_PK	ENABLED
AD74A16T00_FK01	AD74A16T00	AD74A01T00_PK	ENABLED
AD74A03T00_FK01	AD74A03T00	AD74A01T00_PK	ENABLED
AD74A75T00_FK01	AD74A75T00	AD74A01T00_PK	ENABLED
AD74A84T00_FK01	AD74A84T00	AD74A01T00_PK	ENABLED
AD74A85T00_FK01	AD74A85T00	AD74A01T00_PK	ENABLED
AD74A86T00_FK01	AD74A86T00	AD74A01T00_PK	ENABLED
 
 */