Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help on a view
Message
 
 
To
20/05/2001 12:41:28
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00509207
Message ID:
00509219
Views:
21
Something like this:
create sql view windowsview as;
SELECT windows.iID, cWindowLetter,;
  nQuantity, nWidth, nHeight,;
  nCostPerSqFt, nPrice, lNameplate,;
  lProtectiveCovering, lLightbox, lFrames,;
  lFinalMeasurement, ;
  lCircular,;
  CodesStyle.cValue as cWindowStyle, ;
  CodesTop.cValue as cWindowTop ;
  FROM  windows ;
  INNER JOIN codes as CodesStyle;
     ON  windows.iStyle = CodesStyle.iID;
  INNER JOIN codes as CodesTop;
     ON  windows.iTopShape = CodesTop.iID ;
 WHERE windows.iProject = ?Projects.iID ;
 order by cWindowLetter
This readonly view joins the windows table to an overloaded lookup table codes twice, giving each instance it's own alias and using the alias to get the looked up field out of the table.
>i have a table in which there are several foreign-key fields containing code values from which i want to create a parameterised view. while the parameterised view is not a problem, i want to incorporate fields from other primary key tables into the view whose primary key matches the foreign key value of the table in question. pls. advise.
df (was a 10 time MVP)

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

Click here to load this message in the networking platform