MySQL Forums
Forum List  »  Stored Procedures

Dynamically Creating Triggers from a Stored Procedure
Posted by: Quentin Spencer
Date: June 18, 2013 02:30PM

I'm trying to dynamically create a simple trigger from a stored procedure. It's not working as I'm running in to this limitation:

Section 13.5 of the MySQL Reference Manual - "SQL syntax for prepared statements does not support multi-statements (that is, multiple statements within a single string separated by “;” characters)."

Triggers, by definition, consist of multiple statements. Has anyone figured out a way around this limitation? It seems like dynamically creating triggers is definitely a needed feature for MySQL. If you have 100 tables in your database and you want an audit table on each one, that's 300 triggers you would have to create by hand.

Thanks in advance for your help!

Options: ReplyQuote


Subject
Views
Written By
Posted
Dynamically Creating Triggers from a Stored Procedure
9084
June 18, 2013 02:30PM


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.