Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Programmatically Setting Descending Primary Key
Message
De
13/12/2006 20:49:55
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Programmatically Setting Descending Primary Key
Divers
Thread ID:
01177451
Message ID:
01177451
Vues:
67
Hi,

I am writing a utility that uses ataginfo() to discover tags that are primary or candidate keys and then remove them from a table, storing the index info so that I can later restore them.

In my restore utility I am able to do the following to restore the candidate indexes in either descending or ascending order in the cdx file:
lcTable = [Customer]
lctagexpr = "icustomerid"
lctagfilter = "icustomerid > 1000"
lctagname = "customer"
lctagproc = ["MACHINE"]
lctagorder = "DESCENDING"

index on &lctagexpr for &lctagfilter tag &lctagname ;
  collate &lctagproc &lctagorder additive
I can also to the following to restore a primary key in ascending order:
alter table (m.lcTable) add primary key &lctagexpr ;
  for &lctagfilter tag &lctagname collate &lctagproc
However in the VFP IDE it is possible to make a primary key that is in a descending order. I can not figure out how to do this programmatically. Functionally I can just use a candidate key, but then commands like primary()will not behave as they did pre-strip.

Thanks!
Carole Shaw
Fred Hutchinson Cancer Research Center

Eagles may soar, but weasels don't get sucked into jet engines.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform