Create view on single field of a type : Create View « View « Oracle PL/SQL Tutorial






SQL> create type addressType as object
  2  (Street   VARCHAR2(50),
  3  City      VARCHAR2(25),
  4  State     CHAR(2),
  5  Zip       NUMBER);
  6  /
SQL>
SQL> create type personType as object
  2  (Name     VARCHAR2(25),
  3   Address  addressType);
  4  /
SQL>
SQL>
SQL> create or replace type personType as object
  2  (Name     VARCHAR2(25),
  3   Address  addressType);
  4  /
SQL>
SQL>
SQL> create table myemp
  2  (cid    NUMBER,
  3   Person         personType);
SQL>
SQL>
SQL> insert into myemp values(1,personType('SomeName',addressType('StreetValue','CityValue','ST',11111)));
SQL>
SQL>
SQL> create index empview
  2  on myemp(Person.Address.City);
SQL>
SQL>
SQL> drop table myemp;
SQL> drop type personType;
SQL> drop type addressType;
SQL>
SQL>
SQL>
SQL>








8.1.Create View
8.1.1.Views
8.1.2.Creating and Using a View
8.1.3.Creating and Using Simple Views
8.1.4.Choose specific column from base table
8.1.5.Creating a View with a CHECK OPTION Constraint
8.1.6.Creating a View with a READ ONLY Constraint
8.1.7.Create view based on user-defined function
8.1.8.Create a view by joining two tables
8.1.9.Create view based on aggregate function
8.1.10.a user-defined type view
8.1.11.CREATE MATERIALIZED VIEW with TABLESPACE
8.1.12.CREATE MATERIALIZED VIEW with rowid
8.1.13.Create view by join three tables
8.1.14.Create view on single field of a type
8.1.15.create materialized view emp_dept build immediate refresh on demand enable query rewrite
8.1.16.Use view based on user-defind type