Top 100+ PL/SQL Interview Questions and Answers Pdf - 3

Question: 11

Can a SELECT statement fire a trigger?

No, a SELECT statement cannot fire a trigger. DML statements, such as INSERT, UPDATE, and DELETE, can cause triggers to fire.

Question: 12

Write the ALTER statement to enable all the triggers on the T_STUDENTS table?

The ALTER statement is given as follows:

ALTER TABLE T_STUDENTS ENABLE ALL TRIGGERS;

Question: 13

How can triggers be used for the table auditing?

Triggers can be used to track values for data operations on tables. This is done using the old and new qualifiers within the trigger code. These two clauses help keep track of the data that is being inserted, updated, or deleted in the table; and therefore, facilitate in application auditing of DML statements. The audit trail can be written to a user-defined table and audit records can be generated for both row-level and statement-level triggers.

Question: 14

Can triggers stop a DML statement from executing on a table?

Yes, triggers have the capability of stopping any DML statement from execution on a table. Any logical business rule can be implemented using PL/SQL to block modification on table data.

Question: 15

Does USER_TRIGGERS have entry for triggers with compilation errors?

Yes, USER_TRIGGERS have entries for all triggers that are created in the schema with or without errors.

Related Questions