phpmysql Introduction When we want to execute a specific task at a scheduled time, MySQL provides special functionality called triggers. Triggers are basically named blocks of code that are executed, or fired, automatically when a specified type of SQL statement is executed. Triggers can be executed before after an INSERT, UPDATE or DELETE statement is executed on the table. Syntax CREATE TRIGGER trigger_Name {Before|After}{Insert|Update|Delete}ON table_name For EACH ROW sql_block For Example Using the following query, you can better understand what a trigger is and how to use a trigger to execute a specific task at a scheduled time. Query The following query creates a trigger named "MysqlTrigger", this trigger is associated with the name emp table and is fired before an update. When you try to update a name with lower case, it will automatically convert it to UPPER case . "CREATE TRIGGER MysqlTrigge...
Comments
Post a Comment