Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to manage a cursor based on conditions
Message
 
 
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:
01020332
Views:
17
Abdulla,

>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.

You can use a JOIN to pull additional columns from the other table(s). For example this selects columns from 3 related tables using 2 JOINs:
select customer.*, invoice.InvoiceNo, order.ItemDescript, order.Amount ;
   from customer ;
   inner join invoice ;
      on customer.CustomerNo = invoice.CustomerNo ;
   inner join order ;
      on invoice.InvoiceNo = order.InvoiceNo ;
   into cursor customerItems ;
   where customer.Country = "USA"
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform