Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP relationships and NULLS allowed
Message
De
03/11/1998 13:52:03
Nancy Folsom
Pixel Dust Industries
Washington, États-Unis
 
 
À
03/11/1998 13:40:29
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00153763
Message ID:
00154051
Vues:
25
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform