Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Uniqueness error
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01242809
Message ID:
01242884
Vues:
14
>>>>Vfp 9 SP1
>>>Then you could use Integer AUTOINC instead of N(10).
>>>That way you will be sure that you always will have a unique ID. There are some difficulties to get that Id back but all could be done.
>>
>>If you want to add children before you save the parent, you would not be able to do it with AutoInc field.
>
>And from where these children comes from?
>Even orphans have some parents :-)
>
>You could add children firs, but then after you add parents you must update Parent(s) FK fields.
>You could have a records like this:
>
>
>Id   Parent1    Parent2
>-------------------------
>1     7           15 && Child
>7     0            0 && First parent
>15    0            0 && Second parent
>
Parent

Id  Other fields

Child

ID ParentID  Other fields
In the form I add a parent and a child. How can I know what ParentID to put in the Child table without saving parent first?

This problem has no solution with autoincrement fields.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform