User-defined function: Difference between revisions

Content deleted Content added
m wikify, de-stub (what else can really be said?)
Amcguinn (talk | contribs)
User defined functions are not limited to SQL systems
Line 1:
A '''User Defined Function''', or '''UDF''', is a [[function (programming)|function]] provided by the user of a program or environment, in a context where the usual assumption is that functions are built into the program or environment.
A '''User Defined Function''', or '''UDF''', is an [[extension (computing)|extension]] to an [[SQL]] [[database server]] (like [[MySQL]]) that can be compiled for use in an SQL [[database query language|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 internally support). In this case, a new external function could be written and compiled to accomplish this task.
 
==[[BASIC]] language==
 
In some old implementations of the BASIC programming language, user defined functions are defined using the "DEF FN" syntax. More modern dialects of BASIC are influenced by the [[structured programming]] paradigm, where most or all code is written as user defined functions or procedures, and the concept becomes practically redundant.
 
 
==Databases==
 
AIn '''Usersome Defined Function'''databases, ora '''UDF''', is an [[extension (computing)|extension]] to an [[SQL]]the [[database server]] (like [[MySQL]]) that can be compiled for use in an [[SQL]] [[database query language|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 internally 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: <code>SELECT GETRANDOMKEY();</code>.
 
Essentially, this external function becomes part of the server itself. This can also known as a [[user exit]] (e.g. in the [[Adabas]] database)
 
 
==External links==