Example 2: Defining the V_ORDER View
Once the V_ORDER view has been added and named, do the following to set the view definition:
-
In the tree view, select the V_ORDER view.
-
On the properties page, click the Tables tab.
-
In the All tables/views box, select the ORDER table to copy it to the Selected tables box.
-
On the properties page, click the Define tab.
-
Add a column expression for each of the COMPANY_CODE, ORDER_NUM, PRICE, and ORDER_NUM columns.
-
Enter the following expression into the Where box:
ORDER.ORDER_NUM<>0
The V_ORDER view limits the selection of records to those in which the value of the ORDER_NUM column does not equal zero and would display the following information:
COMPANY_CODE |
ORDER_NUM |
PRODUCT |
PRICE |
BWW |
1 |
Hat |
21.95 |
BWW |
2 |
Leather Gloves |
4.80 |
ABS |
1 |
Leather Gloves |
4.80 |
ABS |
2 |
Stitched Boots |
50.00 |
The information displayed in the V_CUSTOMER and V_ORDER views was derived from multiple record types and did not create or alter any physical files. Views can be used to peel individual record formats from a physical file and display the records as if they were combined in a normalized file format.