Returning objects of a particular type using ONLY

To have a query return only objects of a particular type, and not of its subtypes, use the ONLY keyword.

About this task

For example, the following query returns only the names of employees that are not architects or managers:

   SELECT Name
   FROM ONLY(Employee);

The previous query returns the following result:

   NAME
   --------------------
   Dennis
   Eva
   Franky
   Susan

To protect the security of the data, the use of ONLY requires the SELECT privilege on every subtable of Employee.

You can also use the ONLY clause to restrict the operation of an UPDATE or DELETE statement to the named table. That is, the ONLY clause ensures that the operation does not occur on any subtables of that named table.