To create a view:

  1. Select the View object from the tree. The owner name, view name, and time of creation of all views on the database will be displayed on a table in the View page.

  2. Click Create. The Create View Wizard Introduction window is displayed.

  3. Click Next. The Name the View window is opened.

  4. Select the schema name from the Schema Name drop down list.

  5. Enter the name of the view in the View Name field.

  6. Select the Continue with Wizard option button to continue with the wizard. Select the Edit SQL script directly option button to jump to the last step of the wizard (see step14 as below).

  7. Click the Next button. The Select the table(s) to be referenced by the view dialog box is displayed.

  8. Select tables to use in the view by double clicking on the table names on the left. Alternatively, use the buttons in the middle to add or remove columns. Selected tables will appear on the right.

  9. A table can be added to a view more than once. If this is done, an alias for the table must be given. The alias is a new name for the table that allows for columns in the table to be referenced more than once. To add an alias:

    1. Select a table that has already been added to the view.

    2. Enter an alias name into the field under the Alias heading. The default name appears as TableAliasName#.

  10. Click Next. The Select the column(s) to be displayed in the view window will open.

  11. Select columns to include in the view by double clicking on the column names on the left. Alternatively, use the buttons in the middle to add or remove columns. Selected columns will appear on the right. Columns added more than once must have an alias. Column aliases are created the same way as table aliases.

  12. Click Next. The WHERE clause window will open.

  13. Enter a condition by which the data in the view is to be filtered.

  14. NOTE WHERE statements must follow SQL syntax. See the section on Constraint Syntax at the end of chapter 4 for more information.

  15. Click Next. The Final review window will open.

  16. If you wish to alter the view data after reviewing the SQL script, enter new script into the Create View SQL script field or click the Previous button to display previous screens in the wizard.

  17. Click the Finish button after reviewing the SQL script.

  18. A conformation message appears. Click OK.


Related topic:

Creating a View
Constraint Syntax