trigger after delete

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • oll3i
    Contributor
    • Mar 2007
    • 679

    #1

    trigger after delete

    Code:
    CREATE TRIGGER candidate_delete AFTER DELETE ON candidates
     FOR EACH ROW BEGIN
        INSERT INTO candidates_trash SET ID_CANDIDATE=OLD.ID_CANDIDATE,candidate_status=OLD.candidate_status,job_reference=OLD.job_reference,name=OLD.name,firstname=OLD.firstname,
       qm1=OLD.qm1,qm2=OLD.qm2,qm3=OLD.qm3,civic_status=OLD.civic_status,dob=OLD.dob,yearofbirth=OLD.yearofbirth,
       ph_mob_con=OLD.ph_mob_con,ph_mob=OLD.ph_mob,ph_home_con=OLD.ph_home_con,ph_home_city=OLD.ph_home_city,ph_home=OLD.ph_home,
       ph_work_con=OLD.ph_work_con,ph_work_city=OLD.ph_work_city,ph_work=OLD.ph_work,email_per=OLD.email_per,email_work=OLD.email_work,
       city=OLD.city,province=OLD.province,
       location=OLD.location,origin_app=OLD.origin_app,mobility=OLD.mobility,ID_NUMBER=OLD.ID_NUMBER,candidate_password=OLD.candidate_password,score=OLD.score,
       entered=OLD.entered,enteredby=OLD.enteredby;
      END;
    why i get
    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO candidates_tras h SET ID_CANDIDATE=OL D.ID_CANDIDATE, candidate_statu s=' at line 3

    in mysql 5.0.41


    THANK YOU
  • oll3i
    Contributor
    • Mar 2007
    • 679

    #2
    ok i solved it :) thank you

    Comment

    • Jankie
      New Member
      • May 2007
      • 58

      #3
      Originally posted by oll3i
      ok i solved it :) thank you
      would you mind sharing how did you solve it,please?
      just curious :)

      Comment

      Working...