<?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: Writing null values into database instead of empty strings in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Writing-null-values-into-database-instead-of-empty-strings/m-p/2363430#M127315</link>
    <description>&lt;P&gt;If you are using the suscription version, you can leverage Dynamic schema and do something like that:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Job Overview" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lyan.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/141340iFF16DB98A73FB969/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lyan.png" alt="0683p000009Lyan.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Job Overview&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="File extract" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lyax.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/140168iB59D1427CDB236D4/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lyax.png" alt="0683p000009Lyax.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;File extract&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="File Schema" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lyb7.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/128369i0DE24F70D8F44187/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lyb7.png" alt="0683p000009Lyb7.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;File Schema&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Extract Dynamic Schema" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LyK5.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/143792i7829EB32BBAE075F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LyK5.png" alt="0683p000009LyK5.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Extract Dynamic Schema&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tLog" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LyRh.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/129016i933E5D3CC328C1FF/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LyRh.png" alt="0683p000009LyRh.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;tLog&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The code in the tJavaRow is&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;Dynamic columns = input_row.dyn; //extract Dynamic
 &lt;BR /&gt;//looping on each columns of the row
for (int i = 0; i &amp;lt; columns.getColumnCount(); i++) {  
    DynamicMetadata columnMetadata = columns.getColumnMetadata(i); //extracting metadata 
   &lt;BR /&gt;//if empty then replace by null
    if(columnMetadata.getType().equals("id_String") &amp;amp;&amp;amp; ((String)columns.getColumnValue(i)).isEmpty())
    {
    	columns.setColumnValue(i, null);
    }
}
&lt;BR /&gt;//replacing the stream row by the new updated one
output_row.dyn = columns;&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Jun 2018 05:42:43 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-06-08T05:42:43Z</dc:date>
    <item>
      <title>Writing null values into database instead of empty strings</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Writing-null-values-into-database-instead-of-empty-strings/m-p/2363425#M127310</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I try inserting data from a csv file into a postgres database. In the csv file several cells are empty. In my schema the columns are all nullable.&lt;/P&gt; 
&lt;P&gt;Nevertheless, talend writes empty strings '' into the database instead of null values.&lt;/P&gt; 
&lt;P&gt;Do you have any idea how I can insert null values?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks&lt;/P&gt; 
&lt;P&gt;Hein&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Schema.JPG" style="width: 997px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LrAn.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/130348i98B8256A9EF43BE9/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LrAn.jpg" alt="0683p000009LrAn.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot.JPG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lr7R.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157444i2CD6B6D31F9EEAEA/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lr7R.jpg" alt="0683p000009Lr7R.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 09:14:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Writing-null-values-into-database-instead-of-empty-strings/m-p/2363425#M127310</guid>
      <dc:creator>HeinBloed</dc:creator>
      <dc:date>2024-11-16T09:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: Writing null values into database instead of empty strings</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Writing-null-values-into-database-instead-of-empty-strings/m-p/2363426#M127311</link>
      <description>Hi, 
&lt;BR /&gt; 
&lt;BR /&gt;Please try adding one more component tmap in between both the connectors and for that column alone check for empty string if so then set null, something like 
&lt;BR /&gt;Row1. Field==''? null:row1.field. 
&lt;BR /&gt; 
&lt;BR /&gt;Let me know if above works. 
&lt;BR /&gt;Thanks, 
&lt;BR /&gt;Ram</description>
      <pubDate>Fri, 29 Sep 2017 17:12:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Writing-null-values-into-database-instead-of-empty-strings/m-p/2363426#M127311</guid>
      <dc:creator>brama</dc:creator>
      <dc:date>2017-09-29T17:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: Writing null values into database instead of empty strings</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Writing-null-values-into-database-instead-of-empty-strings/m-p/2363427#M127312</link>
      <description>Don't use == to compare Strings. Use .equals() or in this case .isempty() instead.</description>
      <pubDate>Mon, 02 Oct 2017 16:30:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Writing-null-values-into-database-instead-of-empty-strings/m-p/2363427#M127312</guid>
      <dc:creator>cterenzi</dc:creator>
      <dc:date>2017-10-02T16:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: Writing null values into database instead of empty strings</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Writing-null-values-into-database-instead-of-empty-strings/m-p/2363428#M127313</link>
      <description>&lt;P&gt;Thank you for your quick answers.&lt;/P&gt;&lt;P&gt;I had hoped there was a checkbox or something I missed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But your solution will definitely work.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2017 11:11:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Writing-null-values-into-database-instead-of-empty-strings/m-p/2363428#M127313</guid>
      <dc:creator>HeinBloed</dc:creator>
      <dc:date>2017-10-04T11:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: Writing null values into database instead of empty strings</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Writing-null-values-into-database-instead-of-empty-strings/m-p/2363429#M127314</link>
      <description>&lt;P&gt;hello ,&lt;/P&gt; 
&lt;P&gt;i have one column for monile number and some user not inserted value in that column ..&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;so i wand to replace that value by dot '.'&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2017 11:32:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Writing-null-values-into-database-instead-of-empty-strings/m-p/2363429#M127314</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-04T11:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: Writing null values into database instead of empty strings</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Writing-null-values-into-database-instead-of-empty-strings/m-p/2363430#M127315</link>
      <description>&lt;P&gt;If you are using the suscription version, you can leverage Dynamic schema and do something like that:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Job Overview" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lyan.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/141340iFF16DB98A73FB969/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lyan.png" alt="0683p000009Lyan.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Job Overview&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="File extract" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lyax.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/140168iB59D1427CDB236D4/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lyax.png" alt="0683p000009Lyax.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;File extract&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="File Schema" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lyb7.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/128369i0DE24F70D8F44187/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lyb7.png" alt="0683p000009Lyb7.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;File Schema&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Extract Dynamic Schema" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LyK5.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/143792i7829EB32BBAE075F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LyK5.png" alt="0683p000009LyK5.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Extract Dynamic Schema&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tLog" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LyRh.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/129016i933E5D3CC328C1FF/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LyRh.png" alt="0683p000009LyRh.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;tLog&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The code in the tJavaRow is&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;Dynamic columns = input_row.dyn; //extract Dynamic
 &lt;BR /&gt;//looping on each columns of the row
for (int i = 0; i &amp;lt; columns.getColumnCount(); i++) {  
    DynamicMetadata columnMetadata = columns.getColumnMetadata(i); //extracting metadata 
   &lt;BR /&gt;//if empty then replace by null
    if(columnMetadata.getType().equals("id_String") &amp;amp;&amp;amp; ((String)columns.getColumnValue(i)).isEmpty())
    {
    	columns.setColumnValue(i, null);
    }
}
&lt;BR /&gt;//replacing the stream row by the new updated one
output_row.dyn = columns;&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 05:42:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Writing-null-values-into-database-instead-of-empty-strings/m-p/2363430#M127315</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-06-08T05:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: Writing null values into database instead of empty strings</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Writing-null-values-into-database-instead-of-empty-strings/m-p/2363431#M127316</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;it is also possible to use the "tConvertType" component with the "&lt;U&gt;&lt;SPAN class="emphasis"&gt;Set empty values to Null before converting&lt;/SPAN&gt;&lt;/U&gt;" option between your csv file component and your database component.&lt;/P&gt;&lt;P&gt;It saves a lot of time to me, I hope it will be the same for you !&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 09:57:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Writing-null-values-into-database-instead-of-empty-strings/m-p/2363431#M127316</guid>
      <dc:creator>oballet</dc:creator>
      <dc:date>2018-08-09T09:57:29Z</dc:date>
    </item>
  </channel>
</rss>

