MySQL Forums
Forum List  »  Triggers

Updating column in same table after insert...
Posted by: Jim Reamer
Date: September 05, 2017 01:52PM

I'm extremely new to using triggers. I'm trying to streamline data entry process for my db users, me included. It will also help eliminate typos.

I'd like a column (name) to reflect entry from two other columns (nameFirst and nameLast). I'm trying to do so via this trigger:

Action Time: After
Event: Insert

update a_players
set NEW.wpSlug = concat(lower(NEW.nameFirst),'-',lower(NEW.nameLast))


I'm getting this error:

Can't update table 'a_players' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.



I keep looking up different syntaxes, and I can't wrap my head around how it should work.

Thank you.

Options: ReplyQuote


Subject
Views
Written By
Posted
Updating column in same table after insert...
3097
September 05, 2017 01:52PM


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.