Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FoxPro Select query with joins to Sql Server tables?
Message
 
 
To
10/04/2013 11:49:55
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01570621
Message ID:
01570636
Views:
69
1. Create a cursor with 2 columns, mat_code and emp_num
2. Convert it into XML using CURSORTOXML()
3. Send it to SQL where use XQUERY() to convert it back into a table and join with Jobs and Users
4. Join result back to your original cursor


>How do write a Select where you need to join a local (pre-existing) cursor with one or more tables from the Sql Server??
>
>In this example below from my current DBF-based app, lcCsrMtlRecords is a local cursor and I need join it to some lookup values that need to come from my Sql Server database (Jobs and Users).
>
>
>Select Users.email ;
>	From (lcCsrMtlRecords) ;
>		Join Jobs On Jobs.job_num = &lcCsrMtlRecords..mat_code ;
>		Join Users On Jobs.quoted_by = Users.emp_num ;
>	Where qty_recd <> before_qty_recd ;
>	Order By 1 ;
>	Group By 1 ;
>
>
>
>
>.
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform