On source, insert null into some columns and on target with open post writing out to xml file for Kafka it does not show the column with NULL value for this insert statement.
insert into cdc values(958686,null,33,null);
Result:
<?xml version="1.0" encoding="UTF-8"?>
<?opentarget version="1.1"?>
<opentarget>
<txn id="30842559" msgIdx="1" />
<tbl name="SW.CDC">
<cmd ops="ins">
<row id="AAAE1sAAEAAADJnAAX">
<col name="A">958686</col>
<col name="C">33</col>
</row>
</cmd>
</tbl>
</opentarget>
Expect:
<?xml version="1.0" encoding="UTF-8"?>
<?opentarget version="1.1"?>
<opentarget>
<txn id="30842243" msgIdx="23" />
<tbl name="SW.CDC">
<cmd ops="del">
<row id="AAAE1sAAEAAADJnAAW">
<lkup>
<col name="A">958686</col>
<col name="B"></col>
<col name="C">33</col>
<col name="D"></col>
</lkup>
</row>
</cmd>
</tbl>
</opentarget>
SOLUTION:
On source, set this parameter to 1 and restart capture so that insert statement will include null.
sp_ctrl> set param SP_OCT_INSERT_INCLUDE_NULLS 1
sp_ctrl> stop capture
sp_ctrl> start capture
© ALL RIGHTS RESERVED. Feedback Terms of Use Privacy Cookie Preference Center