Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rushmore work differently in VFP9?
Message
From
10/03/2005 08:49:46
 
 
To
10/03/2005 08:40:59
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00994380
Message ID:
00994388
Views:
18
Without going into detail, I advice you to NEVER, I repeat NEVER, use ALLTRIM() in an index expression, it's asking for problems! All index expressions MUST give a fixed length value!

>Would some try this sample code in VFP8, then again in VFP9? On my machine the both queries run optimized in VFP8, but only the 2nd one in VFP9. I don't know what settings to check other than ANSI and EXACT. Could it be a problem with VFP9?
>
>SET ANSI OFF
>SET EXACT ON
>CLEAR
>* Turn rushmore reporting on
>SYS(3054,2)
>* Create a test cursor
>CREATE CURSOR test (field C(10))
>INDEX on field TAG field
>INDEX on ALLTRIM(field) TAG field_t
>* Put some data in the cursor
>FOR i = 1 TO 10000
> INSERT INTO test VALUES (SYS(2015))
>ENDFOR
>* Determine the last value
>cValue = LEFT(test.field,LEN(ALLTRIM(test.field))-1)
>* Try the untrimmed index
>?"This one works"
>?"---------------------------------"
>SELECT * FROM test WHERE field = cValue INTO CURSOR index
>* Try the trimmed index
>?
>?"This one does not work"
>?"---------------------------------"
>SELECT * FROM test WHERE ALLTRIM(field) = cValue INTO CURSOR noindex
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform