General information
Category:
Coding, syntax & commands
>>try putting your sql statement into a variable and execute that way. the problem may be that vfp is asking you to build a string for the sql. if this is direct copy from your prg, should be
>>
>>=sqlexec(lnConnect,"insert into myTable "+;
>> "(field1, field2, field3) values "+;
>> "(val1, val2, val3)" etc...
>>
>I tried storing the sql statement to a variable. The select statement will work by itself, and I'm sure the insert into statement would work if I was supplying values, but when the variable includes the select statement as the values for the insert into, I get an unrecoginized command phrase/keyword error.
>
>I thought SQLEXEC was supposed to run the sql on the server, but it looks like VFP is messing it up.
>
>Any other ideas?
Try this :
=sqlexec(lnConnect,"insert into myTable "+;
"(field1, field2, field3) values "+;
"(?val1, ?val2, ?val3)" etc...
With ? variables are passed as parameters.
Juan
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only