Hi,
I'm stuck on this problem and I can't find a sollution. I'm going to try and explain this step by step.
1 After certain rows get updated with a certain value. I don't know wich rows in advance. And they do not have a certain order, but after the update they all have the same trans_id. (in unload_details_ tab).
2 I select select the rows using the value that just got updated (trans_id), this way I know wich rows I needed to select, the value is the same for all the rows that I need.
3 I then call a procedure that generates a block_id for each row, I use a table to store this block_id. (temptable)
THIS ALL WORKS FINE.
4 But the problem is that I want to update the unload_details_ tab with the values from temptable. The after update trigger generates a self-deadlock error.
I also can't use a beofre update either becasue I need all of the rows with the same trans_id to generate the block_id. Also, you might think that this leads to a recursive trigger firing itself, but I check to see if the block_id is empty in the first place, this way if it is filled the trigger doesn't loop again. But for this to work the table needs to get updated with the values in the first place and this doesn't happen. I believe that the after update trigger locks the unload_details_ tab, so i can't update it again. I'm not 100% shure.
short:
After an update, I create a blok_id that needs to be updated to the same rows that got updated in the first place, in the same table ofcourse.
I'm at my wits end, and don't see a clear sollution for this problem, please help any way you can.
Thanks in advance.
I'm stuck on this problem and I can't find a sollution. I'm going to try and explain this step by step.
1 After certain rows get updated with a certain value. I don't know wich rows in advance. And they do not have a certain order, but after the update they all have the same trans_id. (in unload_details_ tab).
2 I select select the rows using the value that just got updated (trans_id), this way I know wich rows I needed to select, the value is the same for all the rows that I need.
3 I then call a procedure that generates a block_id for each row, I use a table to store this block_id. (temptable)
THIS ALL WORKS FINE.
4 But the problem is that I want to update the unload_details_ tab with the values from temptable. The after update trigger generates a self-deadlock error.
I also can't use a beofre update either becasue I need all of the rows with the same trans_id to generate the block_id. Also, you might think that this leads to a recursive trigger firing itself, but I check to see if the block_id is empty in the first place, this way if it is filled the trigger doesn't loop again. But for this to work the table needs to get updated with the values in the first place and this doesn't happen. I believe that the after update trigger locks the unload_details_ tab, so i can't update it again. I'm not 100% shure.
short:
After an update, I create a blok_id that needs to be updated to the same rows that got updated in the first place, in the same table ofcourse.
I'm at my wits end, and don't see a clear sollution for this problem, please help any way you can.
Thanks in advance.
Comment