Oracle triggers - problem with mutating tables

前端 未结 8 1851
情书的邮戳
情书的邮戳 2020-12-06 19:31

My tables:

TableA (id number, state number)
TableB (id number, tableAId number, state number)
TableC (id number, tableBId number, state number)
8条回答
  •  鱼传尺愫
    2020-12-06 19:53

    Doing things like this is a great temptation, and if you follow the suggestions in the Tom Kyte article referenced by others it is possible. However, just because something can be done doesn't mean it should be done. I strongly recommend that you implement something like this as a stored procedure/function/package. Complex logic of this sort should not be performed using triggers, despite the obvious temptations, because it greatly raises the complexity of the system without a corresponding increase in utility. I have to work on code like this occasionally and it's no joy.

    Good luck.

提交回复
热议问题