Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP relationships and NULLS allowed
Message
From
03/11/1998 13:52:03
 
 
To
03/11/1998 13:40:29
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00153763
Message ID:
00154051
Views:
22
Yes, the code is correct. I had to remind myselft that lcChildId is set to the foreign key (which is backwards in my mind *s*).

Anyway, that said, maybe I'm wrong, but it seems like you can't have it both ways: if you enter a child record with a .NULL. foreign key, then you _have_ violated the restricted insert RI. Rereading your message, it seems to me that you do not in fact want to use "restricted."

...snip
>
>Second and more important, is the SEEK() returns .f. meaning the trigger will fail. If the Child table has NULL in the foreign key and the column allows NULLs the SEEK() shouldn't even occur. It should be more like:
>
>if IsNull( lcChildID) and DBGetProp( ChildTableForeignKeyColumn, "Field", "DefaultValue") = ".NULL."
> llRetVal = .t.
>
>else
> seek(....
>endif

...snip
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform