Answer the question
In order to leave comments, you need to log in
What rights are needed to create a trigger?
Hello.
I'm trying to create a trigger that responds to INSERT and UPDATE operations in a table from another schema UM_EVENTS.ALL_EVENTS
CREATE OR REPLACE TRIGGER ALL_EVENTS_LOG
AFTER INSERT or UPDATE ON UM_EVENTS.ALL_EVENTS
FOR EACH ROW
declare
-- local variables here
begin
if inserting then
insert into WAREHOUSE.ALL_EVENTS_LOG
(ID, TYPE, TIME_RECEIVED)
values(
:NEW.ID,
'INSERT',
sysdate) ;
END IF;
if updating then
insert into WAREHOUSE.ALL_EVENTS_LOG
(ID, TYPE, TIME_RECEIVED)
values(
:OLD.ID,
'UPDATE',
sysdate) ;
END IF;
end ALL_EVENTS_LOG;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question