ddbicon.pngExample 2: Defining the V_ORDER View


Once the V_ORDER view has been added and named, do the following to set the view definition:

  1. In the tree view, select the V_ORDER view.

  2. On the properties page, click the Tables tab.

  3. In the All tables/views box, select the ORDER table to copy it to the Selected tables box.

    viewgen2.png

    viewcol2.png

  4. On the properties page, click the Define tab.

  5. Add a column expression for each of the COMPANY_CODE, ORDER_NUM, PRICE, and ORDER_NUM columns.

  6. Enter the following expression into the Where box:

    ORDER.ORDER_NUM<>0

    viewdef2.png

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.