1

I'm having a table with 3 columns say a,b,c where a is the primary key. Consider it has a value

1 hai hello

Using triggers i need to insert another row value as

1 bye hello

please note that i want to insert the value not to update and i want to perform this in trigger.

First i have planned to do it with trigger in BEFORE INSERT, but I'm getting an error while inserting the value.

Error: Can't update table 'table1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.

I'm already having another trigger in AFTER INSERT.

user3784251
  • 520
  • 2
  • 10
  • 24
  • 2
    AFAIK you [can't target the same table](http://stackoverflow.com/questions/12877732/mysql-trigger-for-updating-same-table-after-insert) in a trigger, and MySql doesn't have INSTEAD OF triggers which would allow you to duplicate the record. IMO you are doing too much in the triggers - as per the link, recommend you create a procedure and insert both records through this. – StuartLC Oct 23 '14 at 15:06

0 Answers0