Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Referential Integrity question
Message
De
17/07/1999 13:14:11
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
17/07/1999 12:24:34
Rex Mahel
Realm Software, Llc
Ohio, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00242757
Message ID:
00242763
Vues:
32
>All,
>
>I have two file in a one to many relationship. I am trying to restrict insertion of records into a child table unless a parent record exists, but I have found that the act of inserting a record in the child causes the trigger to fail unless I have a dummy record in the parent with a blank key.
>
>Two question:
>
>1 Is there a way to insert a record in the child with the parent key already replaced?
>
>2. Is putting a dummy record in the parent the only way around this problem?
>
>TIA
>
>Rex

Rex,
1) Insert into child (pkey) values (parent.linkkey)
instead of append blank.
Or :
Child pkey default value something like :
iif(used("parent"), parent.linkkey, somevaluenotpossibleinparent)
then you could use append blank.
2) No as to the above :)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform