MySQL Forums
Forum List  »  Triggers

Re: strange thing about use trigger
Posted by: Devart Team
Date: June 14, 2011 02:22AM

>but i find one record has not been updated correctly

Do you mean not all records have been updated? Have a look at the trigger - the SELECT statement finds all matched rows, but LIMIT clause selects only one row from data-set; and you are trying to update only this one. I'd suggest you to use this statement instead of SELECT+UPDATE, try it -

UPDATE Interface_Data.Conf_List
SET
  CallBeginTime = NEW.`CallBeginTime`,
  CallEndTime = NEW.`CallEndTime`,
  CallTimer = NEW.`CallTimer`,
  BillSource = NEW.`BillSource`
WHERE
  BillNum = NEW.BillNum
  AND CallerNum = New.CallerNum
  AND CalledNum = New.CalledNum
  AND CallBeginTime = '';

Devart Company,
MySQL management tools
http://www.devart.com/dbforge/mysql/

Options: ReplyQuote


Subject
Views
Written By
Posted
1780
June 10, 2011 02:18AM
Re: strange thing about use trigger
886
June 14, 2011 02:22AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.