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:
01074583
Views:
13
This message has been marked as the solution to the initial question of the thread.
Hi Bhavbhuti,

If is only one record in cursor, you can use "?"..
?SQLEXEC(handle,"select * from table where id=?localcursor.id")
If are in local curosr more records, you have two choises
- generate IN (id1,id2)
- or create temporaly table and upload records from local cursor to temporaly table
* 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
MartinJ

>Hi all
>
>I have a local cursor which contains iID's for the records I want to get using SQL Pass Thru. I have used SQL PT with private variables using "?". How can I get the SQL PT to WHERE on a local cursor?
>
>Please advise.
"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