SET_RECORD_BUFFER
Valid For
Extract and Replicat
Description
Use the SET_RECORD_BUFFER
function for compatibility with user exits, and for complex data record manipulation. This function manipulates the entire record. It is best to modify individual column values, rather than the entire record, because the Oracle GoldenGate internal record formats must be known in order to accurately modify the data record buffer directly. To modify column values, use the SET_COLUMN_VALUE_BY_INDEX
and SET_COLUMN_VALUE_BY_NAME
functions. These functions are sufficient to handle most custom mapping within a user exit.
Syntax
#include "usrdecs.h" short result_code; record_def record; ERCALLBACK (SET_RECORD_BUFFER, &record_def, &result_code);
Buffer
typedef struct { char *table_name; char *buffer; long length; char before_after_ind; short io_type; short record_type; short transaction_ind; int64_t timestamp; exit_ts_str io_datetime; short mapped; short source_or_target; /* Version 2 CALLBACK_STRUCT_VERSION */ char requesting_before_after_ind; } record_def;
Input
-
buffer
-
A pointer to the new record buffer. Typically,
buffer
is a pointer to a buffer of typeexit_rec_buf_def
. Theexit_rec_buf_def
buffer contains the actual record about to be processed by Extract or Replicat. The buffer is supplied when the call type isEXIT_CALL_DISCARD_RECORD
. Exit routines can change the contents of this buffer, for example to perform custom mapping functions.The content of the record buffer is not converted to or from the character set of the user exit. It is passed as-is.
-
length
-
The new length of the record buffer.
Output
None
Return Values
EXIT_FN_RET_INVALID_CONTEXT EXIT_FN_RET_INVALID_PARAM EXIT_FN_RET_OK EXIT_FN_RET_NOT_SUPPORTED
Parent topic: User Exit Functions