Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> mutating table issue
I have a table that holds, say, sales order line info, SALES_ORDER_LN, that
contains the cols SO_NUM, SO_LN_NUM, and SO_VALUE. (ok, my real scenario is
more complex, but it is basically the same problem). Anyway, I need to have
a trigger on the SALES_ORDER_LN table that will check to see if that SO_NUM,
has a record that has a SO_VALUE of a particular value. So, if I insert the
following data:
SO# LN# VAL
---- ----- ------
10 2 C
In the trigger, I want to check that SO# to make sure that SO#10 doesn't contain a record (line#) that has a SO_VALUE of "A". So, my challenge is finding a way to query the SALES_ORDER_LN table in the trigger that resides on that table. Hence, I get the mutating table. I hope this wasn't too confusing of a description.
Basically, if the following exists....
SO# LN# VAL
---- ----- ------
10 1 A
and I insert this....
10 2 C
I want to be able to know that 10/1/A exists so I can do another action.
Thanks. Received on Thu Oct 17 2002 - 19:58:42 CDT