Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Verificamos varias veces que todos los datos estén correctos y ya podemos probar el script en el ambiente de prueba() si no tenemos ningun error durante la ejecucion entonces se encuentra todo correcto.

Script para insertar la promoción nueva.

Code Block
languagesql
themeMidnight
collapsetrue
 insert into promociones_id
   select 
          distinct
          990001517 id_promocion,   --*****************************
          rpad(('PR01517 '||a.emisor||' 20%'),15) proceso, --***************************** PR0000X se agrega para evitar duplicaciones el 0000X debe ser correlativo cambiar numero de id y por dto
          0 flg_x_tx, 1 flg_x_cta, 1 flg_x_promo, min(a.fec_vig_desde) fec_vig_desde, max(a.fec_vig_hasta) fec_vig_hasta, a.monto_desde, a.monto_tope, a.porc_dto,
          0, --al agregar cero se toma la parametrizacion hecha por operaciones
          a.rubro, 1 activo, sysdate fec_upd, user operador
   from   creditopy.comercios_promocion a
   where  a.emisor = 52  --*****************************
     and  a.id_promocion in (select distinct id_promocion from creditopy.comercios_promocion a where a.emisor = 52 --*****************************
                                  and a.fec_vig_desde between to_date('20/09/2022','dd/mm/yyyy') --***************************** 
                                                          and to_date('20/12/2022','dd/mm/yyyy') --***************************** 
                                  and a.comercio in (768457)    --*****************************
                                  and  a.porc_dto = 20  --*****************************
                                  and a.id_promocion < 990000000)
   group by a.emisor_procesador, a.emisor, a.ramo, a.monto_desde, a.monto_tope, a.porc_dto, a.rubro
    ;
    
   update comercios_promocion a
      set a.id_promocion = 990001517    --*****************************
    where a.emisor = 52  --*****************************
      and a.id_promocion in (select distinct id_promocion from creditopy.comercios_promocion a where a.emisor = 52  --*****************************
                                  and a.fec_vig_desde between to_date('20/09/2022','dd/mm/yyyy') --***************************** 
                                                          and to_date('20/12/2022','dd/mm/yyyy') --***************************** 
                                  and a.comercio in (768457)    --*****************************
                                and  a.porc_dto = 20   --*****************************
                                and a.id_promocion < 990000000);
commit;

...