Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Uniqueness error
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01242809
Message ID:
01242884
Views:
12
>>>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform