/******************************************************************************/
/******************************************************************************/
/*                                                                            */
/* Trigger: DTULTATU_GRUPOBRIGOCOR                                            */
/* Tabela : GRUPOBRIGOCOR                                                     */
/*                                                                            */
/* Criação:                                                                   */
/*                                                                            */
/*                                                                            */
/******************************************************************************/

CREATE OR REPLACE TRIGGER DTULTATU_GRUPOBRIGOCOR
BEFORE INSERT OR UPDATE OR DELETE
ON GRUPOBRIGOCOR FOR EACH ROW

BEGIN
   IF INSERTING THEN
      :NEW.DTULTATU := SYSDATE;     
		 
   END IF;   
   
   IF UPDATING THEN
	  :NEW.DTULTATU := SYSDATE;
   
   END IF; 
   
   IF DELETING THEN
      INSERT INTO DELETECACHE (NMTABLECACHE, CDFILICACHE, DSKEYCACHE, DTULTATUCACH)
                       VALUES ('GRUPOBRIGOCOR', '', 'CDGRPOCOR='||:OLD.CDGRPOCOR||';CDGRUPOOBRIG='||:OLD.CDGRUPOOBRIG||';', SYSDATE);
   
   END IF;
END;
/

ALTER TABLE GRUPOBRIGOCOR MODIFY DTULTATU DEFAULT SYSDATE
/

-- VERSAO --
BEGIN ATUVEROBJ('DTULTATU_GRUPOBRIGOCOR','6.19.001'); END;
/
