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,474 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 3,528 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: Apr 2008
Posts: 248
Reputation: tesuji is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 29
tesuji tesuji is offline Offline
Posting Whiz in Training

Re: mySQL TRIGGER problem

  #2  
May 9th, 2008
hi,
what is the error message?

Your trigger will be fired AFTER update, and, obviously, it were to catch update errors IF the record to be updated does not exist in your table. Well, if that record does not exist, update would not be execute, therefore (i believe so) AFTER-update trigger will never be fired.

If you want to prevent failure, if a record to be inserted already exists (that would lead into duplicate primary key), you might use
  1. INSERT INTO TABLE (...) VALUES (...) ON DUPLICATE KEY UPDATE ....
krs,
tesu
Reply With Quote  
All times are GMT -4. The time now is 3:09 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC