Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Programmatically Setting Descending Primary Key
Message
From
13/12/2006 20:49:55
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Programmatically Setting Descending Primary Key
Miscellaneous
Thread ID:
01177451
Message ID:
01177451
Views:
66
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.
Next
Reply
Map
View

Click here to load this message in the networking platform