Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Primary Keys
Message
De
06/03/2003 09:56:51
 
 
À
06/03/2003 05:36:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00762036
Message ID:
00762157
Vues:
11
Just to add to what evryone else says

Integer PK is best.

You can make up a candidate Index as well by combining the other 2 values into 1 value for indexing but I reccomend you use a datetime field for this index instead.

BTW
I had a lot of trouble when first using integer PK in VFP


My problem was that VFP reported errors whenever I tried to insert data that conflicted with the PKs of deleted records.

Finally Walter Meester made all my problems go away by explaining how I could filter out the
deleted records by adding a !DELETED() as a filter for the PK index

This messes Rushmore up so you have to add another index (PK2) on the same field .This will ensure rushmore works again.

You will find many trains of thought on this, but I have used this strategy very succefully for a few years now.



>Hi all,
>
>Was wondering, is there any way of using two primary keys in sync in the one table?? I am using a a table to store information on bookings, and in the table, it should store customer details, time, date, etc.
>
>I can't have the primary key as "date" alone, as I will have more than one customer on any one day, and I also can't have "time" as a primary key alone, as I will have customers on different dates at the THAT time. E.G.
>
>customer1 12.00 02-03-2003
>customer2 14.00 02-03-2003
>customer3 12.00 02-04-2003
>
>My problem is, I need to link these two fields("time" and "Date") so that they together make up a primary key, so that there is no time (which is usually hourly, as it's for a sports centre) AND date which is identical to another time AND date in that table.
>
>Can I have corresponding primary keys in the same table or do I need to go about it a different way????
>
>All suggestions welcomed.
>
>Thanks in advance,
>Mick
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform