I need help debugging a trigger. The whole trigger is very big because it's all the actions that need to happen when any data in the table is updated. Trying to avoid too much cascading. But here's what's relevant to my issue:
So I have two tables, one for current notes and one for the history of all notes ever added to a job. In my job table, I have a Notes column and a New Notes column which is perpetually blank so that new notes can be added. What this trigger is supposed to do is insert the old note into my history table along with the Job ID and who submitted it. Then, the update should put the new note into the Notes column and empty out the New Notes column. What actually happens is the second part of the trigger works perfectly and adds the new note to the notes column but something goes awry with the first part and it adds 2 new rows to my history table with the note as completely blank and it also changes any pre-existing records with the same Job ID to be blank ????
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Question
pmcfarlain
I need help debugging a trigger. The whole trigger is very big because it's all the actions that need to happen when any data in the table is updated. Trying to avoid too much cascading. But here's what's relevant to my issue:
So I have two tables, one for current notes and one for the history of all notes ever added to a job. In my job table, I have a Notes column and a New Notes column which is perpetually blank so that new notes can be added. What this trigger is supposed to do is insert the old note into my history table along with the Job ID and who submitted it. Then, the update should put the new note into the Notes column and empty out the New Notes column. What actually happens is the second part of the trigger works perfectly and adds the new note to the notes column but something goes awry with the first part and it adds 2 new rows to my history table with the note as completely blank and it also changes any pre-existing records with the same Job ID to be blank ????
I am at a loss. Please help!
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.