Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to pass a local cursors value for WHERE in SQL Pass
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 6 SP5
Miscellaneous
Thread ID:
01074566
Message ID:
01074841
Views:
15
No correct :-). Your next step is right.

MartinJ


>Hi Martin
>
>Thanks for your response.
>
>>- or create temporaly table and upload records from local cursor to temporaly table
>
>Wow. Thanks a lot for the SQL Prepare code, it is a pity one one value can be handled in SQL Pass Thru. I have changed you code as below, please correct me if my understanding is wrong.
>
>>
>>* for MS SQL
>>?SQLEXEC(handle,"create table #temptab ( id int)")
>>?SQLPREPARE(handle,"INSERT INTO #temptab (id) values (?locacursor.id)")
>>SELE localcursor
>>SCAN ALL
>>     ?SQLEXEC(handle)
>>ENDSCAN
>>
>
>
>* for MS SQL
>?SQLEXEC(handle,"create table #temptab ( id int)")
>SELE localcursor
>SCAN ALL
>   ?SQLPREPARE(handle,"INSERT INTO #temptab (id) values (?locacursor.id)")
>ENDSCAN
>?SQLEXEC(handle)
>
>*** my query has to be something as follows
>?SQLEXEC(handle,"SELECT * FROM mytable WHERE iID IN (SELECT id FROM #temptab)")
>
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform