User-defined function: Difference between revisions

Content deleted Content added
No edit summary
EagleEye96 (talk | contribs)
Reverted to revision 678305965 by Frap (talk): Reverting unconstructive edits. (TW)
Line 1:
A '''user-defined function''' ('''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.
 
==BASIC language==
Line 5:
 
==Databases==
In SQL databases, a UDFuser-defined function provides a mechanism for extending the functionality of the [[database server]] by adding a function that can be evaluated in SQL statements. The [[SQL:2003|SQL]] standard distinguishes between [[Scalar (computing)|scalar]] and table functions. A scalar function returns only a single value (or [[null (SQL)|NULL]]), whereas a table function returns a (relational) table comprising zero or more rows, each row with one or more columns.
 
User-defined functions in SQL are declared using the <code>CREATE FUNCTION</code> statement. For example, a function that converts Celsius to Fahrenheit might be declared like this:
Line 39:
*Scalar functions.
*Inline table-valued functions.
*Multistatement tableMultistatementtable-valued functions.
 
Scalar functions return a single data value (not a table) with RETURNS clause. Scalar functions can use all scalar data types, with exception of timestamp and user-defined data types.
Line 123:
|title=LanguageManual UDF - Apache Hive - Apache Software Foundation
|work=
|publisher=
|publishe=
|date=26 June 2015}}
</ref> Hive enables developers to create their own custom functions with Java.<ref>
Line 140:
==External links==
*[http://msdn2.microsoft.com/en-us/library/aa258261(SQL.80).aspx Microsoft SQL Server reference for CREATE FUNCTION]
*Visual Basic 2010 Professional/Express
*[http://dev.mysql.com/doc/refman/5.5/en/adding-functions.html MySQL manual section on UDFs]
*[http://pic.dhe.ibm.com/infocenter/db2luw/v10r5/index.jsp?topic=%2Fcom.ibm.db2.luw.sql.ref.doc%2Fdoc%2Fr0000917.html DB2 CREATE FUNCTION statement]