This chapter describes how to define functions.
To create a new SQL function, you must provide the DBMS Server with the function definition and function instance definitions that describe the use of the function. To specify the function definition information, you must use the structure IIADD_FO_DFN, described in this chapter.
To define a new function, use the data structure IIADD_FO_DFN, included in the header file, IIADD.H. For the location of this file, see the chapter "Introducing Object Management Extension."
The fields in this structure are as follows:
Specifies the object type. It must contain the constant II_O_OPERATION.
Specifies the name of the function. The name can be up to 32 characters in length and must be a valid database object name. If the name is shorter than 32 characters, the name must be null terminated. For example, if the name is "op," the field must contain "op\0." If the name is 32 characters, omit the null terminator.
Specifies the function number. Function numbers must be greater than or equal to 16384. Function numbers are symbolically identified in the header file by II_OPSTART.
Specifies the type of operation invoked by the function or operator-must contain the value II_NORMAL.