session10 (2)

session10 (2) - Oracle App I2IT Oracle App I2IT Oracle App...

Info icon This preview shows pages 1–14. Sign up to view the full content.

View Full Document Right Arrow Icon
Oracle App. I2IT
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Oracle App. I2IT
Image of page 2
Oracle App. I2IT
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Oracle App. I2IT
Image of page 4
Oracle App. I2IT
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Oracle App. I2IT
Image of page 6
Oracle App. I2IT The call statement The call statement eliminates the anonymous block and allows you to code the Trigger logic in a stored procedure
Image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Oracle App. I2IT
Image of page 8
Oracle App. I2IT Mutating tables Mutating tables are problematic for anyone who has tried to write any type of complex trigger in an Oracle database. A mutating table occurs whenever you try to query the table that you are modifying. The only place where you will not encounter mutating tables is with a BEFORE-INSERT trigger. Since most triggers also need to deal with updates, mutating tables are a common and vexing problem.
Image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Oracle App. I2IT Mutating table A mutating table is a table that is currently being modified by an UPDATE, DELETE, or INSERT statement, or it is a table that might need to be updated by the effects of a declarative DELETE CASCADE referential integrity constraint.   The restrictions on such a table apply  only to the session that issued the  statement in progress.
Image of page 10
Oracle App. I2IT For all row triggers , that were fired as the result of a DELETE CASCADE, there are two important restrictions regarding mutating tables. These restrictions prevent a trigger from seeing an inconsistent set of data. The SQL statements of a trigger cannot read from (query) or modify a mutating table of the triggering statement. Example: MutatingExample
Image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Oracle App. I2IT Example Create or replace trigger up_trig update on emp for each row Begin update emp set salary=9000 where empno=7788; End; / Trigger created SQLl> update emp set salary=900 where empno=7867; ORA-04091: table SCOTT.EMP is mutatitng, ….
Image of page 12
Oracle App.
Image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 14
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern