Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rushmore'ing substrings
Message
From
21/01/2003 16:58:51
 
 
To
21/01/2003 16:52:20
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00743958
Message ID:
00744006
Views:
20
This is interesting, but my first thought is then I'd have a second table with 40 million records (the length of our field is 80), in addition to the original table with 500K records. Seems excessive to be able to search a single field. :)

-----------

OK, if it is for a single table and field, and you need to start at any position, I think you can do it yourself. A generic solution might require some additional work.

I would use this approach:

Let's assume your field has 30 characters.

Create a separate table, with 30 records for each record in your original table.

Fields: a link to the PK of the main table, a number (1-30), to identify the position, and a 30-character expression.

Copy the following expression to each of the 30 records:


upper(padr(substr(MyValue, i), 30))
Where MyValue is the field you want to index on, and i ranges from 1-30.

Update the secondary table automatically, with a trigger.

HTH,

Hilmar.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform