ddbicon.pngExample 1: Defining the V_CUSTOMER View

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

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

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

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

    viewgen1.png

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

  5. In the All tables/columns box, select CUSTOMER.CUST_NUM, CUSTOMER.FIRST_NAME, CUSTOMER.LAST_NAME, then click the Add button to copy them to the Current columns box.

    viewcol1.png

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

  7. In the All tables/columns, select CUSTOMER.CUST_NUM, CUSTOMER.FIRST_NAME, CUSTOMER.LAST_NAME, then click the Add button to copy them to the Current columns field.

  8. Click Add to create placeholders for each desired view column. The first view column will be given the default name VCOLUMN1, the second VCOLUMN2, etc. This removes unwanted columns from the table and contains only those columns listed in the query.

  9. In the Column box, click the row that identifies the column to be defined.

  10. In the Column Name column, enter a name that conforms to the DDBuilder naming conventions.

  11. In the Type column, enter either NUM for a numeric type or STR for a string type.

  12. In the Where box, enter the following expression:

    ORDER_NUM=0

    viewdef1.png

The V_CUSTOMERS view limits the selection of records to those that have an order number of 0.