Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to create primary key index tag with filter?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00129102
Message ID:
00129107
Vues:
21
>I am writing a program that re-indexes the tables in a database. First, the program delete all the tags ("delete tag all"). Then it issues "index on xxx tag yyy [for zzz] [descending] [candidate]". This works fine unless the tag needs to be a primary key. The "index on..." command doesn't seem to have a way to specify that the tag is to be the primary key. The only solution I've found is to use the command "alter table aaa add primary key bbb...". The problem with this approach is that it doesn't allow one to specify "descending" or a filter expression.
>
>How does one programmatically create a primary index tag that contains a filter or the "descending" clause?
>
>Thanks,

Chris,

As for descending tags, just make them all asending and SET ORDER TO Whatever DESCENDING when you want descending.

You cannot create a primary key index with a FOR clause in code. A PK is supposed top reflect all records in the table and so there is no mehtod of creating one with a filter. You can do it in the designer, but I think that was an oversight.

If the problem is deleted records you can use surrogate primry keys and forget about the deleted rtecprds.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform