Trigger updating same table shia la boeuf dating

Rated 4.3/5 based on 771 customer reviews

There are some hacks around it, but they are almost always a bad idea.Tom Kyte has published a good review on why triggers are generally a bad idea.from people; Then: create or replace trigger People_Update instead of update on people_vw for each row update people set col1 = :new.col1 , col2 = :new.col2 . Unfortunately, if you can't change the application to use this view, I'm afraid you're out of luck. Why not have a temp table where you can store the values on the person (not spouse) being updated and then have a trigger that fires when a row is inserted in to the temp table.Below is a very rough outline that may help (or may distract)!The triggers work fine in this case and successfully update the folder with the total bytes of all files contained in that folder.

1 create or replace trigger bef_upd 2 before update of person_name on people 3 for each row 4 begin 5 UPDATE spouse SET spouse_name = :new.person_name WHERE spouse_id = :new.person_id; 6* end; SQL There is a solution, but it sounds like you won't be able to use it.

that being said, i have typically used triggers to handle most of the application's shortcomings (deleting unconstrained child records when parent record is deleted, etc).

i now have a situation in which i need to update another row in the same table after a related row is updated.

The problem I am running into is when I try to add a trigger on the folders table to update the bytes value for its parent Id.

I'm getting a mutating table error (ORA-04091) because the triggers on the folders table are also updating the folders table (although it is always going to be a different row and there won't be any loops in the hierarchy) CREATE OR REPLACE TRIGGER aru_bytes_folders AFTER UPDATE OF bytes ON folders FOR EACH ROW WHEN (OLD.parent Id IS NOT NULL) BEGIN UPDATE folders f SET f.bytes = f.bytes (: NEW.bytes - : OLD.bytes) WHERE = : OLD.parent Id; END aru_bytes_folders; Is there something that can be done to get this to work?

Leave a Reply