<?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: [HELP] convert string to short with empty string value in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/HELP-convert-string-to-short-with-empty-string-value/m-p/2248454#M33304</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;in the second case the error is:&lt;BR /&gt;java.lang.NullPointerException&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;This error would be because you've defined the field as a non-nullable short rather than a nullable Short.</description>
    <pubDate>Sun, 04 Jul 2010 02:12:56 GMT</pubDate>
    <dc:creator>alevy</dc:creator>
    <dc:date>2010-07-04T02:12:56Z</dc:date>
    <item>
      <title>[HELP] convert string to short with empty string value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/HELP-convert-string-to-short-with-empty-string-value/m-p/2248446#M33296</link>
      <description>good morning.. 
&lt;BR /&gt;i'm using talend open studio. 
&lt;BR /&gt;i have a problem; i have an output of a map maken in this way: 
&lt;BR /&gt;id | name| numID| address that are for same reasons all string 
&lt;BR /&gt; 
&lt;BR /&gt;i must convert id and numId in short but in same case the input string is empty so when a try to parse in this way: 
&lt;BR /&gt;short.parseShort(numId) 
&lt;BR /&gt; gives an error if you try to convert becuase you have an empty string. 
&lt;BR /&gt;numId could be an imput like "9" or "500" but in same case "".but this case give me the excepction error parse number. 
&lt;BR /&gt;how i have to do ? 
&lt;BR /&gt;thanks in advance</description>
      <pubDate>Sat, 16 Nov 2024 13:22:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/HELP-convert-string-to-short-with-empty-string-value/m-p/2248446#M33296</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T13:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: [HELP] convert string to short with empty string value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/HELP-convert-string-to-short-with-empty-string-value/m-p/2248447#M33297</link>
      <description>short.parseShort(numID.equals("")?"0":numID)</description>
      <pubDate>Fri, 02 Jul 2010 01:08:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/HELP-convert-string-to-short-with-empty-string-value/m-p/2248447#M33297</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2010-07-02T01:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: [HELP] convert string to short with empty string value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/HELP-convert-string-to-short-with-empty-string-value/m-p/2248448#M33298</link>
      <description>no, in this way when the input is "" the output will be 0 but i need to have the same input, nothing, not a number (0)!because then i must insert this number in a db and numID cannot be 0 but can be null or empty. in my case should be empty not 0!</description>
      <pubDate>Fri, 02 Jul 2010 08:04:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/HELP-convert-string-to-short-with-empty-string-value/m-p/2248448#M33298</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-07-02T08:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: [HELP] convert string to short with empty string value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/HELP-convert-string-to-short-with-empty-string-value/m-p/2248449#M33299</link>
      <description>I don't believe there's such a thing as an empty short; it's either a number or null.
&lt;BR /&gt;If you want a null use: numID.equals("")?null:short.parseShort(numID)</description>
      <pubDate>Fri, 02 Jul 2010 08:06:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/HELP-convert-string-to-short-with-empty-string-value/m-p/2248449#M33299</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2010-07-02T08:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: [HELP] convert string to short with empty string value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/HELP-convert-string-to-short-with-empty-string-value/m-p/2248450#M33300</link>
      <description>i have tried in this way but gives error 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MPcz.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157233iD1A564EF62DE3BC2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MPcz.png" alt="0683p000009MPcz.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;i have written in the map either in this way : 
&lt;BR /&gt;(row3.numId.equals(" ") ? null: Short.parseShort(row3.numId)) 
&lt;BR /&gt;either iin this: 
&lt;BR /&gt;(row3.numId.equals("") ? null: Short.parseShort(row3.numId)) 
&lt;BR /&gt;but in the first case the error is: 
&lt;BR /&gt;numberFormatException for input string: " " 
&lt;BR /&gt;at java.lang.NumberFormatException.forInputString(Unknown Source) 
&lt;BR /&gt; at java.lang.Integer.parseInt(Unknown Source) 
&lt;BR /&gt; at java.lang.Short.parseShort(Unknown Source) 
&lt;BR /&gt; at java.lang.Short.parseShort(Unknown Source) 
&lt;BR /&gt; at testmdb.testmodelapg_0_1.testModelApg.tAccessInput_1Process(testModelApg.java:4585) 
&lt;BR /&gt; at testmdb.testmodelapg_0_1.testModelApg.runJobInTOS(testModelApg.java:8327) 
&lt;BR /&gt; at testmdb.testmodelapg_0_1.testModelApg.main(testModelApg.java:8201) 
&lt;BR /&gt;in the second case the error is: 
&lt;BR /&gt;java.lang.NullPointerException 
&lt;BR /&gt; at testmdb.testmodelapg_0_1.testModelApg.tAccessInput_1Process(testModelApg.java:4587) 
&lt;BR /&gt; at testmdb.testmodelapg_0_1.testModelApg.runJobInTOS(testModelApg.java:8327) 
&lt;BR /&gt; at testmdb.testmodelapg_0_1.testModelApg.main(testModelApg.java:8201)</description>
      <pubDate>Fri, 02 Jul 2010 10:50:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/HELP-convert-string-to-short-with-empty-string-value/m-p/2248450#M33300</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-07-02T10:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: [HELP] convert string to short with empty string value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/HELP-convert-string-to-short-with-empty-string-value/m-p/2248451#M33301</link>
      <description>&lt;PRE&gt;(numID == null || numID.iEmpty())?null:short.parseShort(numID)&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Jul 2010 11:02:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/HELP-convert-string-to-short-with-empty-string-value/m-p/2248451#M33301</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-07-02T11:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: [HELP] convert string to short with empty string value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/HELP-convert-string-to-short-with-empty-string-value/m-p/2248452#M33302</link>
      <description>where i put this code? in the t_map?</description>
      <pubDate>Fri, 02 Jul 2010 11:04:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/HELP-convert-string-to-short-with-empty-string-value/m-p/2248452#M33302</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-07-02T11:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: [HELP] convert string to short with empty string value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/HELP-convert-string-to-short-with-empty-string-value/m-p/2248453#M33303</link>
      <description>i have tried but gives an error yet 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MPcz.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157233iD1A564EF62DE3BC2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MPcz.png" alt="0683p000009MPcz.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;java.lang.NumberFormatException: For input string: " " 
&lt;BR /&gt; at java.lang.NumberFormatException.forInputString(Unknown Source) 
&lt;BR /&gt; at java.lang.Integer.parseInt(Unknown Source) 
&lt;BR /&gt; at java.lang.Short.parseShort(Unknown Source) 
&lt;BR /&gt; at java.lang.Short.parseShort(Unknown Source) 
&lt;BR /&gt; at testmdb.testmodelapg_0_1.testModelApg.tAccessInput_1Process(testModelApg.java:4585) 
&lt;BR /&gt; at testmdb.testmodelapg_0_1.testModelApg.runJobInTOS(testModelApg.java:8329) 
&lt;BR /&gt; at testmdb.testmodelapg_0_1.testModelApg.main(testModelApg.java:8203)</description>
      <pubDate>Fri, 02 Jul 2010 11:18:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/HELP-convert-string-to-short-with-empty-string-value/m-p/2248453#M33303</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-07-02T11:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: [HELP] convert string to short with empty string value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/HELP-convert-string-to-short-with-empty-string-value/m-p/2248454#M33304</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;in the second case the error is:&lt;BR /&gt;java.lang.NullPointerException&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;This error would be because you've defined the field as a non-nullable short rather than a nullable Short.</description>
      <pubDate>Sun, 04 Jul 2010 02:12:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/HELP-convert-string-to-short-with-empty-string-value/m-p/2248454#M33304</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2010-07-04T02:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: [HELP] convert string to short with empty string value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/HELP-convert-string-to-short-with-empty-string-value/m-p/2248455#M33305</link>
      <description>Hello chira8,&lt;BR /&gt;when you do:&lt;BR /&gt;(row3.numId.equals(" ") ? null: Short.parseShort(row3.numId))    &lt;BR /&gt;either iin this:&lt;BR /&gt;(row3.numId.equals("") ? null: Short.parseShort(row3.numId))    &lt;BR /&gt;and if numId = "" then due to your first condition, numID is not equal to " " and therefore it will try to parseShort() numId = "", hence the error you get.&lt;BR /&gt;A condition that you could do is :&lt;BR /&gt;if(!row3.numId.equals("") &amp;amp;&amp;amp; !row3.numId.equals(" "))&lt;BR /&gt;Short.parseShort(row3.numId))&lt;BR /&gt;Something around those lines, tell me if it helped!&lt;BR /&gt;Remi</description>
      <pubDate>Mon, 05 Jul 2010 15:29:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/HELP-convert-string-to-short-with-empty-string-value/m-p/2248455#M33305</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-07-05T15:29:22Z</dc:date>
    </item>
  </channel>
</rss>

