473,378 Members | 1,401 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

trigger after delete

oll3i
679 512MB
Expand|Select|Wrap|Line Numbers
  1. CREATE TRIGGER candidate_delete AFTER DELETE ON candidates
  2.  FOR EACH ROW BEGIN
  3.     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,
  4.    qm1=OLD.qm1,qm2=OLD.qm2,qm3=OLD.qm3,civic_status=OLD.civic_status,dob=OLD.dob,yearofbirth=OLD.yearofbirth,
  5.    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,
  6.    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,
  7.    city=OLD.city,province=OLD.province,
  8.    location=OLD.location,origin_app=OLD.origin_app,mobility=OLD.mobility,ID_NUMBER=OLD.ID_NUMBER,candidate_password=OLD.candidate_password,score=OLD.score,
  9.    entered=OLD.entered,enteredby=OLD.enteredby;
  10.   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_trash SET ID_CANDIDATE=OLD.ID_CANDIDATE,candidate_status=' at line 3

in mysql 5.0.41


THANK YOU
Dec 12 '07 #1
2 2678
oll3i
679 512MB
ok i solved it :) thank you
Dec 12 '07 #2
Jankie
58
ok i solved it :) thank you
would you mind sharing how did you solve it,please?
just curious :)
Dec 29 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Aidan Whitehall | last post by:
Have gone through BOL and Google, but can't find the answer... please help with a simple Q. I'm trying to create a simple cascade delete trigger in SQL Server 7 where deleting "parent" records in...
1
by: Matik | last post by:
Hello to all, I have a small question. I call the SP outer the DB. The procedure deletes some record in table T1. The table T1 has a trigger after delete. This is very importand for me, that...
6
by: Scott CM | last post by:
I have a multi-part question regarding trigger performance. First of all, is there performance gain from issuing the following within a trigger: SELECT PrimaryKeyColumn FROM INSERTED opposed...
0
by: JohnO | last post by:
Thanks to Serge and MarkB for recent tips and suggestions. Ive rolled together a few stored procedures to assist with creating audit triggers automagically. Hope someone finds this as useful as...
0
by: Bob | last post by:
Hi, I have a very odd postgresql problem. I have some subqueries contained within a function which are looking for unrefernced data and then delete any rows that are found: CREATE OR...
1
by: Robert Fitzpatrick | last post by:
I am running PostgreSQL 7.4.5 and have a trigger on a table called tblriskassessors which inserts, updates or delete a corresponding record in tblinspectors by lookup of a contact id and license...
4
by: Naeem Bari | last post by:
Hi, I am using postgres 7.4.5 on Redhat Enterprise Linux 3. My background is really on Oracle, and I am porting a largish database over to postgres. Here is my problem: On oracle, I...
2
by: dean.cochrane | last post by:
I have inherited a large application. I have a table which contains a hierarchy, like this CREATE TABLE sample_table( sample_id int NOT NULL parent_sample_id int NOT NULL ....lots of other...
6
by: Oliver | last post by:
I'm fairly new to DB2. I have been assigned to build a delete trigger that finds the data type of each of the table's fields so that the trigger can then build a string consisting of OLD values...
10
by: JohnO | last post by:
Hi All, This question is related to iSeries V5R4 and db2. I want to implement an AFTER DELETE trigger to save the deleted rows to an archive table, I initially defined it as a FOR EACH...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.