Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Undocumented feature of Indexing
Message
From
08/03/2000 09:19:40
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00343211
Message ID:
00343222
Views:
28
>Hi All,
>I didn't know this and while I'm sure everyone else did *s*, I'm going to post it anyway.
>
>VFP throws an error when you attempt to index on a memo field. Error 34 - Operation is invalid for a Memo, General, or Picture field. But if you wrap the memo field in a text manipulation function (e.g. alltrim(), upper()), it allows it.
>
>Someone posted some code about indexing on a memo field and I sent back saying you can't do that. They sent back saying I already do this, here it is and why does it work.
>
>Any ideas?

The function returns a string, not an explicit memo, so it's indexable. Look at the difference between TYPE('mMemoField') and TYPE('UPPER(mMemoField)'). BTW, this is one of those cases where VARTYPE() and TYPE() are not interchangable, because a field is involved.

Other problems related to maximum key length may arise from using a memo field as an index source; if the longest memo field content is over 240 chars, the index operation will fail during index creation...and there are all sorts of consequences - the length of the key is established at the time of tag creation, which can cause mis-sortation for memo fields whose data content length exceeds the initial longest memo field's length and creation will fail if all the memo fields are empty.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform