|
Posted by Jason Lepack on 06/11/07 19:33
So based on your description, anything at all can be put into pk_A.
However, in B you to make sure that anything put into B.fk_B_A must
already exist in A.pk_A
Based on your DDL you can remove the constraint on fk_B_A because
we're going to replace this functionality with a Trigger.
Since this is educational I will direct you to look at the INSTEAD OF
clause for triggers, and tell you that you need the trigger to be on
B, not A.
If you are still stuck, just post back.
Cheers,
Jason Lepack
On Jun 11, 2:55 pm, Wojto <jestem.woj...@interia.pl> wrote:
> Well.. to be honest I need to solve this problem as academic exercise...
> It is rather didactic than business problem. So I need to enforce the
> relationship and it must be done with trigger. It will be checked by
> trial of puting wrong data in the tables (rollback) and than correct
> data (normal commit). But with my declaration I can't put anything in
> the tables... The trigger is fired just after the insert while I need it
> to be fired, lets say, on commit. So this is the "real" prblem :-)
>
> Thanx and sorry for this mess :-)
[Back to original message]
|