8.49 SET_OPERATION_TYPE

Valid For

Extract and Replicat

Description

Use the SET_OPERATION_TYPE function to change the operation type associated with a data record. For example, a delete on a specified table can be turned into an insert into another table. The record header's before/after indicator is modified as appropriate for insert and delete operations.

Syntax

#include "usrdecs.h"
short result_code;
record_def record;
ERCALLBACK (SET_OPERATION_TYPE, &record, &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

io_type

Returned as one of the following for deletes, inserts, and updates, respectively:

DELETE_VAL
INSERT_VAL
UPDATE_VAL

For a compressed SQL update, the following is returned:

UPDATE_COMP_SQL_VAL

If the new operation type is an insert or delete, the before/after indicator for the record is set to one of the following:

Insert: AFTER_IMAGE_VAL (after image)

Delete: BEFORE_IMAGE_VAL (before image)

source_or_target

One of the following indicating whether to set the operation type for the source or target data record.

EXIT_FN_SOURCE_VAL
EXIT_FN_TARGET_VAL

Output

None

Return Values

EXIT_FN_RET_INVALID_CONTEXT
EXIT_FN_RET_INVALID_PARAM
EXIT_FN_RET_OK