Progress
Language Tutorial
for Windows
Relating with WHERE
You can also relate tables with WHERE. There are two scenarios where you must use WHERE:
In both of these cases, you may want to reconsider your design. Consider adding an index or changing the name of the field.
You can also use WHERE to do any relation that OF can do. The following example uses OF:
This equivalent example uses WHERE:
OF implicitly compares the keys, while WHERE explicitly compares the keys. At compile time, Progress turns an OF into a WHERE expression. For that reason, you should consider OF a shortcut and use WHERE most of the time.
Follow these steps for a demonstration of the last exercise reworked to use WHERE:
Here is the code that created the display:
As shown at point 1, you still need the additional EACH to search through the second table. The WHERE expression causes an explicit mathematical comparison between key values.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |