SYSTEMTI.NET

Please or Cadastrar to create posts and topics.

trigger para atualizar o TP atendimento e TP acidente na versão 2.02 do TISS

PROMPT CREATE OR REPLACE TRIGGER trg_hsman_atualiza_tp_tiss
CREATE OR REPLACE TRIGGER trg_hsman_atualiza_tp_tiss

BEFORE INSERT OR UPDATE ON atendime
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
BEGIN
IF :new.cd_convenio = 191 AND :new.tp_atendimento = 'U' THEN
:new.TP_ACIDENTE_TISS := '2';
:new.TP_ATENDIMENTO_TISS := '4';
END IF;
EXCEPTION
WHEN OTHERS THEN
raise_application_error(-20000, SQLERRM);

END;
/

Marcos Soares has reacted to this post.
Marcos Soares