On Tue, 4 Jun 2002 13:21:36 -0700 , "Zhou, Lixin" <LZhou@illumina.com>
wrote:
>I like to create a trigger on table A. When a new row is inserted into A
>(ex: with i = 5), I like to have the trigger inserts a new row in table B
>whose field "i" has the same value as that of the A's (ex: i = 5).
>
>As I do this, the error message is something like: "referential integration
>violation - key referenced in B not found in A". This makes sense to me
>since at the time the trigger inserts in B, A's new row is not visible yet
>-- not committed yet.
Lixin,
your trigger should fire AFTER INSERT instead of BEFORE INSERT.
HTH.
Servus
Manfred