<?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 Replicate Transformation: Source Lookup - CLOB datatype - limitations on string functions in Official Support Articles</title>
    <link>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Replicate-Transformation-Source-Lookup-CLOB-datatype/ta-p/1987353</link>
    <description>&lt;P&gt;CLOB data types have a limitation in that no string functions can be performed on them in a field transformation. There will be no errors in the log file, just that the field will be NULL.&lt;/P&gt;
&lt;P&gt;In this article, we demonstrate source lookup functions and provide an example of replacing line feeds and carriage returns in LOB.&lt;/P&gt;
&lt;H4 id="toc-hId--514847616"&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Environment&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;LI-PRODUCT title="Qlik Replicate" id="qlikReplicate"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;BR /&gt;Table/Field level transformation&lt;/P&gt;
&lt;H3 id="toc-hId--525350720"&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Field Transformation&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;On our SQL source table, we use the source lookup function under Data Enrichment to retrieve the CLOB field value and then apply a string function (&lt;FONT face="courier new,courier"&gt;replaceChars&lt;/FONT&gt;).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By using the source lookup function on the field, it is returned to the Qlik Replicate task in a form where a string function can be applied.&lt;/P&gt;
&lt;P&gt;For more information on Data Enrichment and the &lt;FONT face="courier new,courier"&gt;source_lookup&lt;/FONT&gt; functions see &lt;A href="https://help.qlik.com/en-US/replicate/Content/Global_Common/Content/SharedEMReplicate/Customize%20Tasks/tasks_expressOther.htm#anchor-6" target="_blank" rel="noopener"&gt;Data Enrichment&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;The general form of the function is as follows:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;source_lookup(TTL,'SCHM','TBL','EXP','COND',COND_PARAMS)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;In our example, we perform the lookup on the MyClob table:&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;source_lookup(1,'DBO','MyClob','MyClob','MyID=?',$MyID)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;We follow up by wrapping the lookup in a &lt;FONT face="courier new,courier"&gt;replacechars&lt;/FONT&gt; function:&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;ReplaceChars(source_lookup(1,'DBO','MyClob','MyClob','MyID=?',$MyID),'L','@')&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Expression Builder.png" style="width: 995px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/117286i76925A31B7FFAED2/image-size/large?v=v2&amp;amp;px=999" role="button" title="Expression Builder.png" alt="Expression Builder.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Breaking up the parameters:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NO_CACHING&lt;/FONT&gt; is important to ensure it keeps changing for each value and doesn’t re-use values&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;DBO&lt;/FONT&gt; is the schema in Oracle&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;MyCLOB&lt;/FONT&gt; is the table&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;MyClob&lt;/FONT&gt; is the field that we want returned&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;MyID=?&lt;/FONT&gt; is the predicate for the lookup&amp;nbsp;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;$MyID&lt;/FONT&gt; is the value from the field we are using in the predicate in place of &lt;FONT face="courier new,courier"&gt;=?&lt;/FONT&gt;&lt;/P&gt;
&lt;BLOCKQUOTE class="quote"&gt;Performing the lookup may impact performance and will need to be tested to see if it meets all of your latency criteria.&amp;nbsp;&lt;/BLOCKQUOTE&gt;
&lt;H4&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Reference screenshots and string examples to demonstrate the results of this exercise on the target table:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;View of the Source DDL and data for MyClob table:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;STRONG&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="source ddl and data for myclob table.png" style="width: 464px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/117288i87FC17C3329D863F/image-dimensions/464x179?v=v2" width="464" height="179" role="button" title="source ddl and data for myclob table.png" alt="source ddl and data for myclob table.png" /&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="source ddl and data fro myclob table image 2.png" style="width: 463px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/117287i654F57B1DA569DD0/image-dimensions/463x154?v=v2" width="463" height="154" role="button" title="source ddl and data fro myclob table image 2.png" alt="source ddl and data fro myclob table image 2.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Target data for MyClob table (NO Transformations):&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="target data for myclob table no transformation.png" style="width: 391px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/117289iDC14C098773537E6/image-dimensions/391x95?v=v2" width="391" height="95" role="button" title="target data for myclob table no transformation.png" alt="target data for myclob table no transformation.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Target data for MyClob table (ReplaceChars() function on MyString and MyClob fields):&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Note: No errors will be displayed in the task log, but null values will be present in the field.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;MyString field transformation: replaceChars($MyClob,'M','@')&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;MyCLOB field transformation: replaceChars($MyClob,'L','@')&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="target data for myclob table with replacechars.png" style="width: 376px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/117291iEA2C45B99974F314/image-dimensions/376x146?v=v2" width="376" height="146" role="button" title="target data for myclob table with replacechars.png" alt="target data for myclob table with replacechars.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Target data for MyClob table (ReplaceChars(SourceLookup) function on MyClob fields):&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Note: You will see that the &lt;FONT face="courier new,courier"&gt;replaceChars&lt;/FONT&gt; function worked.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;MyString field transformation: replaceChars($MyClob,'M','@')&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;MyCLOB field transformation: ReplaceChars(source_lookup(1,'DBO','MyClob','MyClob','MyID=?',$MyID),'L','@')&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="target data for myclob table with replacechars and lookup.png" style="width: 384px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/117292i292BC61B5EE2C622/image-dimensions/384x90?v=v2" width="384" height="90" role="button" title="target data for myclob table with replacechars and lookup.png" alt="target data for myclob table with replacechars and lookup.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can further test different string functions on the Clob field once the source lookup returns the value.&lt;/P&gt;
&lt;H4&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Example:&amp;nbsp;Replace Line Feed and Carriage Returns in LOB&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;ReplaceChars(source_lookup(1,'DBO','table','field','id=?',$id),X'0A','|')&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE class="quote"&gt;&lt;EM&gt;The information in this article is provided as-is and to be used at own discretion. Depending on tool(s) used, customization(s), and/or other factors ongoing support on the solution below may not be provided by Qlik Support.&lt;/EM&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Sep 2023 12:58:55 GMT</pubDate>
    <dc:creator>Michael_Litz</dc:creator>
    <dc:date>2023-09-28T12:58:55Z</dc:date>
    <item>
      <title>Qlik Replicate Transformation: Source Lookup - CLOB datatype - limitations on string functions</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Replicate-Transformation-Source-Lookup-CLOB-datatype/ta-p/1987353</link>
      <description>&lt;P&gt;CLOB data types have a limitation in that no string functions can be performed on them in a field transformation. There will be no errors in the log file, just that the field will be NULL.&lt;/P&gt;
&lt;P&gt;In this article, we demonstrate source lookup functions and provide an example of replacing line feeds and carriage returns in LOB.&lt;/P&gt;
&lt;H4 id="toc-hId--514847616"&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Environment&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;LI-PRODUCT title="Qlik Replicate" id="qlikReplicate"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;BR /&gt;Table/Field level transformation&lt;/P&gt;
&lt;H3 id="toc-hId--525350720"&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Field Transformation&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;On our SQL source table, we use the source lookup function under Data Enrichment to retrieve the CLOB field value and then apply a string function (&lt;FONT face="courier new,courier"&gt;replaceChars&lt;/FONT&gt;).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By using the source lookup function on the field, it is returned to the Qlik Replicate task in a form where a string function can be applied.&lt;/P&gt;
&lt;P&gt;For more information on Data Enrichment and the &lt;FONT face="courier new,courier"&gt;source_lookup&lt;/FONT&gt; functions see &lt;A href="https://help.qlik.com/en-US/replicate/Content/Global_Common/Content/SharedEMReplicate/Customize%20Tasks/tasks_expressOther.htm#anchor-6" target="_blank" rel="noopener"&gt;Data Enrichment&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;The general form of the function is as follows:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;source_lookup(TTL,'SCHM','TBL','EXP','COND',COND_PARAMS)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;In our example, we perform the lookup on the MyClob table:&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;source_lookup(1,'DBO','MyClob','MyClob','MyID=?',$MyID)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;We follow up by wrapping the lookup in a &lt;FONT face="courier new,courier"&gt;replacechars&lt;/FONT&gt; function:&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;ReplaceChars(source_lookup(1,'DBO','MyClob','MyClob','MyID=?',$MyID),'L','@')&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Expression Builder.png" style="width: 995px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/117286i76925A31B7FFAED2/image-size/large?v=v2&amp;amp;px=999" role="button" title="Expression Builder.png" alt="Expression Builder.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Breaking up the parameters:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NO_CACHING&lt;/FONT&gt; is important to ensure it keeps changing for each value and doesn’t re-use values&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;DBO&lt;/FONT&gt; is the schema in Oracle&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;MyCLOB&lt;/FONT&gt; is the table&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;MyClob&lt;/FONT&gt; is the field that we want returned&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;MyID=?&lt;/FONT&gt; is the predicate for the lookup&amp;nbsp;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;$MyID&lt;/FONT&gt; is the value from the field we are using in the predicate in place of &lt;FONT face="courier new,courier"&gt;=?&lt;/FONT&gt;&lt;/P&gt;
&lt;BLOCKQUOTE class="quote"&gt;Performing the lookup may impact performance and will need to be tested to see if it meets all of your latency criteria.&amp;nbsp;&lt;/BLOCKQUOTE&gt;
&lt;H4&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Reference screenshots and string examples to demonstrate the results of this exercise on the target table:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;View of the Source DDL and data for MyClob table:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;STRONG&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="source ddl and data for myclob table.png" style="width: 464px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/117288i87FC17C3329D863F/image-dimensions/464x179?v=v2" width="464" height="179" role="button" title="source ddl and data for myclob table.png" alt="source ddl and data for myclob table.png" /&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="source ddl and data fro myclob table image 2.png" style="width: 463px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/117287i654F57B1DA569DD0/image-dimensions/463x154?v=v2" width="463" height="154" role="button" title="source ddl and data fro myclob table image 2.png" alt="source ddl and data fro myclob table image 2.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Target data for MyClob table (NO Transformations):&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="target data for myclob table no transformation.png" style="width: 391px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/117289iDC14C098773537E6/image-dimensions/391x95?v=v2" width="391" height="95" role="button" title="target data for myclob table no transformation.png" alt="target data for myclob table no transformation.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Target data for MyClob table (ReplaceChars() function on MyString and MyClob fields):&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Note: No errors will be displayed in the task log, but null values will be present in the field.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;MyString field transformation: replaceChars($MyClob,'M','@')&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;MyCLOB field transformation: replaceChars($MyClob,'L','@')&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="target data for myclob table with replacechars.png" style="width: 376px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/117291iEA2C45B99974F314/image-dimensions/376x146?v=v2" width="376" height="146" role="button" title="target data for myclob table with replacechars.png" alt="target data for myclob table with replacechars.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Target data for MyClob table (ReplaceChars(SourceLookup) function on MyClob fields):&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Note: You will see that the &lt;FONT face="courier new,courier"&gt;replaceChars&lt;/FONT&gt; function worked.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;MyString field transformation: replaceChars($MyClob,'M','@')&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;MyCLOB field transformation: ReplaceChars(source_lookup(1,'DBO','MyClob','MyClob','MyID=?',$MyID),'L','@')&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="target data for myclob table with replacechars and lookup.png" style="width: 384px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/117292i292BC61B5EE2C622/image-dimensions/384x90?v=v2" width="384" height="90" role="button" title="target data for myclob table with replacechars and lookup.png" alt="target data for myclob table with replacechars and lookup.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can further test different string functions on the Clob field once the source lookup returns the value.&lt;/P&gt;
&lt;H4&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Example:&amp;nbsp;Replace Line Feed and Carriage Returns in LOB&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;ReplaceChars(source_lookup(1,'DBO','table','field','id=?',$id),X'0A','|')&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE class="quote"&gt;&lt;EM&gt;The information in this article is provided as-is and to be used at own discretion. Depending on tool(s) used, customization(s), and/or other factors ongoing support on the solution below may not be provided by Qlik Support.&lt;/EM&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 12:58:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Replicate-Transformation-Source-Lookup-CLOB-datatype/ta-p/1987353</guid>
      <dc:creator>Michael_Litz</dc:creator>
      <dc:date>2023-09-28T12:58:55Z</dc:date>
    </item>
  </channel>
</rss>

