You can use the IBM® Database Add-Ins for Visual Studio to create database functions. A function, also called a user-defined function (UDF), is an extension or addition to the existing built-in functions of SQL in a DB2® database or of SPL in an Informix® Dynamic Server (IDS) database.
You can register functions to a database in the SYSCAT.FUNCTIONS catalog by
using the CREATE FUNCTION statement. For DB2® for z/OS®,
functions are registered in the SYSIBM.SYSROUTINES catalog. Functions are never
part of the SYSIBM schema. One such set of functions is provided with DB2 in a
schema called SYSFUN. After you define a function to DB2, you can refer to it
in SQL statements.
With functions, you can extend the function of the database by adding function definitions to be applied in the database engine. By adding functions to the database engine, you can save the effort of retrieving rows from the database and applying similar functions on the retrieved data. Functions provide more synergy between an application and the database. Functions can also contribute to higher productivity for application developers because they encourage code reuse.
The IBM® Database Add-Ins for Visual Studio give you a full development environment for working with functions. You can create the following types of functions with the IBM Database Add-Ins for Visual Studio:
To develop an IBM database function in Visual Studio:
Developing IBM Database Functions | IBM Function Designer