Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Inserting numeric data via SQL pass-through
Message
From
05/02/2002 06:43:13
 
 
To
05/02/2002 00:27:01
Arden Weiss
Liberty Computers Ltd.
Maryland, United States
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00615200
Message ID:
00615323
Views:
17
Hi!

No need to use SQLPrepare. You can use "?" just in SQLEXEC(). SQLPrepare have very limited use, because it is beneficial only in very narrow range of cases in programming. Specially with Parameters with "?" SQLPrepare() will slow down things a bit.

>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...
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform