Friday, 15 August 2014

MySQL: Trigger to Insert New Row in One Table When Another Table has a Row Inserted -


I want to insert a new line in an existing table, when the row is inserted in another table. There are many examples of this, though I am not able to find anyone with a trigger. Here's my code. What am I doing wrong? Trigger is not just firing:

  USE 'MTFDFRF'; Each line inserted in delimiters $$ `StationTrouble` (` _rowid_`, `fullname`,` username`, `email5`,` controlnumber````````````` for `problemdescription`, then insert the insert trigger on` StationTrouble_temp` Select 'StationTrouble_temp`, `appaerentcause`,` observed`, `reportstatus`,` _submitted_`, `_fromaddress_`,` _flags_`, `_transactid_`,` submittername`, `other submitter`) rowid_, full name, user Name, email5, controlnumber, station, problemdescription, appaerentcause, celebrated, reportstatus, _submitted_, _fromaddress_, _flags_, _transactid_, submittername, othersubmitter from StationTrouble_temp;  

You use the new keyword to enter new ones If the trigger where the trigger is executed, then it should be

in the form from
  Delimiter $$ to create a trigger trigger on `StationTrouble_temp` after each line` `StationTrouble_temp` StationTrouble` starts entering (`_rowid_`,` fullname`, `username`,` email5`, `controlnumber`,` station`, `problemdescription`,` appaerentcause`, `observed`,` reportstatus`, `_submitted_`, `_fromaddress_`,` _flags_`, `_transactid_`, 'submit,', 'other Google 'value (new.rowid_, new.fullname, new.username, new.em) Ail5, new.controlnumber, new.station, new.problemdescription, new.appaerentcause, new.observed, new.reportstatus, new._submitted_ , New._fromaddress_, new._flags_, new._transactid_, new.submittername, new.othersubmitter); End ; $$  

No comments:

Post a Comment