When a programming task cannot be accomplished with SQL’s built-in functions, optional solutions include writing a user-defined function in standard C, C++, or Java programming languages to extend a set of available functions.
The C, C++, or Java files can reside on the server or the client. The server calls for the transfer of client-resident files as needed for input requirements for the CREATE or REPLACEFUNCTION request. Source files must be encoded as ASCII (workstation) or EBCDIC (mainframe), regardless of the current session character set. Note, the same transfer protocol is employed when using client-resident files to create user-defined methods (UDMs) and external stored procedures (XSPs).