<?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 tMap Sting Manipulation errors in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tMap-Sting-Manipulation-errors/m-p/2340976#M108962</link>
    <description>&lt;P&gt;Hello, Getting my feet wet in TOS, so thanks for any help or pointers. I have successfully connected to several DB's and I am able to define jobs that will move data between DB's as expected. I am now trying to make more use of tMap functions such as StringHandler. Within the tMap editor I have a field called "row1.objek" I want to strip leading zeros off. In the DB's this field is defined as a VARCHAR(18) and in tMap they are defined as Strings in both the input and output. Also, It is not a fixed length padding so there could be 12 leading 0's or 10. The input source is MS SQL Server and the output target is MySQL. If I remove this expression it works fine and will load 46k+ recs into MySQL quickly.&lt;BR /&gt;In this case I have the following expression defined for that field.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt; 
&lt;PRE&gt;StringHandling.LEFT(row1.objek, 1).equals("0")&amp;nbsp;&lt;/PRE&gt; 
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;I have tried this exp on the input schema in tMap editor as well as the output schema. When defined at the input schema row1, the job will run but it will not trim the 0's. On the output schema going into MySQL it will fail at compile time with the following error. I am using the same JRE for everything.&lt;/P&gt; 
&lt;PRE&gt;At least job "MM_IMPORT" has a compile errors, please fix and export again.&lt;BR /&gt;Error Line: 1064&lt;BR /&gt;Detail Message: Type mismatch: cannot convert from boolean to String&lt;BR /&gt;There may be some other errors caused by JVM compatibility. Make sure your JVM setup is similar to the studio.&lt;/PRE&gt; 
&lt;P&gt;&lt;BR /&gt;Apologies for mistaken terminology.&lt;BR /&gt;Regards,&lt;BR /&gt;Pat&lt;/P&gt;</description>
    <pubDate>Thu, 02 Mar 2017 21:39:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-03-02T21:39:15Z</dc:date>
    <item>
      <title>tMap Sting Manipulation errors</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tMap-Sting-Manipulation-errors/m-p/2340976#M108962</link>
      <description>&lt;P&gt;Hello, Getting my feet wet in TOS, so thanks for any help or pointers. I have successfully connected to several DB's and I am able to define jobs that will move data between DB's as expected. I am now trying to make more use of tMap functions such as StringHandler. Within the tMap editor I have a field called "row1.objek" I want to strip leading zeros off. In the DB's this field is defined as a VARCHAR(18) and in tMap they are defined as Strings in both the input and output. Also, It is not a fixed length padding so there could be 12 leading 0's or 10. The input source is MS SQL Server and the output target is MySQL. If I remove this expression it works fine and will load 46k+ recs into MySQL quickly.&lt;BR /&gt;In this case I have the following expression defined for that field.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt; 
&lt;PRE&gt;StringHandling.LEFT(row1.objek, 1).equals("0")&amp;nbsp;&lt;/PRE&gt; 
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;I have tried this exp on the input schema in tMap editor as well as the output schema. When defined at the input schema row1, the job will run but it will not trim the 0's. On the output schema going into MySQL it will fail at compile time with the following error. I am using the same JRE for everything.&lt;/P&gt; 
&lt;PRE&gt;At least job "MM_IMPORT" has a compile errors, please fix and export again.&lt;BR /&gt;Error Line: 1064&lt;BR /&gt;Detail Message: Type mismatch: cannot convert from boolean to String&lt;BR /&gt;There may be some other errors caused by JVM compatibility. Make sure your JVM setup is similar to the studio.&lt;/PRE&gt; 
&lt;P&gt;&lt;BR /&gt;Apologies for mistaken terminology.&lt;BR /&gt;Regards,&lt;BR /&gt;Pat&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2017 21:39:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tMap-Sting-Manipulation-errors/m-p/2340976#M108962</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-02T21:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: tMap Sting Manipulation errors</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tMap-Sting-Manipulation-errors/m-p/2340977#M108963</link>
      <description>I think the error is due to the return type of equals() which is a boolean while you want store a string.</description>
      <pubDate>Thu, 02 Mar 2017 22:51:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tMap-Sting-Manipulation-errors/m-p/2340977#M108963</guid>
      <dc:creator>Rosanero4Ever</dc:creator>
      <dc:date>2017-03-02T22:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: tMap Sting Manipulation errors</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tMap-Sting-Manipulation-errors/m-p/2340978#M108964</link>
      <description>Hi, 
&lt;BR /&gt;This expression tells you if&amp;nbsp; 
&lt;FONT size="2"&gt;&lt;FONT face="consolas," monaco=""&gt;row1.objek&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;starts with 0 or not resulting in true or false (boolean). 
&lt;BR /&gt;If you want to remove leading 0, use replaceAll regex on right side of the tMap, such as 
&lt;BR /&gt; 
&lt;PRE&gt;row1.objek.replaceAll("^0+", "")&lt;/PRE&gt; 
&lt;BR /&gt; which means "replace starting 0s by nothing". 
&lt;BR /&gt;It should work. 
&lt;BR /&gt;Regards, 
&lt;BR /&gt;TRF</description>
      <pubDate>Fri, 03 Mar 2017 08:59:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tMap-Sting-Manipulation-errors/m-p/2340978#M108964</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2017-03-03T08:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: tMap Sting Manipulation errors</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tMap-Sting-Manipulation-errors/m-p/2340979#M108965</link>
      <description>Thanks for the pointers. I will say I tried this a couple different ways, with and without the .equals as well as couple other string functions and each returns the same JVM error. 
&lt;BR /&gt; 
&lt;PRE&gt;StringHandling.LEFT(row1.objek, 1).equals("0")&amp;nbsp;&lt;/PRE&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;But I managed to get it working using the TalendString exp as follows 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;PRE&gt;TalendString.talendTrim(row1.OBJEK,'0',0)&lt;/PRE&gt; 
&lt;BR /&gt;My preference is to use regex pattern matching, but I wanted to get a better handle on the builtin exp/functions in Talend.&amp;nbsp; 
&lt;BR /&gt;Thanks again, 
&lt;BR /&gt;Pat</description>
      <pubDate>Fri, 03 Mar 2017 15:49:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tMap-Sting-Manipulation-errors/m-p/2340979#M108965</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-03T15:49:58Z</dc:date>
    </item>
  </channel>
</rss>

