Trigger in MYSQL

Trigger in MYSQL

Triggers

A trigger is a named database object that is associated with a table and that is activated when a particular event occurs for the table.In MYSQL5.0.2 and above version only support the triggers

Create Trigger Syntax:

CREATE TRIGGER trigger_name trigger_time trigger_event
ON tbl_name FOR EACH ROW trigger_stmt

Trigger becomes associated with the table name.

trigger_time ->it specify the time which to activate the trigger

trigger_event->it specify events to handle the trigger

trigger_stmt ->it specify statement , to execute when the trigger activates

Drop trigger Syntax:

DROP TRIGGER tbl_name.trigger_name

Leave a Reply

You must be logged in to post a comment.


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.