Home | Previous Page | Next Page   Object-Relational Databases > Understanding Type and Table Inheritance in Dynamic Server > Table Inheritance >

Creating a View on a Table in a Table Hierarchy

You can create a view based upon any table in a table hierarchy. For example, the following statement creates a view on the person table, which is the root supertable of the table hierarchy that Figure 32 shows:

CREATE VIEW name_view AS SELECT name FROM person

Because the person table is a supertable, the view name_view displays data from the name column of the person, employee, and sales_rep tables. To create a view that displays only data from the person table, use the ONLY keyword, as the following example shows:

CREATE VIEW name_view AS SELECT name FROM ONLY(person)

Important:
You cannot perform an insert or update on a view that is defined on a supertable because the database server cannot know where in the table hierarchy to put the new rows.

For information about how to create a typed view, see Typed Views (IDS).

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]