Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding Indexes to VFP tables programmatically
Message
From
16/07/2002 16:31:06
 
 
To
16/07/2002 16:20:15
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00679363
Message ID:
00679374
Views:
25
Pick an expression, any expression will do.

Indices accept any type of information so long as the data types being joined are the same.

e.g.

INDEX ON firstname TAG firstname
INDEX ON lname + fname TAG name
INDEX ON STR(NAME_ID) + lname TAG weird
INDEX ON DTOS(datefield) TAG datefield
INDEX ON TTOC(datetimefield) TAG dtfield


I think you get the idea. You choose a function and it can become part of your INDEX expression. Notice I used DTOS() for date expressions.

I got one for you, you want to reverse the order of the date in the index. There are two ways to achieve this.

INDEX ON 99999999 - VAL(DTOS(datefield)) TAG datefield

OR

INDEX ON DTOS(datefield) TAG datefield
SET ORDER TO datefield DESCENDING


Of course the application of the index will determine which one you would choose. The first one has a disadvantage of being too complex to use for Rushmore Optimization.

Before going to far creating wild indices, look at the Rushmore Optimization sections of Help.
Gordon de Rouyan
DC&G Consulting
Edmonton, Alberta
Email: derouyag@shaw.ca
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform