Tutorials
Oracle 10g
Oracle 10g Tutorials - Creating Views, Altering, Dropping and Replacing Views
Oracle 10g Tutorials - Creating Views, Altering, Dropping and Replacing Views - Page 2
Oracle 10g Tutorials - Creating Views, Altering, Dropping and Replacing Views - Page 3
To replace a view, you must have all the privileges required to drop and create a view. If the definition of a view must change, the view must be replaced; you cannot use an ALTER VIEW statement to change the definition of a view. You can replace views in the following ways:
Caution:
When a view is dropped, all grants of corresponding object privileges are revoked from roles and users. After the view is re-created, privileges must be regranted.
CREATE OR REPLACE VIEW sales_staff AS
SELECT empno, ename, deptno
FROM emp
WHERE deptno = 30
WITH CHECK OPTION CONSTRAINT sales_staff_cnst;
Figure 16. Creating views with force option and replacing views
Before replacing a view, consider the following effects:
Replacing a view replaces the view definition in the data dictionary. All underlying objects referenced by the view are not affected.
If a constraint in the CHECK OPTION was previously defined but not included in the new view definition, the constraint is dropped.
All views and PL/SQL program units dependent on a replaced view become invalid (not usable).
First Page: Oracle 10g Tutorials - Creating Views, Altering, Dropping and Replacing Views
|
I am trying to create a view with MINUS between two SELECT queries . Say for example, CREATE OR REPLACE VIEW DEPT AS (SELECT DISTINCT emp_num from emp) MINUS (SELECT DISTINCT emp_num FROM managers) / But an exception is raised saying SP-0042 - unkown command "MINUS" Can anyone please let me if MINUS is a valid operation while creating a view? Thanks in advance, Jay |
|
CREATE OR REPLACE VIEW DEPT AS (SELECT DISTINCT emp_num from emp MINUS SELECT DISTINCT emp_num FROM managers); |