ddbicon.pngCreating and Defining Views


Using DDBuilder, views can be added to the data dictionary, inputs to the view can be selected, and custom expressions that govern the information displayed can be defined.

Do the following to add and define a view:

  1. In the tree view, click on the Views icon to highlight it, then do one of the following:

    • On the Edit menu, select Add.

    • On the toolbar, click Add.

    • Press Ctrl + A.

  2. The view then appears in the tree view. The first view added to a data dictionary is given the default name VIEW1, the second is given the default name VIEW2, etc. Click the view, enter a new name, then set the name by either pressing Enter or clicking the mouse outside of the tree view.

  3. In the tree view, select the desired view to display the Tables properties page. The All tables/views box will list all tables and other views defined in the data dictionary.

  4. In the All Tables/Views box, select the tables to be included in the view by doing one of the following:

    • Double-click on an item.

    • Click on the item, then click Add.

    This acts as a join by taking two or more tables and building a new table by concatenating the columns from one table to the columns of the other table(s).

  5. In the View type field, select the view type, as follows:

    • To retrieve all data from the selected tables or views, click All.

    • To only retrieve unique data from the selected tables or views, click Distinct.

  6. On the properties page, click the Columns tab to display the Columns properties page.

  7. In the All tables/columns list, select the desired columns for the view and click the Add button to copy them to the Current Columns list.

  8. On the properties page, click the Define tab to display the Define properties page. Each row in the grid defines a column copied to the Current Columns list in the previous step, as follows:

    • Column Name lists the name of the column, as defined in the tree view.

    • Type lists the data type, as defined in the Data type field of the General Column properties page.

    • Column Expression lists, by default, the name of the table and column displayed as table_name.column_name. This column can be customized to contain an expression, as described in the next step.

  9. To add a column to the view, click the Add button to add a blank row to the grid. Do the following to define the column:

    • Enter a name into the Column Name column.

    • Enter STR or NUM into the Type column to define the data type.

    • Enter a column name or expression into the Column Expression column. The entry can consist of:

    • The name of a column, which retrieves the particular value for the column in a table.

    • An expression, which modifies the data before it is displayed. An expression can consist of the names of existing views, the names of two physical columns concatenated together, or a physical column, whose data has been modified by a given factor. The expression can contain up to 255 characters. Specify table names to distinguish between tables and views containing columns with the same name.

  10. If the user wants to include a conditional SQL expression that limits the display information to specified criteria, enter it into the Where box.