Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting relationships from cursors. 2

Status
Not open for further replies.

audiopro

Programmer
Apr 1, 2004
3,165
GB
I have an app which creates a cursor from external sales data sources. I want to join an I.D. code field (code) to the code field within a lookup table in order to extract the item description etc.
I am familiar with setting relationships in the DE but
how do I set up the relationship between the cursor and the lookup table?

Keith
 
Keith,

How are you going about "extracting the item description"?

I think you will find that the command SET RELATION TO MyField INTO MyOtherTable is what you want.

First set the correct index tag in the lookup table, select the cursor and then something like:
Code:
SET RELATION TO Code INTO Lookup
should get you what you want.


Hope that helps,

Stewart
PS If you want to get the best response to a question, please check out FAQ184-2483 first.
 

Keith,

Yes, SET RELATION will do it. Your cursor will behave just like a normal table in that respect.

An alternative approach would be to modify the SELECT that created the cursor in the first place. Join the lookup table to the original source table, so that all the information you need is in the one cursor.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Stewart, Mike
Thanks for that.
The cursor is created from 2 tables which are processed at record level. I'm sure it can be done with a complex sql query but that part of it works ok and speed isn't an issue as the whole process is done automatically, over night. The whole process only takes about 40 seconds so I am happy with that.
Setting the relationship was only an issue when it came to producing a report as I was unsure of how to deal with the DE. Being a bit numb, I hadn't considered settting the relationship in the prog and leaving the report DE empty.
We live and learn.
Thanks for the pointers, all is fully working now.

Keith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top