
POR FAVOR AYUDA
Publicado por EDGAR (87 intervenciones) el 17/11/2005 17:46:34
Amigos necesito nueva mente de su ayuda tengo el siguiente scrip el cual esta migrando datos de una base a otra y necesito hacer un commit pero por cada 100 registros migrados.
Es decir realice un commit de 100 en 100 por fa les envio el scrip espero su ayuda urgente muchas gracias
SetPointer (HourGlass!)
long ll_aux, ll_fila
d_eis_i_migracion.SetTransObject (sqlca_warehouse)
d_eis_i_migrados.SetTransObject (sqlca)
//Coneccion a la Base Anterior
connect using sqlca_warehouse;
d_eis_i_migracion.Retrieve()
for ll_aux = 1 to d_eis_i_migracion.RowCount()
ll_fila = d_eis_i_migrados.InsertRow(0)
d_eis_i_migrados.SetItem(ll_fila,'fac_cod_facapr',d_eis_i_migracion.GetItemString(ll_aux,'apr_toperacion'))
d_eis_i_migrados.SetItem(ll_fila,'apr_numcreapr',d_eis_i_migracion.GetItemString(ll_aux,'credito_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_numtraapr',d_eis_i_migracion.GetItemNumber(ll_aux,'apr_tramite'))
d_eis_i_migrados.SetItem(ll_fila,'apr_numopeapr',d_eis_i_migracion.GetItemNumber(ll_aux,'apr_operacion'))
d_eis_i_migrados.SetItem(ll_fila,'fac_codfacant',d_eis_i_migracion.GetItemString(ll_aux,'mecanismo_modalidad_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_numcreant',d_eis_i_migracion.GetItemString(ll_aux,'modalidad_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_numtraant',d_eis_i_migracion.GetItemNumber(ll_aux,'tipomodalidad_apr'))
d_eis_i_migrados.SetItem(ll_fila,'cii_codcii',d_eis_i_migracion.GetItemString(ll_aux,'ciiu_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_fecapr',d_eis_i_migracion.GetItemDateTime(ll_aux,'fechaprob_apr'))
d_eis_i_migrados.SetItem(ll_fila,'mod_codmod',d_eis_i_migracion.GetItemString(ll_aux,'mecanismo_apr'))
d_eis_i_migrados.SetItem(ll_fila,'mon_codmon',d_eis_i_migracion.GetItemNumber(ll_aux,'moneda_apr'))
d_eis_i_migrados.SetItem(ll_fila,'ofi_codofipro',d_eis_i_migracion.GetItemNumber(ll_aux,'agencia_apr'))
d_eis_i_migrados.SetItem(ll_fila,'ofi_codofitra',d_eis_i_migracion.GetItemNumber(ll_aux,'apr_oficina'))
d_eis_i_migrados.SetItem(ll_fila,'prd_codprd',d_eis_i_migracion.GetItemString(ll_aux,'producto_apr'))
d_eis_i_migrados.SetItem(ll_fila,'sjc_codigoifi',d_eis_i_migracion.GetItemNumber(ll_aux,'ifi_apr'))
d_eis_i_migrados.SetItem(ll_fila,'sjc_codigobf',d_eis_i_migracion.GetItemNumber(ll_aux,'empresa_apr'))
d_eis_i_migrados.SetItem(ll_fila,'pro_codpro',d_eis_i_migracion.GetItemNumber(ll_aux,'codgeo'))
d_eis_i_migrados.SetItem(ll_fila,'apr_secuen',d_eis_i_migracion.GetItemNumber(ll_aux,'apr_secuencial'))
d_eis_i_migrados.SetItem(ll_fila,'apr_numacu',d_eis_i_migracion.GetItemNumber(ll_aux,'acuerdo_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_monto',d_eis_i_migracion.GetItemNumber(ll_aux,'monto_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_montodol',d_eis_i_migracion.GetItemNumber(ll_aux,'montodolarizado_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_montosuc',d_eis_i_migracion.GetItemNumber(ll_aux,'montosucretizado_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_plazo',d_eis_i_migracion.GetItemNumber(ll_aux,'plazo_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_tascre',d_eis_i_migracion.GetItemNumber(ll_aux,'tasacredito_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_tasdes',d_eis_i_migracion.GetItemNumber(ll_aux,'tasadescuento_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_tascresuc',d_eis_i_migracion.GetItemNumber(ll_aux,'tasacredito_sucres_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_tasdessuc',d_eis_i_migracion.GetItemNUmber(ll_aux,'tasades_sucres_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_cotiza',d_eis_i_migracion.GetItemNumber(ll_aux,'cotizacion_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_export',d_eis_i_migracion.GetItemNumber(ll_aux,'exportar_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_jerarq',d_eis_i_migracion.GetItemString(ll_aux,'jerarquia_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_identi',d_eis_i_migracion.GetItemString(ll_aux,'identidad_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_reprog',d_eis_i_migracion.GetItemString(ll_aux,'reprogramacion'))
d_eis_i_migrados.SetItem(ll_fila,'apr_numcresuc',d_eis_i_migracion.GetItemString(ll_aux,'credito_anterior_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_codfacsisant',d_eis_i_migracion.GetItemString(ll_aux,'mecanismo_respaldo_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_codmodsisant',d_eis_i_migracion.GetItemString(ll_aux,'respaldo_modalidad'))
d_eis_i_migrados.SetItem(ll_fila,'apr_numcresisant',d_eis_i_migracion.GetItemString(ll_aux,'eis_credito_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_codbfsisant',d_eis_i_migracion.GetItemString(ll_aux,'eis_empresa_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_codofimecsisant',d_eis_i_migracion.GetItemString(ll_aux,'eis_agemec_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_numcremig',d_eis_i_migracion.GetItemString(ll_aux,'apr_migrada'))
// Asignacion de Valores en campos que no tienen relacion la base Anterior con la nueva
d_eis_i_migrados.SetItem(ll_fila,'fuc_codfucing','nd')
d_eis_i_migrados.SetItem(ll_fila,'fuc_codfucapr','nd')
d_eis_i_migrados.SetItem(ll_fila,'fui_codfui','04')
next
//Desconeccion de la Base anterior
Disconnect using sqlca_warehouse;
// Coneccion con la Base Donde se va a Migrar
connect using sqlca;
d_eis_i_migrados.Update()
commit;
Es decir realice un commit de 100 en 100 por fa les envio el scrip espero su ayuda urgente muchas gracias
SetPointer (HourGlass!)
long ll_aux, ll_fila
d_eis_i_migracion.SetTransObject (sqlca_warehouse)
d_eis_i_migrados.SetTransObject (sqlca)
//Coneccion a la Base Anterior
connect using sqlca_warehouse;
d_eis_i_migracion.Retrieve()
for ll_aux = 1 to d_eis_i_migracion.RowCount()
ll_fila = d_eis_i_migrados.InsertRow(0)
d_eis_i_migrados.SetItem(ll_fila,'fac_cod_facapr',d_eis_i_migracion.GetItemString(ll_aux,'apr_toperacion'))
d_eis_i_migrados.SetItem(ll_fila,'apr_numcreapr',d_eis_i_migracion.GetItemString(ll_aux,'credito_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_numtraapr',d_eis_i_migracion.GetItemNumber(ll_aux,'apr_tramite'))
d_eis_i_migrados.SetItem(ll_fila,'apr_numopeapr',d_eis_i_migracion.GetItemNumber(ll_aux,'apr_operacion'))
d_eis_i_migrados.SetItem(ll_fila,'fac_codfacant',d_eis_i_migracion.GetItemString(ll_aux,'mecanismo_modalidad_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_numcreant',d_eis_i_migracion.GetItemString(ll_aux,'modalidad_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_numtraant',d_eis_i_migracion.GetItemNumber(ll_aux,'tipomodalidad_apr'))
d_eis_i_migrados.SetItem(ll_fila,'cii_codcii',d_eis_i_migracion.GetItemString(ll_aux,'ciiu_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_fecapr',d_eis_i_migracion.GetItemDateTime(ll_aux,'fechaprob_apr'))
d_eis_i_migrados.SetItem(ll_fila,'mod_codmod',d_eis_i_migracion.GetItemString(ll_aux,'mecanismo_apr'))
d_eis_i_migrados.SetItem(ll_fila,'mon_codmon',d_eis_i_migracion.GetItemNumber(ll_aux,'moneda_apr'))
d_eis_i_migrados.SetItem(ll_fila,'ofi_codofipro',d_eis_i_migracion.GetItemNumber(ll_aux,'agencia_apr'))
d_eis_i_migrados.SetItem(ll_fila,'ofi_codofitra',d_eis_i_migracion.GetItemNumber(ll_aux,'apr_oficina'))
d_eis_i_migrados.SetItem(ll_fila,'prd_codprd',d_eis_i_migracion.GetItemString(ll_aux,'producto_apr'))
d_eis_i_migrados.SetItem(ll_fila,'sjc_codigoifi',d_eis_i_migracion.GetItemNumber(ll_aux,'ifi_apr'))
d_eis_i_migrados.SetItem(ll_fila,'sjc_codigobf',d_eis_i_migracion.GetItemNumber(ll_aux,'empresa_apr'))
d_eis_i_migrados.SetItem(ll_fila,'pro_codpro',d_eis_i_migracion.GetItemNumber(ll_aux,'codgeo'))
d_eis_i_migrados.SetItem(ll_fila,'apr_secuen',d_eis_i_migracion.GetItemNumber(ll_aux,'apr_secuencial'))
d_eis_i_migrados.SetItem(ll_fila,'apr_numacu',d_eis_i_migracion.GetItemNumber(ll_aux,'acuerdo_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_monto',d_eis_i_migracion.GetItemNumber(ll_aux,'monto_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_montodol',d_eis_i_migracion.GetItemNumber(ll_aux,'montodolarizado_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_montosuc',d_eis_i_migracion.GetItemNumber(ll_aux,'montosucretizado_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_plazo',d_eis_i_migracion.GetItemNumber(ll_aux,'plazo_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_tascre',d_eis_i_migracion.GetItemNumber(ll_aux,'tasacredito_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_tasdes',d_eis_i_migracion.GetItemNumber(ll_aux,'tasadescuento_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_tascresuc',d_eis_i_migracion.GetItemNumber(ll_aux,'tasacredito_sucres_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_tasdessuc',d_eis_i_migracion.GetItemNUmber(ll_aux,'tasades_sucres_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_cotiza',d_eis_i_migracion.GetItemNumber(ll_aux,'cotizacion_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_export',d_eis_i_migracion.GetItemNumber(ll_aux,'exportar_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_jerarq',d_eis_i_migracion.GetItemString(ll_aux,'jerarquia_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_identi',d_eis_i_migracion.GetItemString(ll_aux,'identidad_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_reprog',d_eis_i_migracion.GetItemString(ll_aux,'reprogramacion'))
d_eis_i_migrados.SetItem(ll_fila,'apr_numcresuc',d_eis_i_migracion.GetItemString(ll_aux,'credito_anterior_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_codfacsisant',d_eis_i_migracion.GetItemString(ll_aux,'mecanismo_respaldo_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_codmodsisant',d_eis_i_migracion.GetItemString(ll_aux,'respaldo_modalidad'))
d_eis_i_migrados.SetItem(ll_fila,'apr_numcresisant',d_eis_i_migracion.GetItemString(ll_aux,'eis_credito_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_codbfsisant',d_eis_i_migracion.GetItemString(ll_aux,'eis_empresa_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_codofimecsisant',d_eis_i_migracion.GetItemString(ll_aux,'eis_agemec_apr'))
d_eis_i_migrados.SetItem(ll_fila,'apr_numcremig',d_eis_i_migracion.GetItemString(ll_aux,'apr_migrada'))
// Asignacion de Valores en campos que no tienen relacion la base Anterior con la nueva
d_eis_i_migrados.SetItem(ll_fila,'fuc_codfucing','nd')
d_eis_i_migrados.SetItem(ll_fila,'fuc_codfucapr','nd')
d_eis_i_migrados.SetItem(ll_fila,'fui_codfui','04')
next
//Desconeccion de la Base anterior
Disconnect using sqlca_warehouse;
// Coneccion con la Base Donde se va a Migrar
connect using sqlca;
d_eis_i_migrados.Update()
commit;
Valora esta pregunta


0