Selecting Objects:
Suppose that you have run the SQL*Plus script below that creates object type Person and object table persons, and that you have settled the table:
CREATE TYPE Person AS OBJECT (
first_name VARCHAR2(15),
last_name VARCHAR2(15),
birthday DATE,
home_address Address,
phone_number VARCHAR2(15))
/
CREATE TABLE persons OF Person
/
The sub query below produces a result set of the rows containing only the attributes of the Person objects:
BEGIN
INSERT INTO employees -- another object table of type Person
SELECT * FROM persons p WHERE p.last_name LIKE '%Smith';