You are on page 1of 2

create trigger "informix".

tr02u_padrongeneric update on
"informix".t8448padrongeneric referencing old as padrongeneric_anterior
new as padrongeneric_nuevo
for each row
(
execute procedure "informix".sendpost('topic-padrongeneric-sspp'
,((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
(((((((((((((((((((((((((((((((((((((((((((((((((
'{"metadatos":{"tabla": "t8448padrongeneric","operacion":
"U","txid": "","fecharegistro": "' || CURRENT year to fraction(3) ) ||
'",' ) ||
'"pk_tablaorigen":"{\"num_doc\":\"' ) || TRIM ( BOTH ' ' FROM
NVL (padrongeneric_anterior.num_doc ,'null' )) ) || '\"}",' ) ||
'"topico":"topic-padrongeneric-sspp"' ) || ' },' ) ||
'"datos":' ) || '{' ) ||
'"pasado":' ) || '"' ) || '{' ) ||
'\"num_padgen\": \"' ) || TRIM ( BOTH ' ' FROM NVL
(padrongeneric_anterior.num_padgen ,'null' )) ) || '\",' ) ||
'\"num_padgen_modif\": \"' ) || TRIM ( BOTH ' ' FROM NVL
(padrongeneric_anterior.num_padgen_modif ,'null' )) ) || '\",' ) ||
'\"cod_sistema\": \"' ) || TRIM ( BOTH ' ' FROM NVL
(padrongeneric_anterior.cod_sistema ,'null' )) ) || '\",' ) ||
'\"cod_tippadron\": \"' ) || TRIM ( BOTH ' ' FROM NVL
(padrongeneric_anterior.cod_tippadron ,'null' )) ) || '\",' ) ||
'\"cod_tipdoc\": \"' ) || TRIM ( BOTH ' ' FROM NVL
(padrongeneric_anterior.cod_tipdoc ,'null' )) ) || '\",' ) ||
'\"num_doc\": \"' ) || TRIM ( BOTH ' ' FROM NVL
(padrongeneric_anterior.num_doc ,'null' )) ) || '\",' ) ||
'\"fec_regis_padron\": \"' ) || TRIM ( BOTH ' ' FROM NVL
(TO_CHAR (padrongeneric_anterior.fec_regis_padron ,'%Y-%m-%d
%H:%M:%S.%F3' ) ,'null' )) ) || '\",' ) ||
'\"fec_modif_padron\": \"' ) || TRIM ( BOTH ' ' FROM NVL
(TO_CHAR (padrongeneric_anterior.fec_modif_padron ,'%Y-%m-%d
%H:%M:%S.%F3' ) ,'null' )) ) || '\",' ) ||
'\"cod_tipsustento\": \"' ) || TRIM ( BOTH ' ' FROM NVL
(padrongeneric_anterior.cod_tipsustento ,'null' )) ) || '\",' ) ||
'\"num_sustento\": \"' ) || TRIM ( BOTH ' ' FROM NVL
(padrongeneric_anterior.num_sustento ,'null' )) ) || '\",' ) ||
'\"fec_ini_vigencia\": \"' ) || TRIM ( BOTH ' ' FROM NVL
(TO_CHAR (padrongeneric_anterior.fec_ini_vigencia ,'%Y-%m-%d
%H:%M:%S.%F3' ) ,'null' )) ) || '\",' ) ||
'\"fec_fin_vigencia\": \"' ) || TRIM ( BOTH ' ' FROM NVL
(TO_CHAR (padrongeneric_anterior.fec_fin_vigencia ,'%Y-%m-%d
%H:%M:%S.%F3' ) ,'null' )) ) || '\",' ) ||
'\"cod_dep\": \"' ) || TRIM ( BOTH ' ' FROM NVL
(padrongeneric_anterior.cod_dep ,'null' )) ) || '\",' ) ||
'\"cod_estado\": \"' ) || TRIM ( BOTH ' ' FROM NVL
(padrongeneric_anterior.cod_estado ,'null' )) ) || '\",' ) ||
'\"cod_usuregis\": \"' ) || TRIM ( BOTH ' ' FROM NVL
(REPLACE(REPLACE(REPLACE(padrongeneric_anterior.cod_usuregis,'\', '\\\\'
),'"','\\\"'),' ',' '), 'null' )) ) || '\",' ) ||
'\"fec_regis\": \"' ) || TRIM ( BOTH ' ' FROM NVL (TO_CHAR
(padrongeneric_anterior.fec_regis ,'%Y-%m-%d %H:%M:%S.%F3' ) ,'null' )) )
|| '\",' ) ||
'\"ind_del\": ' ) || TRIM ( BOTH ' ' FROM NVL
(padrongeneric_anterior.ind_del ,'null' )) ) || '}' ) || '",' ) ||
'"nuevo":' ) || '"' ) || '{' ) ||
'\"num_padgen\": \"' ) || TRIM ( BOTH ' ' FROM NVL
(padrongeneric_nuevo.num_padgen ,'null' )) ) || '\",' ) ||
'\"num_padgen_modif\": \"' ) || TRIM ( BOTH ' ' FROM NVL
(padrongeneric_nuevo.num_padgen_modif ,'null' )) ) || '\",' ) ||
'\"cod_sistema\": \"' ) || TRIM ( BOTH ' ' FROM NVL
(padrongeneric_nuevo.cod_sistema ,'null' )) ) || '\",' ) ||
'\"cod_tippadron\": \"' ) || TRIM ( BOTH ' ' FROM NVL
(padrongeneric_nuevo.cod_tippadron ,'null' )) ) || '\",' ) ||
'\"cod_tipdoc\": \"' ) || TRIM ( BOTH ' ' FROM NVL
(padrongeneric_nuevo.cod_tipdoc ,'null' )) ) || '\",' ) ||
'\"num_doc\": \"' ) || TRIM ( BOTH ' ' FROM NVL
(padrongeneric_nuevo.num_doc ,'null' )) ) || '\",' ) ||
'\"fec_regis_padron\": \"' ) || TRIM ( BOTH ' ' FROM NVL
(TO_CHAR (padrongeneric_nuevo.fec_regis_padron ,'%Y-%m-%d %H:%M:%S.%F3' )
,'null' )) ) || '\",' ) ||
'\"fec_modif_padron\": \"' ) || TRIM ( BOTH ' ' FROM NVL
(TO_CHAR (padrongeneric_nuevo.fec_modif_padron ,'%Y-%m-%d %H:%M:%S.%F3' )
,'null' )) ) || '\",' ) ||
'\"cod_tipsustento\": \"' ) || TRIM ( BOTH ' ' FROM NVL
(padrongeneric_nuevo.cod_tipsustento ,'null' )) ) || '\",' ) ||
'\"num_sustento\": \"' ) || TRIM ( BOTH ' ' FROM NVL
(padrongeneric_nuevo.num_sustento ,'null' )) ) || '\",' ) ||
'\"fec_ini_vigencia\": \"' ) || TRIM ( BOTH ' ' FROM NVL
(TO_CHAR (padrongeneric_nuevo.fec_ini_vigencia ,'%Y-%m-%d %H:%M:%S.%F3' )
,'null' )) ) || '\",' ) ||
'\"fec_fin_vigencia\": \"' ) || TRIM ( BOTH ' ' FROM NVL
(TO_CHAR (padrongeneric_nuevo.fec_fin_vigencia ,'%Y-%m-%d %H:%M:%S.%F3' )
,'null' )) ) || '\",' ) ||
'\"cod_dep\": \"' ) || TRIM ( BOTH ' ' FROM NVL
(padrongeneric_nuevo.cod_dep ,'null' )) ) || '\",' ) ||
'\"cod_estado\": \"' ) || TRIM ( BOTH ' ' FROM NVL
(padrongeneric_nuevo.cod_estado ,'null' )) ) || '\",' ) ||
'\"cod_usuregis\": \"' ) || TRIM ( BOTH ' ' FROM NVL
(REPLACE(REPLACE(REPLACE(padrongeneric_nuevo.cod_usuregis,'\', '\\\\'
),'"','\\\"'),' ',' '), 'null' )) ) || '\",' ) ||
'\"fec_regis\": \"' ) || TRIM ( BOTH ' ' FROM NVL (TO_CHAR
(padrongeneric_nuevo.fec_regis ,'%Y-%m-%d %H:%M:%S.%F3' ) ,'null' )) ) ||
'\",' ) ||
'\"ind_del\": ' ) || TRIM ( BOTH ' ' FROM NVL
(padrongeneric_nuevo.ind_del ,'null' )) ) || '}' ) || '"' ) || '}' ) ||
'}' ) ));

You might also like