Creating and Using a View : Create View « View « Oracle PL/SQL Tutorial

Oracle PL/SQL Tutorial
1. Introduction
2. Query Select
3. Set
4. Insert Update Delete
5. Sequences
6. Table
7. Table Joins
8. View
9. Index
10. SQL Data Types
11. Character String Functions
12. Aggregate Functions
13. Date Timestamp Functions
14. Numerical Math Functions
15. Conversion Functions
16. Analytical Functions
17. Miscellaneous Functions
18. Regular Expressions Functions
19. Statistical Functions
20. Linear Regression Functions
21. PL SQL Data Types
22. PL SQL Statements
23. PL SQL Operators
24. PL SQL Programming
25. Cursor
26. Collections
27. Function Procedure Packages
28. Trigger
29. SQL PLUS Session Environment
30. System Tables Data Dictionary
31. System Packages
32. Object Oriented
33. XML
34. Large Objects
35. Transaction
36. User Privilege
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Oracle PL/SQL Tutorial » View » Create View 
8. 1. 2. Creating and Using a View

You create a view using CREATE VIEW , which has the following simplified syntax:

CREATE [OR REPLACEVIEW [{FORCE | NOFORCE}] VIEW view_name
[(alias_name[, alias_name...])] AS subquery
[WITH {CHECK OPTION | READ ONLYCONSTRAINT constraint_name];

where

  1. OR REPLACE specifies the view is to replace an existing view if present.
  2. FORCE specifies the view is to be created even if the base tables don't exist.
  3. NOFORCE specifies the view is not to be created if the base tables don't exist; NOFORCE is the default.
  4. alias_name specifies the name of an alias for an expression in the subquery.
  5. There must be the same number of aliases as there are expressions in the subquery.
  6. subquery specifies the subquery that retrieves from the base tables.
  7. If you've supplied aliases, you can use those aliases in the list after the SELECT clause.
  8. WITH CHECK OPTION specifies that only the rows that would be retrieved by the subquery can be inserted, updated, or deleted.
  9. By default, rows are not checked that they are retrievable by the subquery before they are inserted, updated, or deleted.
  10. constraint_name specifies the name of the WITH CHECK OPTION or READ ONLY constraint.
  11. WITH READ ONLY specifies that rows may only read from the base tables.

There are two basic types of views:

Simple views, which contain a subquery that retrieves from one base table

Complex views, which contain a subquery that:

  1. Retrieves from multiple base tables
  2. Groups rows using a GROUP BY or DISTINCT clause
  3. Contains a function call

Quote from:

Oracle Database 10g SQL (Osborne ORACLE Press Series) (Paperback)

# Paperback: 608 pages

# Publisher: McGraw-Hill Osborne Media; 1st edition (February 20, 2004)

# Language: English

# ISBN-10: 0072229810

# ISBN-13: 978-0072229813

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
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.