MySQL Forums
Forum List  »  Triggers

Re: (UPDATED with Schema) Triggers before update error (Error Code: 1054. Unknown column 'workflow_id' in 'NEW')
Posted by: Steve Landry
Date: January 28, 2014 10:02AM

Hi Peter,

First of all tks for taking time to reply back.

We used FLUSH TABLES to show that when we used it before an update statement, the trigger runs without error on the automatic status logic.
Since we’re using the submission_log table to track any update on the submission table, we decided to put the logic within the before update trigger.

When you’re running the following statement, are you getting the same error (Error Code: 1054. Unknown column 'workflow_id' in 'NEW' ) when we hit the automated status logic in the trigger ?:

-- Id 1 not automated to next status 2 ALWAYS WORK
update tsttrigger.submission set workflow_id = 1
where id = 1;

-- Id 2 is AUTOMATED to next status 3 FIRST RUN of an AUTOMATED status
update tsttrigger.submission set workflow_id = 2
where id = 1;

-- Id 5 is AUTOMATED to next status 6 THIS WILL FAILED 
update tsttrigger.submission set workflow_id = 5
where id = 1;

-- Id 1 not automated to next status 2 ALWAYS WORK
update tsttrigger.submission set workflow_id = 1
where id = 1;

How can we make a trigger works since it is working without any modification when we use FLUSH TABLE and get an error on certain condition without it?

Let me know,

Tks

Options: ReplyQuote




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.