Delete the same row inserted in a table by trigger in mysql

前端 未结 2 1320
忘掉有多难
忘掉有多难 2021-01-17 05:43

I\'m trying to remove a row after inserted in a temp table and I get this error:

INSERT INTO `temp_program_counter` (`id`, `program_id`) values (NULL, \'275\         


        
2条回答
  •  孤街浪徒
    2021-01-17 06:25

    You probably have already resolved this in some way but I'll post the answer anyway:

    You cannot refer to the same table that triggered the trigger in a trigger (or a combination of trigger and stored procedure). This could mean an infinite loop, so sql prevents it by giving that error, resulting in always the same error.

提交回复
热议问题