I need to call a trigge开发者_Python百科r when a column is updated in table X Trigger is inserting values from table X to table Y can we just insert the values in X to Y using the column names in X?
Something like this perhaps?
create trigger tr_U_X
on X
for Update
as
begin
if update(email)
insert into Y
(name, email)
select i.name, i.email
from Inserted i
end
You can add below code to add trigger
CREATE OR REPLACE TRIGGER Trigger_Name BEFORE
INSERT OR DELETE OR UPDATE
ON table_name REFERENCING NEW AS NEW OLD AS OLD FOR EACH ROW
BEGIN
if condition > 0 then
raise_application_error(-20010,'your message');
end if;
END;
I have managed it my Financial ERP you can use it . Thank you .
精彩评论