session10 (2)

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

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

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

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

View Full DocumentRight Arrow Icon
Oracle App. I2IT
Background image of page 2
Oracle App. I2IT
Background image of page 3

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

View Full DocumentRight Arrow Icon
Oracle App. I2IT
Background image of page 4
Oracle App. I2IT
Background image of page 5

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

View Full DocumentRight Arrow Icon
Oracle App. I2IT
Background 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
Background image of page 7

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

View Full DocumentRight Arrow Icon
Oracle App. I2IT
Background 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.
Background image of page 9

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

View Full DocumentRight 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.
Background 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
Background image of page 11

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

View Full DocumentRight 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, ….
Background image of page 12
Oracle App. I2IT
Background image of page 13

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

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

This note was uploaded on 07/15/2011 for the course ECO 2023 taught by Professor Mr.raza during the Summer '10 term at FAU.

Page1 / 43

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

This preview shows document pages 1 - 14. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online