Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Pass Through - VFP Source
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00169918
Message ID:
00169965
Views:
19
>Can you use SQL pass through with a select statement taking data from a VFP table??
>
>Example:-
>lnResult=SQLEXEC(lnSqlHandle,"INSERT INTO sqltable SELECT * FROM vfptable)
>
>The VFP table will contain up to 100k rows. If this is possible, how would I reference the table - do I use the ? prefix??
>
>I am currently using a remote view and appending from the VFP table - I don't like it, something inside me tells me this is not right! Even though it solves all my problems!

I think what you can do is wrap your SPT with a scan...

use VfpTable
*get connection here
*start transaction if needed
scan
SCATTER TO aMyArray

lnResult=SQLEXEC(lnSqlHandle,"INSERT INTO sqltable FROM aMyArray")

endscan

*********

I haven't tested this... don't know if you can insert from array with SPT... you may have to scatter to memvars an use the VALUES clause... but, this remove the use of the view.

BOb
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform