skip to main content
OpenAccess SDK SQL Engine Core Functions API : Function Reference : dam_add_scalar
 

dam_add_scalar

This function is called by the IP to add information about each scalar function. Use this function when the SDK calls OAIP_init_scalar to register the custom scalar functions your IP has implemented.
int dam_add_scalar(
XM_Tree * pMemTree,
DAM_HSCALAR_LIST pList,
char * sName,
int iConstantFunc,
int iResXoType,
int iNumInputParams,
dam_scalar_func_type pfScalarFunc)
Table 61. Parameters for dam_add_scalar
Parameter
Type
Description
IN
pMemTree
XM_Tree *
The tree to use for allocating items with xm_allocItem calls.
pList
DAM_HSCALAR_LIST
The list to which scalar function information is to be added.
sName
char *
The name of the scalar function.
iConstantFunc
int
Indicates if the function has constant output or not.
1 - indicates that the function is a constant scalar function and is evaluated only once per query if all its arguments are literal values.
0 - indicates that the function is a variable scalar function and therefore should be evaluated once per record during the dam_isTargetRow call, regardless of the input.
iResXoType
int
The type of the result value of the scalar function.
iNumInputParams
int
The number of arguments expected by the function.
>=0 to allow fixed argument list
< 0 to allow variable argument list with a maximum of |args|
pfScalarFunc
dam_scalar_func_type
The function in the IP that can execute the scalar function. All scalar functions must be exported to allow the OpenAccess SDK SQL engine to call them.
RETURN
int
DAM_SUCCESS - on success.
DAM_FAILURE - on failure

See also

*OAIP_init_scalar
*dam_isTargetRow