Views Assignment Help

Assignment Help: >> Mutating and Constraining Tables - Views

Views That Are Not Modifiable:

A view cannot be modified through UPDATE, INSERT, or DELETE statements if the view query holds any of the subsequent constructs:

  • Set operators
  • Group functions
  • GROUP BY, CONNECT BY, or START WITH clauses
  • DISTINCT operator
  • Joins (a subset of join views are updatable)

 

If a view holds pseudocolumns or expressions, you can only update the view with an UPDATE statement which does not refer to any of the pseudocolumns or expressions.

Example of an INSTEAD OF Trigger

The  subsequent  example  denotes  an  INSTEAD  OF  trigger  for  inserting  rows  into  the MANAGER_INFO view.

CREATE OR REPLACE VIEW manager_info AS

SELECT e.empno, e.ename, d.deptno, d.dname# for select employee no and name and department name and no.#

FROM emp e, dept d

WHERE          e.deptno =       d.deptno

CREATE OR REPLACE TRIGGER MANAGERINFO_INSERT

INSTEAD OF INSERT ON MAN_INFO FOR EACH ROW

BEGIN

END;

INSERT INTO emp(EMPNO,ENAME) VALUES(:new.empno, :new.Ename);

INSERT INTO dept(DEPTNO,DNAME) VALUES(:new.deptno, :new.dname);

Here, alternate of executing the statement for the view and the body of the view is executed thus inserting records onto the respective tables.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd