answersLogoWhite

0


Best Answer

You would have to have an "if" statement that says" IF an error occurs and the field is not updated

(your code would be specific)

then "rollback".

You would want to name the section so you can rollback by name to

be specific. If you did a generic rollback, all operations within the trigger would be rolled back--even the successful ones. If you put rollback statements within triggers, you need to make sure your logic is flawless and all bases are covered. You would want to test the trigger for the results you expect.

User Avatar

Wiki User

16y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What happens when a rollback statement exicuted inside a trigger?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is statement level trigger?

A statement trigger is a trigger which is fired once on behalf of the triggering statement, independent of the number of rows the triggering statement affects.


What are row level and statement level triggers?

The FOR EACH ROW option determines whether the trigger is a row trigger or a statement trigger. If you specify FOR EACH ROW, then the trigger fires once for each row of the table that is affected by the triggering statement. The absence of the FOR EACH ROW option indicates that the trigger fires only once for each applicable statement, but not separately for each row affected by the statement.


Can you use a commit statement within a database trigger?

Yes, you can very definitely use transactions within a trigger in one of two common ways; 1. As with any other use of transactions - to ensure a collection of commands within the trigger are executed in a repeatable way in the event of failure.2. To 'undo' the process that caused the trigger to fire. For example, the trigger might be doing some additional integrity checks and issuing a rollback to undo the initiating update/delete.---------AnswerCome to think of it, I have never seen a commit on triggers. Triggers as you know are a last line defense based on an action that was carried out by an insert,update or delete. Hence, since the trigger exists on the server, and is only fired if one of the above conditions are executed then it seems pointless to use a commit in the trigger. Also commit goes along nicely with transactions where you begin the transaction and if all is well then you issue a commit, else if the transaction fails, then you issue a rollback.


What is a trigger in dbms?

Trigger is a statement that is automatically executed by the system as a side effect of a modification to the database. Several existing systems have their own non standard trigger functions. For a trigger we need to specify the condition under which the trigger is executed.


What happens when you point a trigger to your head?

You die/commit suicide.


What happens if you cock a shotgun and don't pull the trigger?

The hammer will be in the cocked position. Nothing will happen until you pull the trigger.


Difference row level and statement level triggers?

Row-level triggers are executed for each row affected by the triggering event, whereas statement-level triggers are executed once for each triggering event regardless of the number of rows affected. Row-level triggers have access to the specific row data being modified, making them useful for enforcing constraints or triggering actions based on individual row changes. Statement-level triggers are more efficient for bulk operations or actions that do not need to consider individual row data.


What happens when you have Allergies?

the molecules in the object trigger a reation in our immume system


What is a Trigger in MySQL Define different types of Trigger?

A trigger is a named database object that is associated with a table, and that activates when a particular event occurs for the table. Some uses for triggers are to perform checks of values to be inserted into a table or to perform calculations on values involved in an update. A trigger is associated with a table and is defined to activate when an INSERT,DELETE, or UPDATE statement for the table executes. A trigger can be set to activate either before or after the triggering statement. For example, you can have a trigger activate before each row that is deleted from a table or after each row that is updated. Sender : Yugant khokhar


What happens if you overdose on caffeine?

It can cause heart irregularites, or even trigger cardiac arrest.


What happens if someone doesn't say all of the Winter Soldier's trigger words?

nothing


What statement is flase regarding how ozone can affect the lungs and respiratory system?

ozone can trigger asthma attacks in adults but not children