Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I avoid 'SQL: Statement too long (Error 1812)'
Message
From
13/11/2003 09:14:26
Mike Sue-Ping
Cambridge, Ontario, Canada
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00849187
Message ID:
00849486
Views:
29
Hi Sergey,

I don't know how to cut and paste the contents of the string variable. It appears that VFP won't let you do so from the debugger if the contents of the variable is "too long"?

Anyway, it goes something like this:
SELECT DISTINCT A.FIELD1, A.FIELD2 AS MYFIELD1, B.FIELD1, 'TEST' AS MYFIELD2

FROM TABLE1 A, TABLE2 B WHERE !DELETED("TABLE1") AND A.FIELD3=B.FIELD2 AND

A.FIELD4=1234 OR A.FIELD4=2345 OR A.FIELD4=3456 OR A.FIELD5=4567 OR ...
As you can see, the length of the SQL statement depends on the last part where table a.field4 is being compared to different values repeatedly. The actual syntax is not the problem since it executes without any problems if the latter contains only a "few" comparisons.

As I've said in my last message, the total length of the string variable is only 1844 chars yet VFP complains it is "too big".

Mike


>Can you post the select statement that generates an error. The VFP limits are documented in Visual FoxPro System Capacities in the help.
>
>>Thanks for the reply Sergey.
>>
>>My string is only 1844 characters and I get the error. Any ideas as to why? Where is it documented that a VFP statement cannot be > 8192 chars?
>>
>>Mike
>>
>>>The lenght of any VFP statement cannot exceed 8,192 characters.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform