<?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: [resolved] globalMap.get in SQL Builder tas400input in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-globalMap-get-in-SQL-Builder-tas400input/m-p/2276920#M52844</link>
    <description>Should work like this:&lt;BR /&gt;"select&lt;BR /&gt;...&lt;BR /&gt;from...&lt;BR /&gt;where&lt;BR /&gt;...&lt;BR /&gt;and x= +"globalMap.get("year_value")"+&lt;BR /&gt;and y = something&lt;BR /&gt;"&lt;BR /&gt;What is the exact error you are receving?</description>
    <pubDate>Tue, 28 Aug 2012 08:19:05 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-08-28T08:19:05Z</dc:date>
    <item>
      <title>[resolved] globalMap.get in SQL Builder tas400input</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-globalMap-get-in-SQL-Builder-tas400input/m-p/2276919#M52843</link>
      <description>Hi
&lt;BR /&gt;1) In a tSQLServerinput i select one line with a year value (ex : year_value=2011)
&lt;BR /&gt;2) In a tAS400input i would like use this year value to filter directly in the where clause
&lt;BR /&gt;Something like
&lt;BR /&gt;select
&lt;BR /&gt;...
&lt;BR /&gt;from...
&lt;BR /&gt;where
&lt;BR /&gt;...
&lt;BR /&gt;and x=year_value
&lt;BR /&gt;I try to do that with globalMap.get but it doesn't work
&lt;BR /&gt;Is globalMap.get is usefull in a tas400input ?
&lt;BR /&gt;How can i do that by an other way ?
&lt;BR /&gt;Great thx</description>
      <pubDate>Tue, 28 Aug 2012 05:22:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-globalMap-get-in-SQL-Builder-tas400input/m-p/2276919#M52843</guid>
      <dc:creator>cwaras</dc:creator>
      <dc:date>2012-08-28T05:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] globalMap.get in SQL Builder tas400input</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-globalMap-get-in-SQL-Builder-tas400input/m-p/2276920#M52844</link>
      <description>Should work like this:&lt;BR /&gt;"select&lt;BR /&gt;...&lt;BR /&gt;from...&lt;BR /&gt;where&lt;BR /&gt;...&lt;BR /&gt;and x= +"globalMap.get("year_value")"+&lt;BR /&gt;and y = something&lt;BR /&gt;"&lt;BR /&gt;What is the exact error you are receving?</description>
      <pubDate>Tue, 28 Aug 2012 08:19:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-globalMap-get-in-SQL-Builder-tas400input/m-p/2276920#M52844</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-08-28T08:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] globalMap.get in SQL Builder tas400input</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-globalMap-get-in-SQL-Builder-tas400input/m-p/2276921#M52845</link>
      <description>Hi Saukema
&lt;BR /&gt;And a great thank for answer.
&lt;BR /&gt;I hope you will can help me.
&lt;BR /&gt;I will try to describe better my problem :
&lt;BR /&gt;I work on TOS 5.0.3.
&lt;BR /&gt;You can find the global job picture below.
&lt;BR /&gt;1) i select one line with three columns in a tSQLSErverInput :
&lt;BR /&gt;SELECT KWHODS.ODS_DIM_TEMPS.ID_TEMPS as Temps, 
&lt;BR /&gt;cast(cast(KWHODS.ODS_DIM_TEMPS.ID_ANNEE as int)*10 as varchar(5)) as Annee,
&lt;BR /&gt;cast(cast(KWHODS.ODS_DIM_TEMPS.CD_MOIS as int) as varchar(2)) as Mois
&lt;BR /&gt;FROM KWHODS.ODS_DIM_TEMPS
&lt;BR /&gt;"Temps", "Annee" and "Mois" are all varchar type.
&lt;BR /&gt;2) i link that (main link) with a tSetGlobalVar, you can see the setting in the picture below
&lt;BR /&gt;3) I lnik my tSetGlobalVar with my tAS400Input (on component ok link) and i put this in the SQL Builder of the t1SS400Input:
&lt;BR /&gt;
&lt;BR /&gt;select x, y, z ....
&lt;BR /&gt;from A a
&lt;BR /&gt;where ....
&lt;BR /&gt;and cast(a.REX as varchar(5))=" + (string)globalMap.get("Annee") + "
&lt;BR /&gt;and cast(a.RPERIO as varchar(2))=" + (string)globalMap.get("Mois") + "
&lt;BR /&gt;--&amp;gt; When i execute i receive the error :
&lt;BR /&gt;Exception in component tAS400Input_1
&lt;BR /&gt;java.sql.SQLException: Elément syntaxique ANNEE n'est pas correct. Eléments possibles : FOR SKIP WITH FETCH ORDER UNION EXCEPT OPTIMIZE.
&lt;BR /&gt; at com.ibm.as400.access.JDError.throwSQLException(JDError.java:650)
&lt;BR /&gt; at com.ibm.as400.access.JDError.throwSQLException(JDError.java:621)
&lt;BR /&gt; at com.ibm.as400.access.AS400JDBCStatement.commonPrepare(AS400JDBCStatement.java:1578)
&lt;BR /&gt; at com.ibm.as400.access.AS400JDBCStatement.executeQuery(AS400JDBCStatement.java:2136)
&lt;BR /&gt; at kwh.copy_of_copy_of_load_fai_axfile_fca200j2_ods_b_1_0.Copy_of_Copy_of_Load_Fai_Axfile_FCA200J2_ODS_b.tAS400Input_1Process(Copy_of_Copy_of_Load_Fai_Axfile_FCA200J2_ODS_b.java:2496)
&lt;BR /&gt; at kwh.copy_of_copy_of_load_fai_axfile_fca200j2_ods_b_1_0.Copy_of_Copy_of_Load_Fai_Axfile_FCA200J2_ODS_b.tMSSqlInput_1Process(Copy_of_Copy_of_Load_Fai_Axfile_FCA200J2_ODS_b.java:788)
&lt;BR /&gt; at kwh.copy_of_copy_of_load_fai_axfile_fca200j2_ods_b_1_0.Copy_of_Copy_of_Load_Fai_Axfile_FCA200J2_ODS_b.runJobInTOS(Copy_of_Copy_of_Load_Fai_Axfile_FCA200J2_ODS_b.java:7519)
&lt;BR /&gt;
&lt;BR /&gt;Without the 2 lines with the globalMap.get the request work without error....
&lt;BR /&gt;What's wrong ????
&lt;BR /&gt;Great great thx for yor help....</description>
      <pubDate>Wed, 29 Aug 2012 00:40:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-globalMap-get-in-SQL-Builder-tas400input/m-p/2276921#M52845</guid>
      <dc:creator>cwaras</dc:creator>
      <dc:date>2012-08-29T00:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] globalMap.get in SQL Builder tas400input</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-globalMap-get-in-SQL-Builder-tas400input/m-p/2276922#M52846</link>
      <description>It looks pretty much ok to me, just a few things I can think of
&lt;BR /&gt;
&lt;BR /&gt;Did you add "" to the complete statement?
&lt;BR /&gt;so
&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;"&lt;BR /&gt;select x, y, z ....&lt;BR /&gt;from A a&lt;BR /&gt;where ....&lt;BR /&gt;and cast(a.REX as varchar(5))=" + (string)globalMap.get("Annee") + "&lt;BR /&gt;and cast(a.RPERIO as varchar(2))=" + (string)globalMap.get("Mois") + "&lt;BR /&gt;"&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;Another suggestion I have is to add the query to the db connection in the repository. I've noticed Talend handles quotes a bit different in some situations with the repository.
&lt;BR /&gt;Do you have a lot of data in ANAEL table? ohterwise you might consider to solve it with a join in the tMap instead of setting global vars.</description>
      <pubDate>Wed, 29 Aug 2012 07:54:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-globalMap-get-in-SQL-Builder-tas400input/m-p/2276922#M52846</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-08-29T07:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] globalMap.get in SQL Builder tas400input</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-globalMap-get-in-SQL-Builder-tas400input/m-p/2276923#M52847</link>
      <description>Well I finally found : 
&lt;BR /&gt;In the SQL Builder pop-up of the tAS400input, the code was good: 
&lt;BR /&gt;a.REX = "+ globalMap.get (" Year ") +" 
&lt;BR /&gt;But look more closely, in the thumbnail view of the query in the main window of the input tAS400 it became this: 
&lt;BR /&gt;a.REX = "/ + globalMap.get (" / Year / ") + /" 
&lt;BR /&gt;By removing the "/" it works .... 
&lt;BR /&gt;Bug or???? 
&lt;BR /&gt;Thank you for your help anyway.</description>
      <pubDate>Thu, 30 Aug 2012 02:11:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-globalMap-get-in-SQL-Builder-tas400input/m-p/2276923#M52847</guid>
      <dc:creator>cwaras</dc:creator>
      <dc:date>2012-08-30T02:11:50Z</dc:date>
    </item>
  </channel>
</rss>

