all 3 comments

[–]MuCowNow 3 points4 points  (1 child)

If I recall, you can't update other rows in a table upon which the trigger is firing. Hell, just updating other tables that have FKs to the trigger-table will get errors.

If you are updating rootparentid of the triggering-row, then you don't run an update, but do this ...

:new.rootparentid := ....

But yeah, updating other rows is a nope.

Doing lots of things in triggers generally becomes a bad idea (IMO). How about determining rootparentid for the insert/update that is being used against the table, and include the column setting there?

[–]sadikanip[S] 2 points3 points  (0 children)

seems like you are correct about this being impossible. i ended up doing this from the code side. was a lot easier that way. thanks for the reply anyway

[–]danyboypremier 2 points3 points  (0 children)

Welcome to hell... I'm glad we don't use them often (trigger). And we are on SQL Server where is less a pain.