Can't update table in trigger ... already in use [was: Help me]
hi
I am new to Mysql. We have a table like this
CREATE TABLE `instructionsstatus` (
`InstructionID` bigint(20) NOT NULL,
`InstructionStatus` varchar(20) NOT NULL,
`From` datetime DEFAULT NULL,
`To` datetime DEFAULT NULL,
`UserID` int(11) DEFAULT NULL,
`HostName` varchar(200) DEFAULT NULL)
if to value is null then that is the status of the instructionID. If it has some date value then it was changed to new status
i have created a trigger before insert to update the old status record to the currentdatetime(Now()), so that before every insert the old status changes to inactive and the new status line will get inserted.
But its throwing a exception
Error Code: 1442. Can't update table 'InstructionsStatus' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
Please help me.
Regards
VMSSanthosh
Edited 1 time(s). Last edit at 07/13/2011 07:22AM by Guelphdad Lake.
Subject
Views
Written By
Posted
Can't update table in trigger ... already in use [was: Help me]
3782
July 13, 2011 07:10AM
1408
July 14, 2011 01:11AM
1262
July 14, 2011 08:19AM
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.