Summary

MySQL allows you to add user-defined functions (UDFs). You use these as you would a normal function inside a query. There are two kinds of UDFs: aggregate and standard. Aggregate UDFs work on groups of data and can be used with the GROUP BY clause. Standard UDFs work on single rows of data.

Standard UDFs consist of three functions: the main function, which is required and called for every row, and the initialization and deinitialization functions, called once at the beginning and end, respectively. Aggregate functions also utilize the add function (called every row, in place of the main function, which is called only once at the end of every group) and the reset function (called at the start of every group).



Mastering MySQL 4
Mastering MySQL 4
ISBN: 0782141625
EAN: 2147483647
Year: 2003
Pages: 230
Authors: Ian Gilfillan

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