<?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: Handling nulls for integer columns while creating JSON for tMongoDBOutput in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Handling-nulls-for-integer-columns-while-creating-JSON-for/m-p/2219850#M14485</link>
    <description>&lt;P&gt;The problem is I want to set the database column value to null. Setting it to 0 is not ok, because there are missing values and there are zero values. Setting it to some arbitrarily large negative value has the same problem. I need to know that I don't know.&lt;/P&gt;</description>
    <pubDate>Mon, 01 Oct 2018 18:32:36 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-10-01T18:32:36Z</dc:date>
    <item>
      <title>Handling nulls for integer columns while creating JSON for tMongoDBOutput</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Handling-nulls-for-integer-columns-while-creating-JSON-for/m-p/2219842#M14477</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I am generating the&amp;nbsp;JSON structure to insert to my MongoDB using tMongoDBOutput stage. In the Configure JSON Tree, I have specified attribute "type" as integer for the Integer fields.But the job is failing when&amp;nbsp;NULL values are incoming from the source. My source is a SQL server DB.&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ConfigureJSONTree.JPG" style="width: 833px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lss9.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/136878i6673DBD2F39A6D73/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lss9.jpg" alt="0683p000009Lss9.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="error.JPG" style="width: 488px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Ltk1.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/151731i11A3009A568CB98A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Ltk1.jpg" alt="0683p000009Ltk1.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;Can anyone assist on this please.&lt;/P&gt; 
&lt;P&gt;Thanks,&lt;/P&gt; 
&lt;P&gt;sr&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 09:53:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Handling-nulls-for-integer-columns-while-creating-JSON-for/m-p/2219842#M14477</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T09:53:26Z</dc:date>
    </item>
    <item>
      <title>Re: Handling nulls for integer columns while creating JSON for tMongoDBOutput</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Handling-nulls-for-integer-columns-while-creating-JSON-for/m-p/2219843#M14478</link>
      <description>&lt;P&gt;Sr,&lt;BR /&gt;&lt;BR /&gt;This is a number format exception. which means " "(one space as value) cannot insert this value in integer as it is a string.&lt;BR /&gt;&lt;BR /&gt;Seems you are directly converting a string to Integer. Treat both fields as string then add a tMap after this and apply the below function.&lt;BR /&gt;&lt;BR /&gt;in Tmap target flow define both these fiedls as Integers.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;BR /&gt;row1.EMPID != null ? new Integer(row1.EMPID.trim()) : Integer.valueOf("")&lt;BR /&gt;&lt;BR /&gt;repeat the same for Dept id in expression editor.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks,&lt;BR /&gt;Sid&lt;BR /&gt;Please like the post if it is useful&lt;BR /&gt;Please put to Solved if it resolves your issue.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 15:18:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Handling-nulls-for-integer-columns-while-creating-JSON-for/m-p/2219843#M14478</guid>
      <dc:creator>Sid3</dc:creator>
      <dc:date>2017-04-20T15:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: Handling nulls for integer columns while creating JSON for tMongoDBOutput</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Handling-nulls-for-integer-columns-while-creating-JSON-for/m-p/2219844#M14479</link>
      <description>&lt;P&gt;Thanks for your response. But I have NULL in my input ( like NULL as EmpID from SQL server and outing to an Integer column ) and am creating this JSON tree for MongoDB insert.&amp;nbsp;My Job design is tMSSQLInput-&amp;gt; tMongoDBOutput. The NULL is being converted to "" internally to Job when it tries to convert the input to JSON format.&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;sr&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2017 05:23:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Handling-nulls-for-integer-columns-while-creating-JSON-for/m-p/2219844#M14479</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-04-21T05:23:53Z</dc:date>
    </item>
    <item>
      <title>Re: Handling nulls for integer columns while creating JSON for tMongoDBOutput</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Handling-nulls-for-integer-columns-while-creating-JSON-for/m-p/2219845#M14480</link>
      <description>&lt;P&gt;Do you mean NULL as string or a NULL object. Lot of difference here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if NULL as string then use below logic&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;row1.EMPID != null &amp;amp;&amp;amp; row1.EMPID.equalsIgnoreCase("NULL") ? new Integer(row1.EMPID.trim()) : Integer.valueOf("")&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2017 09:40:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Handling-nulls-for-integer-columns-while-creating-JSON-for/m-p/2219845#M14480</guid>
      <dc:creator>Sid3</dc:creator>
      <dc:date>2017-04-21T09:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: Handling nulls for integer columns while creating JSON for tMongoDBOutput</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Handling-nulls-for-integer-columns-while-creating-JSON-for/m-p/2219846#M14481</link>
      <description>&lt;P&gt;Its NULL as an object&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2017 10:04:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Handling-nulls-for-integer-columns-while-creating-JSON-for/m-p/2219846#M14481</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-04-21T10:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: Handling nulls for integer columns while creating JSON for tMongoDBOutput</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Handling-nulls-for-integer-columns-while-creating-JSON-for/m-p/2219847#M14482</link>
      <description>&lt;P&gt;I am having the same issue, was this ever resolved or a solution found?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2017 19:23:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Handling-nulls-for-integer-columns-while-creating-JSON-for/m-p/2219847#M14482</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-18T19:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: Handling nulls for integer columns while creating JSON for tMongoDBOutput</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Handling-nulls-for-integer-columns-while-creating-JSON-for/m-p/2219848#M14483</link>
      <description>&lt;P&gt;Same problem here&lt;/P&gt;</description>
      <pubDate>Thu, 06 Sep 2018 00:04:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Handling-nulls-for-integer-columns-while-creating-JSON-for/m-p/2219848#M14483</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-09-06T00:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: Handling nulls for integer columns while creating JSON for tMongoDBOutput</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Handling-nulls-for-integer-columns-while-creating-JSON-for/m-p/2219849#M14484</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Have you tried to hand your null object in tMap with ternary operator?&lt;/P&gt;
&lt;P&gt;Best regards&lt;/P&gt;
&lt;P&gt;Sabrina&lt;/P&gt;</description>
      <pubDate>Sun, 30 Sep 2018 10:11:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Handling-nulls-for-integer-columns-while-creating-JSON-for/m-p/2219849#M14484</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-09-30T10:11:45Z</dc:date>
    </item>
    <item>
      <title>Re: Handling nulls for integer columns while creating JSON for tMongoDBOutput</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Handling-nulls-for-integer-columns-while-creating-JSON-for/m-p/2219850#M14485</link>
      <description>&lt;P&gt;The problem is I want to set the database column value to null. Setting it to 0 is not ok, because there are missing values and there are zero values. Setting it to some arbitrarily large negative value has the same problem. I need to know that I don't know.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Oct 2018 18:32:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Handling-nulls-for-integer-columns-while-creating-JSON-for/m-p/2219850#M14485</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-01T18:32:36Z</dc:date>
    </item>
    <item>
      <title>Re: Handling nulls for integer columns while creating JSON for tMongoDBOutput</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Handling-nulls-for-integer-columns-while-creating-JSON-for/m-p/2219851#M14486</link>
      <description>&lt;P&gt;Turns out the way to handle this is to set the value to&lt;/P&gt;
&lt;PRE&gt;net.sf.json.JSONNull.getInstance()&lt;/PRE&gt;
&lt;P&gt;tWriteJson will set it correctly as a JSON null then.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 19:20:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Handling-nulls-for-integer-columns-while-creating-JSON-for/m-p/2219851#M14486</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-17T19:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: Handling nulls for integer columns while creating JSON for tMongoDBOutput</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Handling-nulls-for-integer-columns-while-creating-JSON-for/m-p/2219852#M14487</link>
      <description>&lt;P&gt;where do i need to set this value?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 17:57:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Handling-nulls-for-integer-columns-while-creating-JSON-for/m-p/2219852#M14487</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-18T17:57:41Z</dc:date>
    </item>
  </channel>
</rss>

