MySQL Forums
Forum List  »  Triggers

Re: Creating Trigger.. New to this obviously
Posted by: Peter Brawley
Date: March 14, 2019 08:48PM

Quote

CREATE TRIGGER Update_Directory AFTER INSERT ON wpin_gm_user_entries UPDATE wpin_gm_user_entries SET download_link = REPLACE(download_link, 'uploads', 'gravity2pdf') ;

Please read more carefully the manual page for Triggers.

1. Your syntax is missing ...For Each Row...

2. A Trigger cannot itself issue an Update command on the table for which it is defined (eg such could induce an infinite loop). As the manual page says, changing values in the defined row needs SET NEW.columnName syntax.

If you get stuck correcting these errors, please post the result of Show Create Table result for the table, and the detailed requirement for the Trigger with an example.



Edited 1 time(s). Last edit at 03/14/2019 09:04PM by Peter Brawley.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Creating Trigger.. New to this obviously
577
March 14, 2019 08:48PM


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.