Creating a View

Note

This feature is not available for MySQL database services.
You can create or edit a view in SQL Worksheet.

To create a view for a selected schema, in the Navigator tab, select Views from the object type drop-down list, click Object submenu, and select Create Object.

To create a view from an existing template for a selected schema, in the Navigator tab, select the view to create from, right-click and select Use as Template.

To edit a view for a selected schema, right-click a view object in the Navigator pane, and select Edit.

Schema: Database schema in which to create the view.

Name: Name of the view.

The different panes in the dialog are described in the following sections:

SQL Query pane

Enter or copy and paste the SQL query for the view, using the SELECT and FROM keywords along with the syntax needed to retrieve the desired information. A semicolon is not required after the query.

Columns pane

Click Refresh Columns Refresh Columns to automatically populate the columns in this pane. You can edit the columns by selecting the required row and making changes in the Header Alias and Comments fields.

Storage pane

  • Force on Create: Select Yes to create the view regardless of whether the base tables of the view or the referenced object types exist or the owner of the schema containing the view has privileges on them. These conditions must be true before any SELECT, INSERT, UPDATE, or DELETE statements can be issued against the view. If the view definition contains any constraints, CREATE VIEW ... FORCE fails if the base table does not exist or the referenced object type does not exist. CREATE VIEW ... FORCE also fails if the view definition names a constraint that does not exist.

  • Query Restriction: Read Only prevents the view from being used to add, delete, or change data in the underlying table. Check Option prohibits any changes to the underlying table that would produce rows that are not included in this view.