Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Command line length 8,192
Message
From
14/07/2014 14:32:49
Mike Yearwood
Toronto, Ontario, Canada
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01603641
Message ID:
01603661
Views:
65
>>I agree it seems to be something other than command line length, except that even when there is no syntax error in the concatenated string, it generates a syntax error after exceeding a certain length.
>
>I was suspecting SET MEMOWIDTH was at play here, inserting a soft carriage return and thus screwing the command, but even after changing it to 8192 the problem remains. I even tried to generate the command like this:
>
>
>replace csrTest.cField1 with 'abc',;
>csrTest.cField1 with 'abc',;
>...
>csrTest.cField1 with 'abc';
> in csrTest
>
>
>but it also fails after certain length and I cannot see why...
>
>Maybe you should change your strategy and work with an object from scatter name, changing its properties values in the scan loop and then gather name?

That would be painfully slow. What we ended up doing was breaking the replace command every 2,000 chars. That way as many fields are updated at once as possible. I know I've built massive SQL well beyond 2000 chars without this problem.

I have seen building SQL with embedded semicolons cause a syntax error, and removing them either programmatically before the macro or not adding them manually in the first place not have the error. Why is the length different depending on the alias and/or field names too?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform