What's the reason you are using macro substitution? Try SQLEXEC parameters instead.
lcCustcode = "5571"
lcCustname = "John Doe"
lcLongvar = PADL("TEST",500,"-")
SQLEXEC( h, ' INSERT INTO customers ' + ;
'VALUES( ?lcCustcode, ?lcCustname , ?lcLongvar ) ' )
BTW, VFP character field size is limited to 254 characters.
>Thanks Sergey, I was wrong about the size limit of VFP char variables, i must say char field limit. My problem is the following:
>
>I'm using MySQL as database server, i sent SQL commands to the server using SQLEXEC, by example:
>
>Case 1 (using variables y less than 256 chars everything works fine)
>
>lcCustcode = "5571"
>lcCustname = "John Doe"
>SQLEXEC( h, ' INSERT INTO customers ;
> VALUES( "&lcCustcode","&lcCustname" ) ' )
>
>
>Case 2 (using a long char variable - i can´t use macro expansion because VFP rejects the lenght of the command)
>
>lcCustcode = "5571"
>lcCustname = "John Doe"
>lcLongvar = PADL("TEST",500,"-")
>SQLEXEC( h, ' INSERT INTO customers ;
> VALUES( "&lcCustcode","&lcCustname","&lcLongvar" ) ' )
>
>...So i decided to write my variables to a text file and then use:
>
>SQLEXEC(h, ' ;
> LOAD DATA LOCAL INFILE "DATA.TXT" ;
> INTO TABLE customers (custcode,custname,comments) ' )
>
>MyODBC 2.5 allowed me to do that, but the new versíon don´t.
>
>I don´t know another way of using SQLUPDATE to pass long variables, do you know how ?
>
>Thanks in advance !
--sb--