Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need syntax help with =SQLEXEC syntax
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00506780
Message ID:
00506796
Views:
15
Marie-
Your syntax looks correct. Is it possible that m.AgLoc really is empty?

Another possibility is that m.AgLoc is the wrong data type. It might be a good idea to check the return value from SQLEXEC() with code such as:
lnResult = SQLEXEC(nconnhndl, m.cStatement)
IF lnResult < 0
&nbsp;&nbsp;&nbsp;* Insert error handling code here, or SET STEP ON if in development mode.
ENDIF  && lnResult < 0
By the way, I've never tried using the "m." syntax in parameterizing SQL. I doubt that's the problem, but if you can unambiguously use simply "?AgLoc" you might try that too.
zahid

>I have to copy a very large number of records to an existing table on a SQL Server from a VFP 6.0 table. I have no problem moving numeric constants to SQL, but can't seem to get the syntax right to move the character data over. Below is my statement:
>
>m.cStatement = "INSERT into Producercodes (iAgencyID, cAgencyLocation,) Values (1, ?m.AgLoc)"
>
>m.AgLoc being the value in cAgencyLocation.
>
>When I run =SQLEXEC(nconnhndl, m.cStatement) the iAgencyID field on the SQL server table is populated with 1, but cAgencyLocation remains blank.
>
>Suggestions?
>
>Marie
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform