Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to manage a cursor based on conditions
Message
From
05/06/2005 08:09:34
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
05/06/2005 04:12:06
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01020314
Message ID:
01020323
Views:
19
>Hi Experts,
>
>I have a cursor based on a query on certain condition, now i want to retrieve data from
>another table based on each curosr rows value and some value from this row put in to another
>cursor. How will do this as SQL statement.

It might be more or less like this:

If the first cursor is called Cursor1, select a record in the first cursor, and then:
select * from MyTable where Field1 = Cursor1.Field1
If you want to match all the records in Cursor1, it doesn't matter which record is selected:
select * from MyTable where Field1 in (select Field1 from Cursor1)
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform