User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 363,802 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,560 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser:

mySQL TRIGGER problem

Join Date: May 2008
Posts: 1
Reputation: M3nTaL is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
M3nTaL M3nTaL is offline Offline
Newbie Poster

mySQL TRIGGER problem

  #1  
May 8th, 2008
Hello,

I'm having some sintax problems using PL/SQL in mySQL TRIGGERS.. I need some help please .
Here is the code:

CREATE TRIGGER modificou
   AFTER UPDATE ON monitor
   FOR EACH ROW
 BEGIN
   IF NOT EXISTS(SELECT estado_tmp FROM alteracoes WHERE id_tmp = OLD.id)
   THEN
       INSERT INTO alteracoes VALUES(OLD.id,NEW.estado);
   ELSE
       UPDATE alteracoes SET estado_tmp = NEW.estado WHERE id_tmp = OLD.id;
   END IF;
 END modificou;

What could be wrong?? For testing I'm using phpmyadmin 2.11.1

Thanks
AddThis Social Bookmark Button
Reply With Quote  
All times are GMT -4. The time now is 11:16 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC