Microsoft KB Archive/142887

= FIX: SQL Select Inconsistency with SET ANSI OFF and ALLTRIM =

Article ID: 142887

Article Last Modified on 3/24/2000

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition

-



This article was previously published under Q142887



SYMPTOMS
Using an ALLTRIM function with an SELECT-SQL statement when SET ANSI=OFF may result in the return of an incorrect subset of records.



STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in Visual FoxPro 3.0b for Windows.



Steps to Reproduce Problem
  Create a program file, and enter the following lines of code into it: ************ Begin Program *******************

CREATE TABLE x1 (id C(4)) INSERT INTO x1 VALUES("AB") INSERT INTO x1 VALUES("CD")

CREATE TABLE x2 (id C(4)) INSERT INTO x2 VALUES ("ABC") INSERT INTO x2 VALUES ("CDE")

SET ANSI OFF SELECT x1.* FROM x1,x2 WHERE ALLTRIM(x1.id)=ALLTRIM(x2.id)

************* End Program ********************  Run the program created in step 1. No records are returned from the SELECT statement when there should be two records returned. Change "CREATE TABLE x2 (id C(4))" to "CREATE TABLE x2 (id C(5))" in the program created in step 1. Run the program again. The records are returned correctly.

Additional query words: buglist3.00 fixlist3.00b VFoxWin

Keywords: kbbug kbfix KB142887

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.