Posts

Showing posts with the label oracle11g

I have an error with trigger using if conditional and update

I have an error with trigger using if conditional and update Executing this trigger in ORACLE I got the following error: Table, View Or Sequence reference 'OCEX_COMI.FECHA_ASIG_GT' not allowed in this context. This is my trigger: create or replace trigger ocex_comi_total before insert or update of id_gt,fecha_asig_gt on ocex_comi for each row begin if ((ocex_comi.fecha_asig_gt > to_date('2018-12-15','yyyy-mm-dd')) and (ocex_comi.fecha_asig_gt < to_date('2019-01-01','yyyy-mm-dd'))) then update ocex_comi cm set cm.PAGO_COM = (select uea.total_bono_especial from OCEX_UEA uea join OCEX_GUIA_TRANSITO gt on uea.id_uea = gt.dest_id where gt.cod_gt=cm.id_gt) where cm.id_gt = (select gt.cod_gt from ocex_guia_transito gt JOIN ocex_uea uea on uea.id_uea=gt.dest_id where gt.cod_gt=cm.id_gt); else update ocex_comi cm set cm.PAGO_COM = (select uea.total_x_pnp fr...