A database trigger is an alternative for

oracletrigger

I had the following quiz question and could not answer it myself because of a little confusion.

Please answer this and tell me why?

A database trigger is an alternative for?

A. Stored procedure
B. Primary key for implementing referential integrity
C. Foreign key for implementing referential integrity
D. All of the above

Best Answer

I don't expect the writer of the question meant it this way, but words mean things and the question specifies a "database trigger", therefore there is no correct answer.

A DATABASE trigger is created on the database and fires whenever any database user initiates the triggering event. (PL/SQL Language Reference - DATABASE Triggers)

Unlike Row and Statement triggers, Database triggers fire for things like AFTER STARTUP ON DATABASE, AFTER SERVERERROR ON DATABASE and AFTER LOGON ON DATABASE.