Chapter 17 Triggers

Team-Fly    

Oracle® PL/SQL® Interactive Workbook, Second Edition
By Benjamin Rosenzweig, Elena Silvestrova
Table of Contents
Appendix A.  Answers to Self-Review Questions


Lab 17.1 Self-Review Answers

A1:

Questions

Answers

Comments

1)

C

 

A2:

Questions

Answers

Comments

2)

B

Once a trigger has been defined on a particular table, it fires implicitly when a triggering event occurs. By default, when a trigger is created it is also enabled. Once you disable a trigger, it will not fire when a triggering event occurs.

A3:

Questions

Answers

Comments

3)

A

The WHEN condition controls when a trigger should fire. If such a condition does not evaluate to TRUE, the trigger will not fire.

A4:

Questions

Answers

Comments

4)

C

 

A5:

Questions

Answers

Comments

5)

D

A trigger fires before or after a triggering event: INSERT, UPDATE, or DELETE. A SELECT operation is not a triggering event. It reads information from a triggering table without modifying it.

Lab 17.2 Self-Review Answers

A1:

Questions

Answers

Comments

1)

A

 

A2:

Questions

Answers

Comments

2)

B

A statement trigger fires once per DML statement issued. In other word, if there is a statement trigger that fires before an UPDATE statement is issued against a triggering table, it will fire once regardless of number of rows affected by the UPDATE statement.

A3:

Questions

Answers

Comments

3)

B

 

A4:

Questions

Answers

Comments

4)

B

It is important to remember that even though an INSTEAD OF trigger is defined on a view, it manipulates underlying database tables.

A5:

Questions

Answers

Comments

5)

B

An INSTEAD OF trigger can never be a statement trigger.

Lab 17.3 Self-Review Answers

A1:

Questions

Answers

Comments

1)

B

You cannot issue an SQL statement against the triggering table in the body of the trigger.

A2:

Questions

Answers

Comments

2)

B

Any SQL statement (INSERT, UPDATE, DELETE, and SELECT) against the triggering table inside the body of the trigger will cause a mutating table error.

A3:

Questions

Answers

Comments

3)

B

You are able to issue SQL statements against any table but the triggering table in the body of a trigger. In other words, it there is a trigger defined on the STUDENT table, you can issue a SELECT statement against the ZIPCODE table in the body of the trigger. This will not cause any error. However, if you issue a SELECT statement against the STUDENT table, you will get a mutating table error when the trigger fires. You will recall that a mutating table error is a runtime error and is not be detected by the PL/SQL compiler.

A4:

Questions

Answers

Comments

4)

C

 

A5:

Questions

Answers

Comments

5)

C

You will recall that a constraining table restriction is applicable to Oracle versions prior to 8i.


    Team-Fly    
    Top
     



    Oracle PL. SQL Interactive Workbook
    Oracle PL/SQL Interactive Workbook (2nd Edition)
    ISBN: 0130473200
    EAN: 2147483647
    Year: 2002
    Pages: 146

    Similar book on Amazon

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net