Example 1: Defining the V_CUSTOMER View
Once the V_CUSTOMER view has been named and added, do the following to set the view definition:
-
In the tree view, select the V_CUSTOMER view.
-
On the properties page, click the Tables tab.
-
In the All tables/views box, select the CUSTOMER table to copy it to the Selected tables box.
-
On the properties page, click the Columns tab.
-
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.
-
On the properties page, click the Define tab.
-
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.
-
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.
-
In the Column box, click the row that identifies the column to be defined.
-
In the Column Name column, enter a name that conforms to the DDBuilder naming conventions.
-
In the Type column, enter either NUM for a numeric type or STR for a string type.
-
In the Where box, enter the following expression:
ORDER_NUM=0
The V_CUSTOMERS view limits the selection of records to those that have an order number of 0.