...
Section | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Perhaps what needs to be stressed: there is no way to just modify the values and pass them back to apply. If you are not satisfied with the return value options (discard, retry, newer, older), you have to apply the change yourself.
if (!strcmp(result, "4")) return DECISION_FORCE;
if (!strcmp(result, "3")) return DECISION_DONE;
if (!strcmp(result, "2")) return DECISION_RETRY;
if (!strcmp(result, "1")) return DECISION_OVERWRITE;
if (!strcmp(result, "0")) return DECISION_IGNORE;
The function must have prototype:
...
The function must have following prototype:
Section | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
- 0: discard
- 1: overwrite
- 2: retry
- 3: the PL/SQL function resolved the conflict by itself and made all necessary changes.
The function must not issue a commit, as the transaction may be yet rolled back, if a rollback happened on source.
See also Data available to apply sessions for further information available to the handler.
The rec_* contain:
...
Info |
---|
Here, apply_old_data : the values at the target, queried by using key columns in the where clause. The boolean flag indicates whether any such record was found. |
...
primary_key_data: old values at the source; mostly used to see the key, but it actually contains all supplementally logged values, too. Thus it will always (excl. LOBs, LONGs) include the modified column, too. |
...
new_ |
...
data: new (modified) values at the source. |
The return values are:
- 0: discard
- 1: overwrite
- 2: retry
- 3: the PL/SQL function resolved the conflict by itself and made all necessary changes.
The function must not issue a commit, as the transaction may be yet rolled back, if a rollback happened on source.
See also Data available to apply sessions for further information available to the handler.
Note |
---|
It is not possible to pass modified values back to apply. If you are not satisfied with the return value options (discard, retry, newer, older), you have to apply the change manually. |