Back to marketplace

Triggers

No description yet. This curated deck is ready for daily study.

Total cards: 19•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (19)

#1
Front (Question)

Oracle Trigger Syntax

Back (Answer)

CREATE TRIGGER TriggerNameMode Event {OR Event }ON TargetTable [[REFERENCING ReferenceName] FOR EACH ROW [WHEN Predicate]] PL/SQL Block

#2
Front (Question)

Oracle Execution Algorithm

Back (Answer)

• Before statements • For each tuple affected by the triggering statement: - Before row triggers are executed - Triggering statement is executed + integrity constraints checked on tuples - After row triggers • Integrity constraints on tables are checked • After triggers are checked

#3
Front (Question)

Oracle Trigger Execution Order

Back (Answer)

Same event triggers execution order is non-deterministic

#4
Front (Question)

Oracle: When Error Occurs

Back (Answer)

Rollback of all operations performed by the trigger Rollback of the triggering transaction

#5
Front (Question)

Oracle: Cascade Trigger Execution

Back (Answer)

Limit after which error is thrown: 32 triggers

#6
Front (Question)

Oracle: Mutating Table Access

Back (Answer)

Cannot be touched with ROW Triggers, but can be with statement triggers.

#7
Front (Question)

Oracle: Conditional Execution

Back (Answer)

Condition can be specified only for row level triggers

#8
Front (Question)

DB2 Syntax

Back (Answer)

CREATE TRIGGER TriggerName {BEFORE, AFTER} {INSERT, DELETE, UPDATE} ON TargetTable [REFERENCING ReferenceName] FOR EACH {ROW, STATEMENT} WHEN Predicate Procedural SQL Statements

#9
Front (Question)

DB2 Limitations

Back (Answer)

Only one event (UPDATE, INSERT, DELETE) is allowed for each trigger.

#10
Front (Question)

DB2 Execution algorithm

Back (Answer)

Transaction T contains a statement S which generates event E. • T’s execution is suspended and its state is saved into a stack • Old and new values of E are computed • Before triggers on E are executed • New values are applied to the DB (modification due to E is actually performed) • constraints are checks to avoid recurive invocation on the same procedure. • After triggers due to E are executed. • If any trigger contains an action which triggers other triggers, those are executed in a recurive fashion. • The execution state of T is extracted from the stack and T is resumed.

#11
Front (Question)

Oracle VS. DB2 Reference to Old_Table and New_table in statement triggers

Back (Answer)

Oracle: NO DB2: Yes

#12
Front (Question)

Oracle VS. DB2 When clause in statement triggers

Back (Answer)

Oracle: no DB2: yes

#13
Front (Question)

Oracle VS. DB2 Execution order between row and statement triggers with same mode

Back (Answer)

Oracle: Specified DB2: Arbitrary

#14
Front (Question)

Oracle VS. DB2 Execution order between triggers with same event, mode, granularity

Back (Answer)

Oracle: Unspecified DB2: Creation order

#15
Front (Question)

Oracle VS. DB2 More than one triggering event allowed

Back (Answer)

Oracle: Yes DB2: No

#16
Front (Question)

Oracle VS. DB2 Forbidden access to the mutating table

Back (Answer)

Oracle: Yes, for row triggers DB2: No

#17
Front (Question)

Oracle’s INSTEAD OF

Back (Answer)

An INSTEAD OF trigger is a trigger that allows you to skip an INSERT, DELETE, or UPDATE statement to a table or a view and execute other statements defined in the trigger instead.

#18
Front (Question)

Oracle VS. DB2 Availability of the INSTEAD OF sematincs

Back (Answer)

Oracle: Yes DB2: No

#19
Front (Question)

Oracle VS. DB2 Database modifications allowed in before triggers

Back (Answer)

Oracle: Yes DB2: Only for new variables