Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Large Field Length and Indexes
Message
From
06/04/2005 13:58:54
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Large Field Length and Indexes
Environment versions
Visual FoxPro:
VFP 6 SP5
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01002020
Message ID:
01002020
Views:
69
Hi,

In our application we have a field that was made too small. The field is used to name an event. It is currently a character field with a width of 30. We decided to make the field as long as possible without changing it to a memo field so I changed the field length to 250. When I clicked save in Stonefield I got the error "Invalid Key Length". After reading this MS web page, http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_foxhelp/html/err112.asp, I discovered that an CDX must be between 1 and 240 characters. Since one of the indexes is a compound index using the name and some other fields I decided to shorten it to 200. I'm just not sure if that 240 limit applies to one index or all indexes based on the table. I made the structure of the table (omitting fields not in any index) look like this:

MyTable
MyPK I(4)
MyFK I(4)
MyName C(200)
MyActiveStatus C(1)
MyArchiveStatus C(1)

Indexes
1. MyPK (Primary Index)
2. MyFK
3. BINTOC(MyFK) + MyActiveStatus + MyArchiveStatus + UPPER(MyName)

I tested it and everything seems to work properly. But I'm not sure if by increasing the width of "MyName" so much that I might be creating a bug that won't be discovered until later. Any ideas? Is this safe?

Thanks,
Chris
Next
Reply
Map
View

Click here to load this message in the networking platform