19.6. Destroying a Trigger


To destroy a trigger, use the DROP TRIGGER statement. For example, if the Capital table in the world database has a trigger that is named Capital_bi, drop the trigger by using this statement:

 DROP TRIGGER world.Capital_bi; 

If you omit the database name, the trigger is assumed to be in the default dastabase. An error occurs if the trigger does not exist.

DROP TRIGGER destroys a trigger explicitly. Triggers also are destroyed implicitly under some circumstances. When you drop a table that has triggers associated with it, MySQL drops the triggers as well. When you drop a database, doing so causes tables in the database to be dropped, and thus also drops any triggers for those tables.



MySQL 5 Certification Study Guide
MySQL 5.0 Certification Study Guide
ISBN: 0672328127
EAN: 2147483647
Year: 2006
Pages: 312

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net