GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Oracle  >  PL/SQL

 Print  |  
Question:  Pipe Function and Mutating Trigger

Answer: 1) Why we use pl/sql array rather than cursor?
2) In which condition we use function overloading?
3) What is pipe function?
4) What is the mutating trigger? What should be the condition?


October 10, 2009 06:48:17 #4
 avis_sarkar   Member Since: January 2009    Total Comments: 1 

RE: Pipe Function and Mutating Trigger
 

Triggers are PLSQL block or Procedures which get executed whenever:
1) an INSERT, DELETE or UPDATE happens on a table.
2) DDL like ALTER or CREATE happens on a table.
3) an INSTEAD OF trigger on a view is issued - If a DML operation is issued on a view, the INSTEAD OF trigger defines what actions take place.

Now, A triggering statement contains:
Trigger timing
 For table: BEFORE, AFTER
 For view: INSTEAD OF

Triggering event: INSERT, UPDATE, or DELETE
Table name: On table or view
Trigger type: Row or statement
WHEN clause: Restricting condition
Trigger body: is the PL/SQL block

Statement Type - Trigger body executes once for the triggering event. A statement trigger executes once even if no rows are affected at all.

Row Trigger - Trigger body executes once for each row affected by the triggering event. A row trigger is not executed if the triggering event affects no rows. INSTEAD OF triggers are row triggers.

Mutating Table: A mutating table is a table that is currently being modified by an UPDATE, DELETE, or INSERT statement, or a table that might need to be updated by the effects of a declarative DELETE CASCADE referential integrity action. A table is not considered mutating for STATEMENT triggers.

The triggered table itself is a mutating table, as well as any table referencing it with the FOREIGN KEY constraint. This restriction prevents a row trigger from seeing an inconsistent set of data.

     

 

Back To Question