Triggers are a new addition to MySQL 5.0 and bring much needed, enterprise level, functionality to the MySQL database. For programmers who have not used triggers they are named database objects/stored programs that are associated with a table and are activated when a certain events occur on that table. A trigger can be defined to activate BEFORE or AFTER an INSERT, DELETE or UPDATE statement executes on the table it is assigned to.
With the implementation of Stored Programs in MySQL 5.0 comes cursors. This article will explain what a cursor is and show how to go about using them in MySQL 5.0 Stored Procedures and Stored Functions
Stored Functions are a new addition to MySQL 5.0 and bring much needed, enterprise level, functionality to the MySQL database. For programmers who have not used functions they are named database objects/stored programs that can be called by other MySQL stored programs or external programs - often used to carry out repetative or complicated tasks. Functions by definition always return a value and should never update anything in the database. They should simply be used to generate an output based on a certain set of input parameters.