Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Inserting numeric data via SQL pass-through
Message
From
05/02/2002 00:27:01
Arden Weiss
Liberty Computers Ltd.
Maryland, United States
 
 
To
04/02/2002 21:36:13
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00615200
Message ID:
00615240
Views:
17
Viola -- I guess I figured it out. The key is using the SQLPREPARE function and passing in variables/parameters with the ?mDIV_NUM syntax.

What worked is as follows:

mDIV_NUM = DIV_NUM
lnResult = SQLPREPARE(hConn, 'INSERT INTO EXPORT (DIV_NUM) VALUES (?mDIV_NUM)')
lnResult = SQLEXEC(hConn)

DIV_NUM is a numeric field in both the source VFP free table and the target SQL Server table. Hope this syntax also works for the other non-character field types. What a goat rope.

And Yep! I agree the table name EXPORT is bad, but that's what I inherited. I plan to change it in SQL Server to EXPORT1 or something else.

Thanks for pointing out the TTOC function that I had never used. It will be useful going forward.

Thanks for feedback provided -- I can go to bed now...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform