A scalar function should implement the processing method computeValue, in addition to those related to custom context, in the following structure:
struct UdfScalarFunctionPointers { void* customContext; void (*releaseCustomContext)( void* customContext ); SqlmrErrorH (*computeValue)( SqlmrTaskContextH taskContext, void* customContext, SqlmrRowViewH input, SqlmrValueHolderH outValueHolder ) SQLMR_ERROR_RESULT; };
The following table describes the member variables or methods used in the structure above:
Member Name | Type | Description |
---|---|---|
customContext | variable | Points to a space that stores value for the argument clauses to the scalar function, or information about input data type. |
releaseCustomContext | method | Releases the custom context once the task is complete. |
computeValue | method | Performs processing on the given row and emits the result. |