Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Rene Relucio
  Where is Rene Relucio?
 Quezon City
 Philippines
 Rene Relucio
 To: libbybil
  
 
 
 libbybil
 Tags
Subject: RE: index on fields in another tables
Thread ID: 22531 Message ID: 22779 # Views: 12 # Ratings: 0
Version: Visual FoxPro 8 Category: Databases, Tables and SQL Server
Date: Friday, April 25, 2003 12:54:13 PM         
   


> Is it ok to index on fields in other tables. I need to create many such indexes with a combination of fields from table1 and table2.
> It is working but is it safe and reliable?

There were reasons why I used index expressions with another table (before SQL Statements were introduced).
Ex.:

Organizational table: (Orgntbl.DBF)
Orgncode: 1001
OrgnDesc: Administrative Department
.
.
.


Employee Table: (EmpMast.DBF)
EmpCode : 149047
EmpName : Relucio, Rene M.
OrgnCode: 1001
.
.
.


So when I needed to print a report Sorted by OrganDesc and by EmpName:

Select 1
Use EmpMast
sele 2
Use Orgntbl order Orgncode
sele 1
set relation to Empmast.orgncode into orgntbl
Index on Orgntbl.OrgnDesc+Empmast.EmpName to PrOrgEmp

Today, I use SQL:

Select Empmast.Empname, Orgntbl.Orgdesc from Empmast ;
left join orgntbl on Empmast.OrgnCode = Orgntbl.orgncode ;
order by Orgntbl.Orgdesc, Empmast.Empname


COMPLETE THREAD

index on fields in another tables Posted by libbybil @ 4/21/2003 5:50:39 PM
RE: index on fields in another tables Posted by Steven Black @ 4/21/2003 7:12:06 PM
RE: index on fields in another tables Posted by Pete Sass @ 4/23/2003 1:45:57 PM
RE: index on fields in another tables Posted by Rene Relucio @ 4/25/2003 12:54:13 PM