This section provides an introduction to functions that enable you to access parameter values.
Parameters:
ctx: A context object that contains information about the parameters passed to the UDF.
nd: Indicates which parameter in the context object to get the value of. The first parameter is parameter 0.
Returns: The floating point value of the specified parameter.
Parameters:
ctx: A context object that contains information about the parameters passed to the UDF.
ndx: Indicates which parameter in the context object to get the value of. The first parameter is parameter 0.
Returns: The integer value of the specified parameter.
Parameters:
ctx: A context object that contains information about the parameters passed to the UDF.
ndx: Indicates which parameter in the context object to get the value of. The first parameter is parameter 0.
Returns: The long value of a parameter.
Parameters:
ctx: A context object that contains information about the parameters passed to the UDF.
ndx: Indicates which parameter in the context object to get the value of. The first parameter is parameter 0.
Returns: The C8Char pointer value of the specified parameter. C8Char pointer corresponds to the CCL "STRING" data type. The return value of this accessor function is a pointer to a normal C string (a sequence of ASCII characters terminated with a 0 ('\0'). Note that the server (not the UDF) allocated the memory for this string, and therefore the server (not the UDF) is responsible for freeing the memory for this string. Do not modify or free this string, or change the value of the C8Char pointer (for example, to point to something else).
Parameters:
ctx: A context object that contains information about the parameters passed to the UDF.
ndx: Indicates which parameter in the context object to get the value of. The first parameter is parameter 0.
Returns: The timestamp value of the specified parameter. Sybase CEP timestamps are in microsecond units.
Parameters:
ctx: A context object that contains information about the parameters passed to the UDF.
ndx: Indicates which parameter in the context object to get the value of. The first parameter is parameter 0.
Returns: The interval value of a parameter. Sybase CEP intervals are in microsecond units.
Parameters:
ctx: A context object that contains information about the parameters passed to the UDF.
ndx: Indicates which parameter in the context object to get the value of. The first parameter is parameter 0.
Returns: The boolean value of a parameter. Valid C8Boolean values (C8_TRUE and C8_FALSE) are defined in the c8udf.h file.
Parameters:
ctx: A context object that contains information about the parameters passed to the UDF.
ndx: Indicates which parameter in the context object to get the value of. The first parameter is parameter 0.
Returns: C8_TRUE if a NULL is being passed; C8_FALSE if a non-NULL value is being passed.
Parameters:
ctx: A context object that contains information about the parameters passed to the UDF.
ndx: Indicates which parameter in the context object to get the value of. The first parameter is parameter 0.
Returns: A pointer to a BLOB. The value is a "raw" BLOB (as opposed to a hex string or a base64 string). For an explanation of raw vs. hex string vs. base64 string formats, see Data Types and Subroutines for UDFs and In-process Adapters.
The return value is a pointer. Do not change the memory that the pointer points to, or C8Free() this pointer.
Parameters:
ctx: A context object that contains information about the parameters passed to the UDF.
ndx: Indicates which parameter in the context object to get the value of. The first parameter is parameter 0.
Returns: A pointer to a BLOB in Base64 String format. For an explanation of raw vs. hex string vs. base64 string formats, see Data Types and Subroutines for UDFs and In-process Adapters.
The return value is a pointer. Do not change the memory that the pointer points to, or C8Free() this pointer.
To distinguish between these 2 cases (NULL vs. 0 length), you can do either of the following:
Call C8GetIsNull()C8GetIsNull() to determine whether the BLOB is NULL.
Check whether the pointer returned by C8GetBlob() is 0 (meaning that the BLOB is NULL) or non-zero (meaning that the BLOB is non-NULL).
Parameters:
ctx: A context object that contains information about the parameters passed to the UDF.
ndx: Indicates which parameter in the context object to get the value of.
Returns: The length of the BLOB. If the parameter is not of type BLOB, the server will issue an error message and the return value of the function is undefined.
Parameters:
ctx: A context object that contains information about the parameters passed to the UDF.
ndx: Indicates which parameter in the context object to get the value of.
Returns: A pointer to a copy of the BLOB in HexString format. For an explanation of raw vs. hex string vs. base64 string formats, see Data Types and Subroutines for UDFs and In-process Adapters.
You mustC8Free()the returned pointer or a memory leak will occur.
Parameters:
ctx: A context object that contains information about the parameters passed to the UDF.
ndx: Indicates which parameter in the context object to get the value of. The first parameter is parameter 0.
Returns: A pointer to the XML field as a string.
You mustC8Free()the returned pointer or a memory leak will occur.
After you have evaluated the function, the user should use an output accessor function to return the value to the software. The output accessor functions are:
Parameters:
ctx: A context object that contains information about the parameters passed to the UDF.
value: The value to place.
Returns: Nothing.
Parameters:
ctx: A context object that contains information about the parameters passed to the UDF.
value: The value to place.
Returns: Nothing.
Parameters:
ctx: A context object that contains information about the parameters passed to the UDF.
value: The value to place.
Returns: Nothing.
Parameters:
ctx: A context object that contains information about the parameters passed to the UDF.
value: The value to place.
Returns: Nothing.
Parameters:
ctx: A context object that contains information about the parameters passed to the UDF.
value: The value to place.
Returns: Nothing.
Parameters:
ctx: A context object that contains information about the parameters passed to the UDF.
value: The value to place.
Returns: Nothing.
The second parameter of this function, C8CharPtr, is a STRING. will copy the string to its own internal buffer. You can then free or delete the string as desired. For example, your code might look like:
char *ErrorStr1 = NULL; ErrorStr1 = (char *) malloc(MaxErrorMsgSize); sprintf(ErrorStr1, "Error...", ...); C8SetOutputCharPtr(ctx, (C8CharPtr) ErrorStr1); free(ErrorStr1);
Parameters:
ctx: A context object that contains information about the parameters passed to the UDF.
value: The value to place.
Returns: Nothing.
Parameters:
ctx: A context object that contains information about the parameters passed to the UDF.
blob: The BLOB that you want to return. The BLOB must be a raw BLOB. For an explanation of raw vs. hex string vs. base64 string formats, see Data Types and Subroutines for UDFs and In-process Adapters.
blob_length: The length of the BLOB in bytes.
Returns: Nothing.
Parameters:
ctx: A context object that contains information about the parameters passed to the UDF.
base64_string: The BLOB in Base64 String format that you want to return. For an explanation of raw vs. hex string vs. base64 string formats, see Data Types and Subroutines for UDFs and In-process Adapters.
Returns: Nothing.
Parameters:
ctx: A context object that contains information about the parameters passed to the UDF.
Returns: Nothing.