Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create a primary key
Message
De
12/01/1999 20:55:02
 
 
À
12/01/1999 06:18:49
Carla Silva
Http - Produtos Informaticos, Lda.
Odivelas, Portugal
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00174961
Message ID:
00175319
Vues:
30
>How can I create a primary key with a FOR clause (FOR !DELETED())
>the code I`m using is:
>
>ALTER TABLE ceemcct ;
>ADD PRIMARY KEY str(numero,4)+dtos(Data_ldemp)+str(n_via,4) tag NumeroData
>
>Thanks

This can be done (as the others pointed out) but IMHO, it is a bad idea. First of all, indexes that use a FOR clause are not rushmore optimizable, and for the primary key this is bad news. You can get around this by creating a second, non-primary index and remove the FOR clause, but IMHO, the need to do what you are trying to do shows a less than optimal design.

In the long run, I think you will be happy using a surrogate primary key- one that has no meaning in the real world. That way, you don't have to recycle values. There are a slew of other reasons for doing this, just post if you need more-
Erik Moore
Clientelligence
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform