Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to pass a local cursors value for WHERE in SQL Pass
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 6 SP5
Divers
Thread ID:
01074566
Message ID:
01074583
Vues:
12
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform