Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deleting records - how not to impact relationships
Message
 
To
17/05/2006 16:17:15
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8
OS:
Windows 2000 SP4
Network:
SAMBA Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01122987
Message ID:
01122993
Views:
19
This message has been marked as the solution to the initial question of the thread.
>Hi:
>
>I have two tables, one that holds some customer records, and another that holds their tasks. they are related by the customer id.
>
>i do not allow others with my program to delete records. my major concern is how this affects the relationship between the two tables. if someone enters a new customer (say customer #1000), then enters a task for this customer, and then decides to delete the customer record, if a new customer gets entered it would have the customer #1000 and would now have the previous customer's task.
>
>do i simply not understand what autoincrementing fields do? if someone deletes a record with customer #1000, would the next customer get #1001? Or, when programmers allow deletion of records, do they just have it marked for deletion but not actually deleted, so the customer # is still there?
>
>Thanks!
>
>Paul

If you use AutoInc field next customer will be 1001, no metter if you PACK table or not.
AutoInc fields keeps growing untill you explicitly reset them.
Also I suggest you to use Referntial Integrity in DataBase so when the user deletes some customer this automaticly to delete all customer's related info from other tables. That way you won't bother if your next customer becomes 1000 will He/She have old 1000 customer task(s).
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform