If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > ERROR 1442 (HY000): Can't update table 'accounts' in stored function/trigger because

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-10-07, 04:41
mari_malathy mari_malathy is offline
Registered User
 
Join Date: Dec 2007
Posts: 4
ERROR 1442 (HY000): Can't update table 'accounts' in stored function/trigger because

Hi All,

I am facing this error whenever I update a record in the table. I have AFTER UPDATE trigger is running on the TABLE to which I am trying to update the record.

The trigger is as follows:

-- Trigger definition script TR_u_Accounts_cdx_Merge for MySQL
-- Generated by (c) Ispirer SQLWays 3.9 Build 1010 EVALUATION VERSION
-- Timestamp: Thu Nov 08 11:28:36 2007

DELIMITER $$

CREATE TRIGGER TR_u_Accounts_cdx AFTER UPDATE
ON Accounts FOR EACH ROW
BEGIN

BEGIN
IF NOT(OLD.TMDate <> NEW.TMDate) then
UPDATE Accounts
SET ConcurDetect_X = 1+(CASE WHEN OLD.OrgID = OLD.OrgID THEN IFNULL(OLD.ConcurDetect_X,1)
END) WHERE Accounts.OrgID = OLD.OrgID;
END IF;
END;
BEGIN
IF NOT(OLD.TMDate <> NEW.TMDate) then
UPDATE Accounts SET TMDate = UTC_DATE() WHERE REPLGUID =
OLD.REPLGUID;
END IF;
END;
END;

$$


Please suggest me a solution.

Regards,
Mari.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On