Aman,
No string constant in VFP can exceed 255 characters. String variables can vastly exceed this. So you have to split your string constants up into pieces less that 255 characters:
lcSQL = "select ...." + ;
" from ..." + ;
" where ... "
SQLExec( ... lcSQL )
In VFP8 and later you can use the new textmerge functionality:
text to lcSQL textmerge noshow
select ...
from ...
where ...
endtext
? lcSQL
which has the benefit that you can easily copy/paste sql statements between VFP and QueryAnalyzer.
>I am migrating to SQL Server as backend. I will be using VFP 9 in future. At the moment I have VFP 6 & 8 available, but the application is in VFP 6.
>
>I tried run a long sql statement using SqlExec function. VFP Error "Expression too long- String length > 255 characters" is shown. I use complex VFP SQL statements for reporting. The only way I figured was to migrate these to SQL Server format & run using SQLEXEC. I read something about Cursor Adapter, but have not used it.
>
>1) Is there any other method / technique to run long queries?
>2) Does Cursor Adapter retrive one table at a time? or can it be used for complex querries?
>
>Aman