Trigger statement

20 pts.
Tags:
Database programming
Triggers
sample trigger : create trigger trig_sample on table for insert,update as update table go now, the statement inside the trigger is to update the same table . will the trigger keeps on firing and thus cause and internal error??

Answer Wiki

Thanks. We'll let you know when a new response is added.

Not knowing what database are you using, I can tell that Oracle has a limit on recursive calls in a trigger, and moreover, it does not let you modify objects that are “mutating”.

From the documentation:
“A mutating table is a table that is currently being modified by an UPDATE, DELETE, or INSERT statement, or a table that might be updated by the effects of a DELETE CASCADE constraint.

The session that issued the triggering statement cannot query or modify a mutating table. This restriction prevents a trigger from seeing an inconsistent set of data.”

Regards,

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • C1140
    i'm using MSSQL.. thanks for the explanation... it really helps a lot
    20 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following