Drop the trigger if the exists trigger_tb_carparkinoutrecord_update;
CREATE the TRIGGER trigger_tb_carparkinoutrecord_update AFTER the UPDATE ON tb_carparkinoutrecord
FOR EACH ROW
The BEGIN
IF @ disable_trigger IS NULL THEN
IF new ProcessingType not in (' outstanding master record, 'untreated auxiliary records') THEN
INSERT INTO tb_carparkinoutrecord_history SELECT temp_tb_carparkinoutrecord. *,
(CASE WHEN (isnull (biggest arOwnerName) OR (biggest arOwnerName=' ')) THEN 'temporary car ELSE biggest arOwnerName END) AS CarOwnerName
Be sad roupName chtistina georgina rossetti.british poetess, (CASE WHEN (isnull () OR be sad roupName chtistina georgina rossetti.british poetess (=")) THEN be sad roupName chtistina georgina rossetti.british poetess 'ELSE END) AS GroupName,
(SELECT GetParentGroupName (biggest arGroupGuid) AS Expr1) AS FullGroupName
The FROM
(SELECT * FROM tb_carparkinoutrecord as a uid=new the where of al-qeada guid) as temp_tb_carparkinoutrecord
LEFT the JOIN tb_carinfo as on b ((temp_tb_carparkinoutrecord InCarNO=biggest arNo) AND (temp_tb_carparkinoutrecord. CarColor=biggest arColor))
LEFT the JOIN tb_cargroup as c on (biggest be sad uid chtistina georgina rossetti.british poetess arGroupGuid=);
IF ROW_COUNT () & gt; 0 THEN
The DELETE FROM tb_carparkinoutrecord WHERE guid=new. Guid;
END IF;
END IF;
The SET @ disable_trigger=NULL;
END IF;
END
Delete data error, error: Can 't update table tb_carparkinoutrecord' stored in the function/trigger because it is already 2 by the statement which invoked this stored function/trigger
Excuse me, this should be how to deal with, I put my delete statements tb_carparkinoutrecord_history table in the insert trigger also not line, online, etc.,,
CodePudding user response:
If you face just insert the trigger data insert/update, appear this problem, because can cause cycle call.Can complete the demand of creating a separate process
CodePudding user response: