CREATE OR REPLACE TRIGGER DTULTATU_CONFTELAINICARD
BEFORE INSERT OR DELETE OR UPDATE
ON CONFTELAINICARD 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 ('CONFTELAINICARD', :OLD.CDFILIAL, 'CDFILIAL='||:OLD.CDFILIAL||';CDCONFTELA='||:OLD.CDCONFTELA||';CDLOJA='||:OLD.CDLOJA||';', SYSDATE);
	END IF;
END;
/