3.43 GET_USER_TOKEN_VALUE
Valid For
Extract and Replicat
Description
Use the GET_USER_TOKEN_VALUE
function to obtain the value of a user token from a trail record. No character-set conversion is performed on the token value.
Syntax
#include "usrdecs.h"
Buffer
typedef struct { char *token_name; char *token_value; long max_length; long actual_length; short value_truncated; } token_value_def;
Input
-
token_name
-
A pointer to a buffer representing the name of a token. It is assumed that the token name is encoded in the default character set of the operating system that hosts the Extract
TABLE
statement where the token is configured. The user exit prepares the token name in the character set that is specified withSET_SESSION_CHARSET
, but converts it back to the operating system character set before retrieving the matching token value. -
max_length
-
The maximum length of your allocated
token_name
buffer to accept any resulting token value. This is returned as aNULL
terminated string.
Output
-
token_value
-
A pointer to a buffer representing the return value (if any) of a token. The token value is passed back to the user exit as-is, without any character-set conversion.
-
actual_length
-
The actual length of the token value that is returned. A value of
0
is returned if the token is found and there is no value present. -
value_truncated
-
A flag of either
0
or1
that indicates whether or not the token value was truncated. Truncation occurs if the length of the table name plus the null terminator exceeds the maximum buffer length.
Return Values
EXIT_FN_RET_INVALID_PARAM EXIT_FN_RET_INVALID_CONTEXT EXIT_FN_RET_TOKEN_NOT_FOUND EXIT_FN_RET_OK
Parent topic: User Exit Functions