You are in: Products > HoneyMonitor > Reference Manual > On-line Consultation >



41.8 Triggers

The support for Triggers was added in MySQLTM v.5.0.2.

A Trigger is procedural code that is automatically executed in response to certain events on a particular table in a database.

Creating a Trigger
To create a Trigger:
  1. open the ''Server Object List'' (chap. 16);
  2. expand the ''Tables'' node relating the database which contains the table you want to create the trigger in;
  3. double click on the table name;
  4. click on the ''Triggers'' Tab of the ''Table Editor'' (sec. 41.4);
  5. click the ''Add Trigger'' button (or right click and select the ''Add Trigger'' item from the popup menu);
  6. use the ''Trigger Editor'' (sec. 41.8.1)
http://www.honeysoftware.com/products/honeymonitor/doc/images/video.jpg Watch the Video >>

Editing a Trigger
To edit a Trigger:
  1. open the ''Server Object List'' (chap. 16);
  2. expand the ''Tables'' node relating the database which contains the table which contains the trigger you want to edit;
  3. double click on the table name;
  4. click on the ''Triggers'' Tab of the ''Table Editor'' (sec. 41.4);
  5. in the triggers' grid select the row relating the trigger you want to edit;
  6. click on the ''Edit selected Trigger'' button (or double click or right click and select the ''Edit Trigger'' item from the popup menu);
  7. use the ''Trigger Editor'' (sec. 41.8.1)
http://www.honeysoftware.com/products/honeymonitor/doc/images/video.jpg Watch the Video >>

Dropping a Trigger
To drop a Trigger:
  1. open the ''Server Object List'' (chap. 16);
  2. expand the ''Tables'' node relating the database which contains the table you want to drop the trigger from;
  3. double click on the table name;
  4. click on the ''Triggers'' Tab of the ''Table Editor'' (sec. 41.4);
  5. in the triggers' grid select the row relating the trigger you want to drop;
  6. click on the ''Drop selected Trigger'' (or right click and select the ''Drop Trigger'' item from the popup menu);
  7. confirm requested operation.

Multi-Drop of Triggers
To drop a set of Triggers of a Table:
  1. open the ''Server Object List'' (chap. 16);
  2. expand the table node relating the database which contains the table you want to drop the triggers from;
  3. right click on the ''Triggers'' node and select the ''Multi-Drop of Triggers'' item from the popup menu;
  4. use the ''Multi-Drop Wizard'' (chap. 26).


41.8.1 Trigger Editor

The Trigger Editor allows you to create, edit and drop triggers.

The ''Editor'' (Fig. 41.57) can be opened from the Table Editor or using the popup menu of the Server Objects List (see the introduction of the sec. 41.8).

See Also:


Figure 41.57: The Trigger Editor.
http://www.honeysoftware.com/products/honeymonitor/doc/images/tablesmanagement/ENG/trigger/options.jpg
The Editor is divided into several Tabs (''Options'',''Statement'',''SQL'').

You may open as many Trigger Editors as you want to do a comparison between more triggers (of the same or of different servers).

Toolbar
Using the toolbar you may:
  • http://www.honeysoftware.com/products/honeymonitor/doc/images/icon/refresh.jpg refresh the ''Editor'';
  • http://www.honeysoftware.com/products/honeymonitor/doc/images/icon/ico_success.jpg save your changes;
  • http://www.honeysoftware.com/products/honeymonitor/doc/images/icon/bell_delete.jpg drop the current trigger;
  • http://www.honeysoftware.com/products/honeymonitor/doc/images/icon/bell_add.jpg create a new trigger;
  • http://www.honeysoftware.com/products/honeymonitor/doc/images/icon/folder.jpg load the trigger's statement from a file;
  • http://www.honeysoftware.com/products/honeymonitor/doc/images/icon/save.jpg save the trigger's statement to a file;
  • http://www.honeysoftware.com/products/honeymonitor/doc/images/icon/undo_16.jpg undo your changes (just for the ''Statement'' Tab);
  • http://www.honeysoftware.com/products/honeymonitor/doc/images/icon/redo_16.jpg redo your changes (just for the ''Statement'' Tab);
  • http://www.honeysoftware.com/products/honeymonitor/doc/images/icon/xpicon1.jpg view the help;
  • http://www.honeysoftware.com/products/honeymonitor/doc/images/icon/b03.jpg close the ''Editor''.


41.8.1.1 Options

The ''Options'' Tab (Fig. 41.58) allows you to set the trigger's options (like the Name, Time, Event, Table).

The ''Trigger Information'' frame is not editable; it includes useful information about the trigger.

Figure 41.58: Trigger Options.
http://www.honeysoftware.com/products/honeymonitor/doc/images/tablesmanagement/ENG/trigger/options.jpg


41.8.1.2 Statement

The ''Statement'' Tab (Fig. 41.59) allows you to edit the trigger statement, i.e. the SQL statements executed when triggering.

You may load the trigger's statement from a file clicking on the ''Load Trigger's Statement from File'' button.

Figure 41.59: Trigger Statement.
http://www.honeysoftware.com/products/honeymonitor/doc/images/tablesmanagement/ENG/trigger/statement.jpg

If you right click a useful popup menu will appear (Fig. 41.60).

Figure 41.60: Trigger Editor: Popup menu.
http://www.honeysoftware.com/products/honeymonitor/doc/images/tablesmanagement/ENG/trigger/popup.jpg


41.8.1.3 SQL

The ''SQL'' Tab (Fig. 41.61) contains the SQL syntax for recreating the current trigger. The code control is not editable: please use the ''Options'' and ''Statement'' Tabs to edit the trigger properties.

If you right click a useful popup menu will appear.

Figure 41.61: Trigger Syntax.
http://www.honeysoftware.com/products/honeymonitor/doc/images/tablesmanagement/ENG/trigger/sql.jpg



Copyright © 2007 - 2009 HoneySoftware - All Rights Reserved

Submit feedback on this topic.






Available Languages:
    English >>
    Italian >>

Related Pages:
    Download >> Buy >> HoneySoftware EULA >>
    Tecnical Support >>    

Further Resources::
    Order Demo CD >>

 

NewsFlash:




May we help you?


Chat with us!

Get Skype and Chat with us!
PayPal Acceptance Mark

Customers Area:

User Id
Password
 

Awards:

HoneyMonitor Received "User Choice" Award at Free Download Manager

Twitter:


Follow HoneySoftware on Twitter!

Follow us @ Twitter!

Company | Site Map | Privacy Policy | Contact Us || © 2007 - 2010 HoneySoftware - webmaster@honeysoftware.com. Best viewed with 1024*768 p.r. or higher.