Oracle® HTML DB
Release 2.0
  Go To Table Of Contents
Contents

Previous
Previous
Next
Next
 

Managing Views

A view is a logical representation of another table or combination of tables. A view derives its data from the tables on which it is based. These tables are called base tables. Base tables might in turn be actual tables or might be views themselves. All operations performed on a view actually affect the base table of the view. You can use views in almost the same way as tables. You can query, update, insert into, and delete from views, just as you can standard tables.

Topics:


See Also:

Oracle Database Administrator's Guide for information about views

Creating a View

To create a new view:

  1. Navigate to Object Browser:

    1. Click the SQL Workshop icon on the Workspace home page.

    2. Click Object Browser.

      Object Browser appears.

  2. Click Create.

  3. From the list of object types, select View.

  4. Define the view:

    • View Name - Enter a name for the View.

    • Query - Specify a query to define the view.

      To access Query Builder or SQL Command Processor, click the appropriate link at the bottom of the page. The selected tool appears in a pop-up window. Once you create the appropriate SQL, click Return to automatically close the popup window and return to the wizard with the SQL.

  5. Click Next.

    A confirmation page appears. To view the SQL used to create the view, click SQL.

  6. Click Create.

Browsing a View

When you access a view in Object Browser, the Detail pane displays a report listing the columns in that view.

To browse a view:

  1. Navigate to Object Browser:

    1. Click the SQL Workshop icon on the Workspace home page.

    2. Click Object Browser.

      Object Browser appears.

  2. From the Object list, select Views.

  3. From the Object Selection pane, select a view.

    The view definition appears displaying the appropriate columns.

Summary of Available Views

Click the tabs at the top of the page to view different reports. Table 18-3 describes all available views.

Table 18-3 Available Views for Views

View Description

View

(Default) Displays the columns in the current view. Actions you can perform include:

  • Compile

  • Drop

See Also: "Editing a View", "Compiling a View", and "Dropping a View"

Data

Displays a report of the data in the columns in the view. Actions you can perform include:

  • Query - Enables you to sort by column. To restrict specific rows, enter a condition in the Column Condition field. Use the percent sign (%) for wildcards. From Order by, select the columns you want to review and click Query.

  • Count Rows - Enables you to insert a new row into the table.

  • Insert Row - Enables you to insert a new row into the table.

Grants

Displays a list of grants associated with the columns in the view. Grant details include grantee, privilege, and grant options. Actions you can perform include Grant and Revoke.

UI Defaults

Displays user interface defaults for forms and reports. User interface defaults enable developers to assign default user interface properties to a table, column, or view within a specified schema.

Click Edit to edit existing user interface defaults. Click Create to initialize user interface defaults for views that do not currently have user interface defaults defined.

See Also: "Managing User Interface Defaults"

Dependencies

Displays a report showing objects referenced by this view, objects this view references, and synonyms for this view.

SQL

Displays the SQL necessary to re-create this view.


Editing a View

When you edit a view you can edit the code manually, perform a search and replace, and compile the view. Additionally, you can save the view as a file or drop it.

Editing a View Manually

To edit a view manually:

  1. Navigate to Object Browser:

    1. Click the SQL Workshop icon on the Workspace home page.

    2. Click Object Browser.

      Object Browser appears.

  2. From the Object list, select Views.

  3. From the Object Selection pane, select a view.

  4. Select the Code tab.

  5. Click Edit to activate manual edit mode.

    If you edit and make changes to a view, you need to compile.


Note:

You can expand the Edit pane by clicking the Full Screen icon in the upper right of the pane, beneath the Create button.

Using Find and Replace

Click Find to perform a basic search and replace.

Downloading a View

Click Download to save the current view as a file.

Compiling a View

If you edit and make changes to a view, you need to compile in order to save your changes. Note that there is no save function since this is just a view of the object within the database.

Click Compile to re-create the current view.

Dropping a View

Click Drop to delete the current view.