>>>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?
>>
>>Sorry Mike, I give up, cannot find what might be the problem and I spent to much time already on this (by the way, all my tests I did them using execscript instead of macro and got the same results, so is not macro specific)
>
>Thanks for trying Hugo. It looks like there is a maximum of 128 fields that can be updated in a single REPLACE command. I never saw that in the help. So such code would have to concatenate until the length of line is under 8192 and there are less than 128 fields in the command. Wow,
So it would seem. Following code is OK at 128, fails at 129:
STORE "" TO lcCmd1, lcCmd2
FOR lnIx = 1 TO 128 STEP 1
lcFld = "F" + PADL( LTRIM( STR( lnIx ) ), 3, "0" )
lcCmd1 = lcCmd1 ;
+ IIF( EMPTY( lcCmd1 ), "", "," ) ;
+ lcFld + " I"
lcCmd2 = lcCmd2 ;
+ IIF( EMPTY( lcCmd2 ), "", "," ) ;
+ lcFld + " WITH 1"
ENDFOR
CREATE CURSOR Test ( &lcCmd1 )
REPLACE &lcCmd2 IN Test
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up