CREATE trigger ttbsetor_b02d for tbsetor
active before delete position 1
AS
BEGIN
   IF(OLD.CODIGO > 0) THEN
   BEGIN
      DELETE FROM TBSUB_UP   WHERE UP_ID = OLD.CODIGO;
      DELETE FROM TBUP_FLUXO WHERE UP_ID = OLD.CODIGO;
   END
END;

