skip to main content
Interface Provider class : IP methods reference : ipGetScalarFunctions
 

ipGetScalarFunctions

This is an optional method you can implement in your IP to register user-defined scalar functions. See example3 in the SDK installation for a sample implementation. The scalar function must be implemented by the IP with the signature as defined by the ipFuncxxx method.
Refer to "User Defined Scalar Functions" in Chapter 4 of the OpenAccess SDK SQL Engine Programmer’s Guide for information on implementing user defined scalar functions.
scalar_functions[] ipGetScalarFunctions()
 
Table 17: Parameters for ipGetScalarFunctions 
Parameter
Type
Description
RETURN
 
 
 
scalar_functions[ ]
An array of scalar_functions used to register user defined scalar functions. The IP class must implement a method for each user defined scalar function and register the method’s name.

Example 

public scalar_function[] ipGetScalarFunctions()
{
scalar_function[] MyFuncs = new scalar_function[5];
 
MyFuncs[0] = new scalar_function
("INTVAL",1,"ip_func_intval",ipc.XO_TYPE_INTEGER,1);
MyFuncs[1] = new scalar_function
("DOUBLEVAL",1,"ip_func_doubleval",ipc.XO_TYPE_DOUBLE,1);
MyFuncs[2] = new scalar_function
("CHARVAL",1,"ip_func_charval",ipc.XO_TYPE_CHAR,200,200,0,1);
MyFuncs[3] = new scalar_function
("INTEGER", "ADD", 1, "ip_func_Integer_add", XO_TYPE_INTEGER,
1);
MyFuncs[4] = new scalar_function
("STRING", "ADD", 1, "ip_func_String_add", XO_TYPE_VARCHAR, 1);
return MyFuncs;
}

See also 

ipFuncxxx