esus
Database
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
taa_atendprof
Parameters
Name
Type
Mode
Definition
BEGIN IF(tg_op = 'INSERT') THEN UPDATE tb_atend SET qt_referencia = (qt_referencia + 1) WHERE co_seq_atend = new.co_atend; UPDATE tb_ator_papel SET qt_referencia = (qt_referencia + 1) WHERE co_seq_ator_papel = new.co_lotacao; ELSIF (tg_op = 'DELETE') THEN UPDATE tb_atend SET qt_referencia = (qt_referencia - 1) WHERE co_seq_atend = old.co_atend; UPDATE tb_ator_papel SET qt_referencia = (qt_referencia - 1) WHERE co_seq_ator_papel = old.co_lotacao; END IF; RETURN NULL; END;