MySQL Forums
Forum List  »  Triggers

Can't update table 'dctblloaddata' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
Posted by: Saranya Jothiprakasam
Date: November 19, 2011 04:11AM

hi
i got this following error when trying to insert
Can't update table 'dctblloaddata' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
my trigger is

DELIMITER $$

CREATE TRIGGER `cfw`.`samplwe` BEFORE INSERT ON `cfw`.`dctblloaddata`
FOR EACH ROW BEGIN

IF (NEW.AvgCurrent>800 OR NEW.AvgCurrent = 0 OR NEW.AvgCurrent =-99999.99 OR NEW.AvgVolt >300 OR NEW.AvgVolt=0 OR NEW.AvgVolt=-99999.99 OR NEW.ActiveDemandFwd=0 OR NEW.ActiveDemandFwd=-99999.99 OR NEW.ApperentDemandFwd=0 OR NEW.ApperentDemandFwd=-99999.99) THEN

INSERT INTO `dctblloaddata` (`MeterID`,`DataID`,`DateVal`,`IntervalID`,`TagType`,`AvgVolt`,`AvgCurrent`,`RDemandExp`,`RDemandFwdExp`,`ActiveDemandFwd`,`RDemandImp`,`RDemandFwdImp`,`ApperentDemandFwd`,`ApperentEnergyImp`,`ActiveEnergyImp`,`ReactiveEnergyImp`,`ReactiveEnergyExp`,`FeederID`,`MTIME`,`CollectionType`,`calculatedtechnicalloss`,`circleid`,`consumerid`,`divisionid`,`substationid`,`zoneid`,`ib`,`ir`,`iy`,`vb`,`vr`,`vy`) VALUES
(NEW. MeterID ,NEW. DataID ,NEW. DateVal ,NEW. IntervalID ,NEW. TagType ,-99999.99,-99999.99,NEW. RDemandExp ,NEW. RDemandFwdExp ,-99999.99,NEW. RDemandImp ,NEW. RDemandFwdImp ,-99999.99 ,NEW. ApperentEnergyImp ,NEW. ActiveEnergyImp ,NEW. ReactiveEnergyImp ,NEW. ReactiveEnergyExp ,NEW. FeederID ,NEW. MTIME ,NEW. CollectionType ,NEW. calculatedtechnicalloss ,NEW. circleid ,NEW. consumerid ,NEW. divisionid ,NEW. substationid ,NEW. zoneid ,NEW. ib ,NEW. ir ,NEW. iy ,NEW. vb ,NEW. vr ,NEW. vy );
END IF;
END$$

DELIMITER ;

give me some suggestion wht i have to do now..

Options: ReplyQuote


Subject
Views
Written By
Posted
Can't update table 'dctblloaddata' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
2523
November 19, 2011 04:11AM


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.