SET_SESSION_CHARSET
Valid For
Extract and Replicat
Description
Use the SET_SESSION_CHARSET
function to set the character set of the user exit. The character set of the user exit session indicates the encoding of any character-based callback structure members that are used between the user exit and the caller process (Extract, data pump, Replicat), including metadata such as (but not limited to):
-
database names and locales
-
table and column names
-
DDL text
-
error messages
-
character-type columns such as
CHAR
andNCHAR
-
date-time and numeric columns that are represented in string form
This function can be called at any time that the user exit has control. When the user exit sets the session character set, it takes effect immediately, and all character values start being converted to the specified set. The recommended place to call this function is with call type EXIT_CALL_START
.
Note:
SET_SESSION_CHARSET
is not thread-safe.
If SET_SESSION_CHARSET
is not called, the session gets set to the default character set of the operating system, which is a predefined enumerated type value in ULIB_CS_DEFAULT
in the ucharset.h
file. When the session character set is a default from ULIB_CS_DEFAULT
, no conversion is performed by Oracle GoldenGate for character-type values that are exchanged between the user exit and the caller process. In addition, the object-name metadata of the database are considered to be the default character set of the operating system. Keep in mind that the default may not be correct.
The character set of the user exit is printed to the report file when the user exit is loaded and when SET_SESSION_CHARSET
is called. If the session character set is ULIB_CS_DEFAULT
, there is a message stating that no column data character-set conversion is being performed.
For more information about globalization support, see Administering Oracle GoldenGate for Windows and UNIX.
Syntax
#include usrdecs.h short result_code; session_def session_charset_def; ERCALLBACK (SET_SESSION_CHARSET, &session_charset_def, &result_code);
Buffer
typedef struct { ULibCharSet session_charset; } session_def;
Input
Output
None
Return Values
EXIT_FN_RET_OK