User-defined functions (UDFs) are a class of procedures
that return a single value to the calling environment. This section
introduces creating, using, and dropping user-defined functions.
There are four steps required to create and use a UDF:
- Declare the user-defined function using the CREATE
AGGREGATE FUNCTION statement or the CREATE
FUNCTION statement.
- Implement the function entry point(s) in C/C++.
-
Compile the implementation and link it as a shared library.
- Use the function within a SQL statement anywhere that you would use a
built-in SQL function.