FIX: Long SQL SELECT WHERE Clause: "SQL Internal Error"

Last reviewed: October 14, 1997
Article ID: Q105119
2.50    | 2.50
WINDOWS | MS-DOS kbprg kbfixlist kbbuglist kberrmsg

The information in this article applies to:

  • Microsoft FoxPro for Windows, version 2.5
  • Microsoft FoxPro for MS-DOS, version 2.5

SYMPTOMS

A Structured Query Language (SQL) SELECT statement with an extremely long WHERE clause can cause the following error message:

   SQL Internal Error

STATUS

Microsoft has confirmed this to be a problem in FoxPro 2.5 for MS-DOS and FoxPro 2.5 for Windows. This problem was corrected in FoxPro 2.5a for MS-DOS and FoxPro 2.5a for Windows.

MORE INFORMATION

Steps to Reproduce Problem

Assuming FoxPro is installed in a directory named FOXPROW on drive C, issue the following code:

   SET DEFAULT TO c:\foxprow\tutorial
   USE customer

   SELECT company FROM customer ;
   WHERE (cno > '10000' .OR. cno < '20000') ;
     .AND. ('A' $ UPPER(company) .OR. 'B' $ UPPER(company) .OR. ;
       'C' $ UPPER(company) .OR. 'D' $ UPPER(company) .OR. ;
       'E' $ UPPER(company) .OR. 'S' $ UPPER(company)) ;
     .AND. ('A' $ UPPER(contact) .OR. 'B' $ UPPER(contact) .OR. ;
       'C' $ UPPER(contact) .OR. 'D' $ UPPER(contact) .OR. ;
       'E' $ UPPER(contact) .OR. 'S' $ UPPER(contact)) ;
     .AND. ('A' $ UPPER(address) .OR. 'B' $ UPPER(address) .OR. ;
       'C' $ UPPER(address) .OR. 'D' $ UPPER(address) .OR. ;
       'E' $ UPPER(address) .OR. 'S' $ UPPER(address)) ;
     .AND. ('A' $ UPPER(city) .OR. 'B' $ UPPER(city) .OR. ;
       'C' $ UPPER(city) .OR. 'D' $ UPPER(city) .OR. ;
       'E' $ UPPER(city) .OR. 'S' $ UPPER(city)) ;
     .AND. ('A' $ UPPER(state) .OR. 'W' $ UPPER(state) .OR. ;
       'B' $ UPPER(state) .OR. 'C' $ UPPER(state) .OR. ;
       'E' $ UPPER(state)) ;
     .AND. (state = 'WA' .OR. state = 'CA') ;
     .AND. (zip > '10000' .OR. zip < '100000')


Additional reference words: FoxDos FoxWin 2.50 buglist2.50 fixlist2.50a
errmsg err
msg sequel
KBCategory: kbprg kbfixlist kbbuglist kberrmsg
KBSubcategory: FxprgSql
Solution Type : kbfix


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 14, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.