Modifying a View
CREATE OR REPLACE VIEW
can completely replace a view.
CREATE TABLE EMP (EMPNO NUMBER(4) NOT NULL,
ENAME VARCHAR2(10),
JOB VARCHAR2(9),
SAL NUMBER(7, 2),
DEPTNO NUMBER(2));
INSERT INTO EMP VALUES (1, 'SMITH', 'CLERK', 800, 20);
INSERT INTO EMP VALUES (2, 'ALLEN', 'SALESMAN', 1600, 30);
INSERT INTO EMP VALUES (3, 'WARD', 'SALESMAN', 1250, 30);
INSERT INTO EMP VALUES (4, 'JONES', 'MANAGER', 2975, 20);
SQL> CREATE OR REPLACE VIEW emp_view AS
2 SELECT AVG(sal) average_salary
3 FROM emp
4 GROUP BY deptno;
View created.
SQL>
Home »
Oracle »
Table »
Oracle »
Table »
Views:
- Creating and Using a View
- Creating and Using Simple Views
- Performing an INSERT Using a View
- A View with a CHECK OPTION Constraint
- View with a READ ONLY Constraint
- Getting Information on View Definitions with DESCRIBE command
- Getting Information on View Definitions with user_views view
- Retrieving Information on View Constraints
- Creating and Using Complex Views
- Modifying a View
- Alter the constraints on a view using ALTER VIEW
- Dropping a View
Related: