Generating relational views from SQL statements

You can use SELECT statements and FULLSELECT statements in a physical data model of a data design project to generate relational views in the physical data model.

A relational view provides a different way of looking at the data in one or more tables of the database; it is a named specification of a results table. The specification is a SELECT statement or a FULLSELECT statement that is run whenever the view is referenced in an SQL statement.

Prerequisite: The SELECT statement or FULLSELECT statement must exist in the SQL Statements folder of a physical data model in a data design project.

To generate a relational view in a physical data model:

  1. Switch to the Data Project Explorer view in the Data perspective.
  2. Expand a data design project that contains a physical data model and then expand the Data Models folder.
  3. Double-click a physical data model (.dbm) file to open it.
  4. Expand the physical data model, the database, and the SQL Statements folder.
  5. In the SQL Statements folder, right-click a SELECT statement or a FULLSELECT statement, and then click Generate > View on the pop-up menu. The relational view is generated from the SQL statement and stored in the physical data model.
  6. Save the physical data model. When you save the physical data model, you save all the data objects in the physical data model that have outstanding changes.
The relational view is selected in the Data Project Explorer so that you can locate it easily. You can copy or move the view to another database schema by dragging the view or by using commands on the pop-up menu for the view. The generated view is assigned the name "Viewn," where n is a sequential number that starts at 1 and increases by 1 for each view that you generate. You can use the Properties view to change the name and other properties of the view.

Feedback