<?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>article Qlik Talend Data Integraion: How to Ingest CLOB Column from DB2 in tDBInput component in Official Support Articles</title>
    <link>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Talend-Data-Integraion-How-to-Ingest-CLOB-Column-from-DB2/ta-p/2520708</link>
    <description>&lt;P&gt;In Talend tDBInput component, &amp;nbsp;CLOB data types can not be handled properly when you are attempting to ingest data from source DB2 to Target one.&lt;/P&gt;
&lt;P&gt;This article briefly introduces how to properly handle CLOB data types when ingesting from DB2 to Target using Talend.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;How To&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;OL&gt;
&lt;LI&gt;Write a Utils class ClobUtils with the method getClobAsString under &lt;STRONG&gt;Code&lt;/STRONG&gt;-&amp;gt; &lt;STRONG&gt;Global Routines&lt;/STRONG&gt;&lt;BR /&gt;You can create your own routines according to your particular factorization needs. &lt;BR /&gt;For more information, please check qlik Help Documentation about: &lt;A href="https://help.qlik.com/talend/en-US/studio-user-guide/8.0-R2025-05/managing-user-routines#creating-user-routines_t" target="_blank" rel="noopener"&gt;Creating user routines&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Use this Utils in tMap/tJavaRow component : &lt;STRONG&gt;ClobUtils.getClobAsString(row1.C1)&lt;/STRONG&gt;&lt;BR /&gt;You can call any function in any of the system and user routines from your Job components in order to run them at the same time as your Job. Please check Help Documentation about: &lt;A style="font-family: inherit; background-color: #ffffff;" href="https://help.qlik.com/talend/en-US/studio-user-guide/8.0-R2025-05/calling-routine-function-from-job" target="_blank" rel="noopener"&gt;Calling-routine-function-from-job&lt;/A&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE class="quote"&gt;The code below is a scratch version that needs testing and rewriting.&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Use this as an example to study:&lt;/P&gt;
&lt;PRE class="ckeditor_codeblock"&gt;==Example code: ===
package routines;
import java.sql.Clob;&lt;BR /&gt;import java.sql.SQLException;&lt;BR /&gt;import java.util.logging.Level;&lt;BR /&gt;import java.util.logging.Logger;&lt;BR /&gt;import org.apache.commons.io.IOUtils;
package routines;
import java.sql.Clob;&lt;BR /&gt;import java.sql.SQLException;&lt;BR /&gt;import java.util.logging.Level;&lt;BR /&gt;import java.util.logging.Logger;&lt;BR /&gt;import org.apache.commons.io.IOUtils;
import java.io.IOException;&lt;BR /&gt;import java.io.InputStream;&lt;BR /&gt;import java.io.StringWriter;&lt;BR /&gt;import java.lang.String;
public class ClobUtils {
&amp;nbsp; &amp;nbsp; public static String getClobAsString(Object obj) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String out = null;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (obj != null &amp;amp;&amp;amp; obj instanceof Clob) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; out=getClobAsString((Clob) obj);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Logger.getLogger("ClobUtils").log(Level.FINE, "null value");&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return out;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; public static String getClobAsString(Clob clobObject) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String clobAsString = null;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (clobObject != null) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; long clobLength;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; clobLength = clobObject.length();
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (clobLength &amp;lt;= Integer.MAX_VALUE) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; clobAsString = clobObject.getSubString(1, (int) clobLength);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; InputStream in = clobObject.getAsciiStream();&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; StringWriter w = new StringWriter();&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; IOUtils.copy(in, w, "UTF-8");&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; clobAsString = w.toString();&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (SQLException e) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.printStackTrace();&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (IOException e) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.printStackTrace();&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return clobAsString;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }&lt;BR /&gt;}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Related Content &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://stackoverflow.com/questions/2169732/most-efficient-solution-for-reading-clob-to-string-and-string-to-clob-in-java" target="_blank" rel="noopener"&gt;https://stackoverflow.com/questions/2169732/most-efficient-solution-for-reading-clob-to-string-and-string-to-clob-in-java&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://www.baeldung.com/java-string-character-large-object-conversion" target="_blank" rel="noopener"&gt;https://www.baeldung.com/java-string-character-large-object-conversion&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H4&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Environment&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;LI-PRODUCT title="Talend Studio" id="qlik_TalendStudio"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;&lt;LI-PRODUCT title="Talend Data Integration" id="qlik_TalendDataIntegration"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;</description>
    <pubDate>Wed, 11 Jun 2025 02:54:54 GMT</pubDate>
    <dc:creator>wei_guo</dc:creator>
    <dc:date>2025-06-11T02:54:54Z</dc:date>
    <item>
      <title>Qlik Talend Data Integraion: How to Ingest CLOB Column from DB2 in tDBInput component</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Talend-Data-Integraion-How-to-Ingest-CLOB-Column-from-DB2/ta-p/2520708</link>
      <description>&lt;P&gt;In Talend tDBInput component, &amp;nbsp;CLOB data types can not be handled properly when you are attempting to ingest data from source DB2 to Target one.&lt;/P&gt;
&lt;P&gt;This article briefly introduces how to properly handle CLOB data types when ingesting from DB2 to Target using Talend.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;How To&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;OL&gt;
&lt;LI&gt;Write a Utils class ClobUtils with the method getClobAsString under &lt;STRONG&gt;Code&lt;/STRONG&gt;-&amp;gt; &lt;STRONG&gt;Global Routines&lt;/STRONG&gt;&lt;BR /&gt;You can create your own routines according to your particular factorization needs. &lt;BR /&gt;For more information, please check qlik Help Documentation about: &lt;A href="https://help.qlik.com/talend/en-US/studio-user-guide/8.0-R2025-05/managing-user-routines#creating-user-routines_t" target="_blank" rel="noopener"&gt;Creating user routines&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Use this Utils in tMap/tJavaRow component : &lt;STRONG&gt;ClobUtils.getClobAsString(row1.C1)&lt;/STRONG&gt;&lt;BR /&gt;You can call any function in any of the system and user routines from your Job components in order to run them at the same time as your Job. Please check Help Documentation about: &lt;A style="font-family: inherit; background-color: #ffffff;" href="https://help.qlik.com/talend/en-US/studio-user-guide/8.0-R2025-05/calling-routine-function-from-job" target="_blank" rel="noopener"&gt;Calling-routine-function-from-job&lt;/A&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE class="quote"&gt;The code below is a scratch version that needs testing and rewriting.&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Use this as an example to study:&lt;/P&gt;
&lt;PRE class="ckeditor_codeblock"&gt;==Example code: ===
package routines;
import java.sql.Clob;&lt;BR /&gt;import java.sql.SQLException;&lt;BR /&gt;import java.util.logging.Level;&lt;BR /&gt;import java.util.logging.Logger;&lt;BR /&gt;import org.apache.commons.io.IOUtils;
package routines;
import java.sql.Clob;&lt;BR /&gt;import java.sql.SQLException;&lt;BR /&gt;import java.util.logging.Level;&lt;BR /&gt;import java.util.logging.Logger;&lt;BR /&gt;import org.apache.commons.io.IOUtils;
import java.io.IOException;&lt;BR /&gt;import java.io.InputStream;&lt;BR /&gt;import java.io.StringWriter;&lt;BR /&gt;import java.lang.String;
public class ClobUtils {
&amp;nbsp; &amp;nbsp; public static String getClobAsString(Object obj) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String out = null;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (obj != null &amp;amp;&amp;amp; obj instanceof Clob) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; out=getClobAsString((Clob) obj);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Logger.getLogger("ClobUtils").log(Level.FINE, "null value");&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return out;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; public static String getClobAsString(Clob clobObject) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String clobAsString = null;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (clobObject != null) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; long clobLength;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; clobLength = clobObject.length();
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (clobLength &amp;lt;= Integer.MAX_VALUE) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; clobAsString = clobObject.getSubString(1, (int) clobLength);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; InputStream in = clobObject.getAsciiStream();&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; StringWriter w = new StringWriter();&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; IOUtils.copy(in, w, "UTF-8");&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; clobAsString = w.toString();&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (SQLException e) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.printStackTrace();&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (IOException e) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.printStackTrace();&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return clobAsString;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }&lt;BR /&gt;}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Related Content &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://stackoverflow.com/questions/2169732/most-efficient-solution-for-reading-clob-to-string-and-string-to-clob-in-java" target="_blank" rel="noopener"&gt;https://stackoverflow.com/questions/2169732/most-efficient-solution-for-reading-clob-to-string-and-string-to-clob-in-java&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://www.baeldung.com/java-string-character-large-object-conversion" target="_blank" rel="noopener"&gt;https://www.baeldung.com/java-string-character-large-object-conversion&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H4&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Environment&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;LI-PRODUCT title="Talend Studio" id="qlik_TalendStudio"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;&lt;LI-PRODUCT title="Talend Data Integration" id="qlik_TalendDataIntegration"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 11 Jun 2025 02:54:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Talend-Data-Integraion-How-to-Ingest-CLOB-Column-from-DB2/ta-p/2520708</guid>
      <dc:creator>wei_guo</dc:creator>
      <dc:date>2025-06-11T02:54:54Z</dc:date>
    </item>
  </channel>
</rss>

