Re: Trigger problem

2008-05-25 Thread Paul DuBois
On May 15, 2008, at 4:30 AM, rustam ershtukaev wrote: I have been trying to write a trigger in mysql, but can't get it to work. It's really simple,i just need my trigger to add varchar value to a table on insert if postcode = 1000. Where does postcode come from? Your SELECT statement

Trigger problem

2008-05-15 Thread rustam ershtukaev
I have been trying to write a trigger in mysql, but can't get it to work. It's really simple,i just need my trigger to add varchar value to a table on insert if postcode = 1000. this is how i did it: delimiter | drop trigger testdep| create trigger testdep before insert on departements

Re: Trigger problem

2008-05-15 Thread Rob Wultsch
On Thu, May 15, 2008 at 2:30 AM, rustam ershtukaev [EMAIL PROTECTED] wrote: I have been trying to write a trigger in mysql, but can't get it to work. It's really simple,i just need my trigger to add varchar value to a table on insert if postcode = 1000. this is how i did it: delimiter |

Re: Trigger problem

2007-11-13 Thread Scott
On Thu, 2007-11-08 at 17:56 -0800, Lucky Wijaya wrote: Yes, the trigger code is works. Many thanks !! Now I understand the use of delimiter command. Thanks again... =) My next question is, do we able to view the triggers that has been created ? And how ? David Schneider-Joseph [EMAIL

Re: Trigger problem

2007-11-08 Thread Lucky Wijaya
Yes, the trigger code is works. Many thanks !! Now I understand the use of delimiter command. Thanks again... =) My next question is, do we able to view the triggers that has been created ? And how ? David Schneider-Joseph [EMAIL PROTECTED] wrote: My apologies, try this: DELIMITER ;; CREATE

Re: Trigger problem

2007-11-07 Thread David Schneider-Joseph
My apologies, try this: DELIMITER ;; CREATE TRIGGER DEL_TB_INSTRUKSI AFTER DELETE ON Tb_Instruksi FOR EACH ROW BEGIN DELETE FROM Tb_Stuffing WHERE No_Instruksi = OLD.No_Instruksi; END; ;; DELIMITER ; To answer your question: The DELIMITER statement tells MySQL to use a different set of

Trigger problem

2007-11-06 Thread Lucky Wijaya
Hi, my name is Lucky from Indonesia. I build an database application using Delphi 7 MySQL as the RDBMS. Now, I'm having problem in creating trigger in MySQL. Here is the code of the trigger: CREATE TRIGGER DEL_TB_INSTRUKSI AFTER DELETE ON Tb_Instruksi FOR EACH ROW BEGIN DELETE FROM

Re: Trigger problem

2007-11-06 Thread David Schneider-Joseph
Lucky, Did you make sure to set your delimiter before and after the CREATE TRIGGER statement? e.g.: DELIMITER ;; CREATE TRIGGER DEL_TB_INSTRUKSI AFTER DELETE ON Tb_Instruksi FOR EACH ROW BEGIN DELETE FROM Tb_Stuffing WHERE No_Instruksi = OLD.No_Instruksi; END;; DELIMITER ; On Nov 6,

Re: Trigger problem

2007-11-06 Thread Lucky Wijaya
No, I didn't set the delimiter. But, it still have an error after I set delimiter in my trigger as your example. By the way, what's delimiter mean ? And what it's for ? Thanks to you Mr. David. David Schneider-Joseph [EMAIL PROTECTED] wrote: Lucky, Did you make sure to set your delimiter