FIX: "Syntax Error" with EVAL of ALL or LTRIM in SELECT-SQL (193079)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 5.0
- Microsoft Visual FoxPro for Windows 5.0a
This article was previously published under Q193079 SYMPTOMS
If you issue a SELECT SQL statement that contains a WHERE clause comparing
a field value to an expression, which involves an ALLTRIM() or LTRIM()
function that is passed to the EVALUATE() function, if the trim function
trims a leading space or spaces the following error occurs when the SELECT
statement is processed:
Syntax error.
RESOLUTION
As a workaround, trim the leading space or spaces by using STRTRAN() rather
than ALLTRIM() or LTRIM().
The following example demonstrates the workaround:
SELECT *, .t. FROM temp_table ;
WHERE temp_table.cUsageTL = EVALUATE(STRTRAN("lcService" ;
+ (" 91")," ","")) ;
INTO CURSOR Temp4
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This bug has been corrected in Visual
FoxPro 6.0.
REFERENCES
(c) Microsoft Corporation 1998. All Rights Reserved. Contributions by Jim
Saunders, Microsoft Corporation
Modification Type: | Major | Last Reviewed: | 8/12/1999 |
---|
Keywords: | kbbug KB193079 |
---|
|