Multiple choice technology databases

Can you use a commit statement within a database trigger?

  1. True

  2. False

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

You cannot use a COMMIT statement within a database trigger. This is because triggers execute within the context of the triggering transaction. Allowing a COMMIT would violate transaction atomicity and could cause data inconsistencies. The trigger shares the transaction of the statement that fired it.