<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Replicate a column in the BSON format in Qlik Replicate</title>
    <link>https://community.qlik.com/t5/Qlik-Replicate/Replicate-a-column-in-the-BSON-format/m-p/2084888#M6494</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/221686"&gt;@deaconescu&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Thanks for the update.&lt;/P&gt;
&lt;P&gt;What's the data type of column&amp;nbsp;MESSAGEBODY? it should be BLOB type and while you write data to it, use the &lt;STRONG&gt;systools.JSON2BSON&amp;nbsp;&lt;/STRONG&gt;function. then use reverse function&amp;nbsp;&lt;STRONG&gt;systools.BSON2JSON&lt;/STRONG&gt;&amp;nbsp;to decode the BSON while retrieving data from the table. You can troubleshoot the problem within DB2 by query SQLs.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;John.&lt;/P&gt;</description>
    <pubDate>Fri, 16 Jun 2023 15:45:18 GMT</pubDate>
    <dc:creator>john_wang</dc:creator>
    <dc:date>2023-06-16T15:45:18Z</dc:date>
    <item>
      <title>Replicate a column in the BSON format</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Replicate-a-column-in-the-BSON-format/m-p/2081166#M6328</link>
      <description>&lt;P&gt;Hello team ,&lt;/P&gt;
&lt;P&gt;I would like to have your expertise on the below topic :&lt;/P&gt;
&lt;P&gt;We have a table with a column that in the source (DB2) the value of this column is encoded as a BSON .&lt;/P&gt;
&lt;P&gt;On the Qlik replicate , in the output columns list this column is by default set to BLOB .&lt;/P&gt;
&lt;P&gt;As a target it is used MySQL , but this column contains strange characters, which cannot be handled. I understood that in order to see the value we must decode it ,however, I also understood that MySQL it is not supporting BSON type of data.&lt;/P&gt;
&lt;P&gt;Do you think that it is possible for a datatype conversion when replicating in this case ? &amp;nbsp;If yes, what datatype you suggest using from the output columns drop list menu?&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;
&lt;P&gt;Ionut Deaconescu&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 13:28:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Replicate-a-column-in-the-BSON-format/m-p/2081166#M6328</guid>
      <dc:creator>deaconescu</dc:creator>
      <dc:date>2023-06-07T13:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: Replicate a column in the BSON format</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Replicate-a-column-in-the-BSON-format/m-p/2081363#M6342</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/221686"&gt;@deaconescu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I looked into this but so far have not found a readily available solution. I could not find any SQLite function that would convert BSON to another format. SQLlite is the internal database Qlik Replicate uses.&lt;/P&gt;
&lt;P&gt;I found this link at MySQL's website, but I am not sure how relevant or useful it is, as I am not aware of how we could utilize this from within Replicate:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-utilities-json-bson.html" target="_blank"&gt;MySQL :: MySQL Shell 8.0 :: 11.2.4 Conversions for Representations of BSON Data Types&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;As I have not found a similar request / solution in our support database, you may need to engage with our Professional Services team to arrive at a solution.&lt;/P&gt;
&lt;P&gt;Sorry I could not be of more help.&lt;/P&gt;
&lt;P&gt;Dana&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 22:02:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Replicate-a-column-in-the-BSON-format/m-p/2081363#M6342</guid>
      <dc:creator>Dana_Baldwin</dc:creator>
      <dc:date>2023-06-07T22:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Replicate a column in the BSON format</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Replicate-a-column-in-the-BSON-format/m-p/2081696#M6364</link>
      <description>&lt;P&gt;One potential solution folks might consider would be to write a user defined function - documented by example in :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;C:\Program Files\Attunity\Replicate\addons&lt;/STRONG&gt; notably file &lt;STRONG&gt;README&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;However...&amp;nbsp; LOBS are NOT supported as arguments, so that dog won't hunt. At least not in version 7 and before. Maybe a feature request can be made, but I believe there to be too many technical challenges to implement this.&lt;/P&gt;
&lt;P&gt;Hein.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 13:30:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Replicate-a-column-in-the-BSON-format/m-p/2081696#M6364</guid>
      <dc:creator>Heinvandenheuvel</dc:creator>
      <dc:date>2023-06-08T13:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: Replicate a column in the BSON format</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Replicate-a-column-in-the-BSON-format/m-p/2081756#M6373</link>
      <description>&lt;P&gt;Thank you both for looking into this.&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Ionut Deaconescu&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 14:35:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Replicate-a-column-in-the-BSON-format/m-p/2081756#M6373</guid>
      <dc:creator>deaconescu</dc:creator>
      <dc:date>2023-06-08T14:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: Replicate a column in the BSON format</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Replicate-a-column-in-the-BSON-format/m-p/2081834#M6380</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/221686"&gt;@deaconescu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you would like to pursue a feature request related to this, you can submit it directly to our Product Management team here:&amp;nbsp;&lt;A href="https://community.qlik.com/t5/Ideas/idb-p/qlik-ideas" target="_blank"&gt;https://community.qlik.com/t5/Ideas/idb-p/qlik-ideas&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Dana&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 18:00:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Replicate-a-column-in-the-BSON-format/m-p/2081834#M6380</guid>
      <dc:creator>Dana_Baldwin</dc:creator>
      <dc:date>2023-06-08T18:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Replicate a column in the BSON format</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Replicate-a-column-in-the-BSON-format/m-p/2082294#M6390</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/221686"&gt;@deaconescu&lt;/a&gt;&amp;nbsp;, copy&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/121014"&gt;@Dana_Baldwin&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/110970"&gt;@Heinvandenheuvel&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;BSON&amp;nbsp;column in DB2 is defined as BLOB data type too, however it stores BSON values. I'm lucky to find a way to support the BSON replication from DB2 LUW to MySQL. Essentially, I'm using source_lookup() function to convert the BLOB JSON values to TEXT JSON and replicate it to MySQL, both Full Load and CDC works fine. Below are the steps demo how it works:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1. In DB2 LUW 11.5 defined source table and put one demo row&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;CREATE TABLE johnw.testbson(id integer NOT NULL PRIMARY KEY,name char(20), &lt;STRONG&gt;notes BLOB&lt;/STRONG&gt;);&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;INSERT INTO johnw.testbson VALUES (3,'test',&lt;STRONG&gt;systools.JSON2BSON('{"team-id":2,"team-name": "support"}')&lt;/STRONG&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;SELECT id,name, &lt;EM&gt;&lt;STRONG&gt;systools.BSON2JSON&lt;/STRONG&gt;&lt;/EM&gt;(notes) FROM johnw.TESTBSON;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;ID|NAME&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |3 |&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;--+--------------------+----------------------------------------+&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;3|test&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |{"team-id":2,"team-name":"support"}&amp;nbsp; &amp;nbsp; &amp;nbsp;|&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;2. New a Full Load + CDC enabled task, DB2 LUW 11.5.6 is source endpoint, MySQL 8.0 is target endpoint, in table transformation, add an additional column "NOTESJSON" with expression:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;source_lookup('NO_CACHING','JOHNW','TESTBSON','&lt;EM&gt;&lt;STRONG&gt;systools.BSON2JSON&lt;/STRONG&gt;&lt;/EM&gt;(notes)','id=?',$id)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="john_wang_0-1686325894843.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/109750iFC64856BADC21530/image-size/medium?v=v2&amp;amp;px=400" role="button" title="john_wang_0-1686325894843.png" alt="john_wang_0-1686325894843.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="john_wang_1-1686325909683.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/109751iA4C09D71D679CEE8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="john_wang_1-1686325909683.png" alt="john_wang_1-1686325909683.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;3. Results for both Full Load row and CDC row in SQL Server workbench:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="john_wang_2-1686325996667.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/109752iCAAA0F07DCC7D543/image-size/medium?v=v2&amp;amp;px=400" role="button" title="john_wang_2-1686325996667.png" alt="john_wang_2-1686325996667.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;John.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 15:56:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Replicate-a-column-in-the-BSON-format/m-p/2082294#M6390</guid>
      <dc:creator>john_wang</dc:creator>
      <dc:date>2023-06-09T15:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: Replicate a column in the BSON format</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Replicate-a-column-in-the-BSON-format/m-p/2083194#M6419</link>
      <description>&lt;P&gt;Thank you John for your suggestion ,&lt;/P&gt;
&lt;P&gt;I've asked the team to have a look.&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;
&lt;P&gt;Ionut Deaconescu&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2023 10:29:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Replicate-a-column-in-the-BSON-format/m-p/2083194#M6419</guid>
      <dc:creator>deaconescu</dc:creator>
      <dc:date>2023-06-13T10:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: Replicate a column in the BSON format</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Replicate-a-column-in-the-BSON-format/m-p/2084803#M6487</link>
      <description>&lt;P&gt;Hello John ,&lt;/P&gt;
&lt;P&gt;Team tried to implement your suggestion but run into this error :&lt;/P&gt;
&lt;PRE&gt;Error executing data handler
Cannot read from stream
SQLite general error. Code &amp;lt;250&amp;gt;, Message &amp;lt;unknown error&amp;gt;.
Failed to fetch data for statement 'SELECT systools.BSON2JSON(MESSAGEBODY) FROM ""CONCORDIA"".""OUTBOUNDMESSAGES"" WHERE OUTBOUNDMESSAGESID=?'
RetCode: SQL_ERROR  SqlState: 22546 NativeError: -443 Message: [IBM][CLI Driver][DB2/LINUXX8664] SQL0443N  Routine ""SYSTOOLS.BSON2JSON"" (specific name ""BSON2JSON"") has returned an error SQLSTATE with diagnostic text ""Invalid binary format."".  SQLSTATE=22546&lt;/PRE&gt;
&lt;P&gt;Any suggestion how we can move forward ?&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;
&lt;P&gt;Ionut Deaconescu&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2023 12:54:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Replicate-a-column-in-the-BSON-format/m-p/2084803#M6487</guid>
      <dc:creator>deaconescu</dc:creator>
      <dc:date>2023-06-16T12:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: Replicate a column in the BSON format</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Replicate-a-column-in-the-BSON-format/m-p/2084888#M6494</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/221686"&gt;@deaconescu&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Thanks for the update.&lt;/P&gt;
&lt;P&gt;What's the data type of column&amp;nbsp;MESSAGEBODY? it should be BLOB type and while you write data to it, use the &lt;STRONG&gt;systools.JSON2BSON&amp;nbsp;&lt;/STRONG&gt;function. then use reverse function&amp;nbsp;&lt;STRONG&gt;systools.BSON2JSON&lt;/STRONG&gt;&amp;nbsp;to decode the BSON while retrieving data from the table. You can troubleshoot the problem within DB2 by query SQLs.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;John.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2023 15:45:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Replicate-a-column-in-the-BSON-format/m-p/2084888#M6494</guid>
      <dc:creator>john_wang</dc:creator>
      <dc:date>2023-06-16T15:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: Replicate a column in the BSON format</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Replicate-a-column-in-the-BSON-format/m-p/2090723#M6632</link>
      <description>&lt;P&gt;Hello John ,&lt;/P&gt;
&lt;P&gt;Apologize for late replying ( for the last 2 weeks I was in vacation ).&lt;/P&gt;
&lt;P&gt;In my absence , team , using you suggestion , manged to solve this issue.&lt;/P&gt;
&lt;P&gt;Thanks a lot .&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Ionut Deaconescu&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2023 13:16:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Replicate-a-column-in-the-BSON-format/m-p/2090723#M6632</guid>
      <dc:creator>deaconescu</dc:creator>
      <dc:date>2023-07-05T13:16:48Z</dc:date>
    </item>
    <item>
      <title>Re: Replicate a column in the BSON format</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Replicate-a-column-in-the-BSON-format/m-p/2090730#M6633</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/221686"&gt;@deaconescu&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;No worries! I'm glad to hear the problem was solved.&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;John.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2023 13:38:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Replicate-a-column-in-the-BSON-format/m-p/2090730#M6633</guid>
      <dc:creator>john_wang</dc:creator>
      <dc:date>2023-07-05T13:38:03Z</dc:date>
    </item>
  </channel>
</rss>

