I'm trying to create a trigger in MySQL using PhpMyAdmin.
CREATE TRIGGER Update_Last_Transit_Status AFTER INSERT ON Delivery
FOR EACH ROW
BEGIN
UPDATE Transportation SET Status="Dispatched" WHERE
EXISTS (SELECT * FROM Transit, Route WHERE Transit.ID=Route.Transit_ID and
Route.Delivery_ID=Delivery.ID and
Transit.Transportation_ID=Transportation.ID) and
Status="In Branch"
END
It says:
MySQL said: #1303 - Can't create a TRIGGER from within another stored routine
I know this error has been addressed before, but this wasn't my intention at all.
Where is "another stored routine" here?
I don't intend to what the error message says.
EDIT: There are no other triggers defined. There is however one procedure predefined:
begin
select user() as first_col;
select user() as first_col, now() as second_col;
select user() as first_col, now() as second_col, now() as third_col;
end
I don't know what it does, or why it is there, but it was there before.