User-defined function

This is an old revision of this page, as edited by Crystallina (talk | contribs) at 04:33, 17 May 2006 (Stub-sorting. You can help!). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

A User Defined Function, or UDF, is an extension to an SQL database server (like MySQL) that can be compiled for use in an SQL query. For example, sometimes it may be necessary to obtain a random number for use as a primary key (a function that MySQL does not support). In this case, a new, external function could be written and compiled to accomplish this task. One sample of such a query could be: SELECT GETRANDOMKEY();.

Essentially, this external function becomes part of the server itself.