<?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: tELTPostgresqlMap and context variables in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tELTPostgresqlMap-and-context-variables/m-p/2266789#M45892</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp;Apologies for coming back late as I was busy with my real job and could not do data setup for this scenario.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp;I have created a database in AWS MySQL database where I was able to extract the data with minor changes in the query. Please refer the below screen shots for details.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Job execution output" style="width: 933px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M26F.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/145433i8281DFB28CEC11CC/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M26F.png" alt="0683p000009M26F.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Job execution output&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-center" image-alt="Context setup" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M21K.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/152587i374C96FEC4DC9516/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M21K.png" alt="0683p000009M21K.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Context setup&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-center" image-alt="string to date conversion of context variable" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2DK.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/156256i2C33474ED14260EC/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2DK.png" alt="0683p000009M2DK.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;string to date conversion of context variable&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Unfortunately, in my last post, I had overlooked the conversion of data from String to date. Once you convert the context variable to date format, you will be able to execute the query.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;"SELECT id, name, day_column,STR_TO_DATE('"+context.day+ "', '%d/%m/%Y') as day 
FROM test
WHERE day_column &amp;gt;STR_TO_DATE('"+context.day+ "', '%d/%m/%Y')"&lt;/PRE&gt; 
&lt;P&gt;Please note that I am using MySQL for verification. So I have used MySQL functions for String to date conversion. Please refer the below link to get the corresponding PostgreSQL functions and you will have to use&amp;nbsp;to_date&lt;SPAN&gt;(&lt;/SPAN&gt;text&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;text&lt;SPAN&gt;) function for the same.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;A href="https://www.postgresql.org/docs/8.1/functions-formatting.html" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.postgresql.org/docs/8.1/functions-formatting.html&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Hope I have answered your query. Please remember to mark the topic as resolved before signing out for the benefit of our Talend community and Kudos are also welcome &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Warm Regards,&lt;BR /&gt;Nikhil Thampi&lt;/P&gt; 
&lt;P&gt;Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 04 Jan 2019 03:45:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-01-04T03:45:08Z</dc:date>
    <item>
      <title>tELTPostgresqlMap and context variables</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tELTPostgresqlMap-and-context-variables/m-p/2266784#M45887</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;im using Talend Open Studio for Big Data V7.1.1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got a tELTPostgresqlMap which is getting data from some tELTPostgresqlInputs.&lt;/P&gt;&lt;P&gt;I want to join these inputs with the help of context variables which get set before.&lt;/P&gt;&lt;P&gt;Also i want to use a context variable for where clauses.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The context variable always gets escaped and queries break.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any way to actually use context variables as column values or for joins/where ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 06:57:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tELTPostgresqlMap-and-context-variables/m-p/2266784#M45887</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T06:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: tELTPostgresqlMap and context variables</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tELTPostgresqlMap-and-context-variables/m-p/2266785#M45888</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp;Did you print the output of context variables and&amp;nbsp;verified&amp;nbsp;whether they are having values loaded before running this step?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp;I would also suggest to give the column values directly without unwanted escape characters and double quotes.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Warm Regards,&lt;BR /&gt;Nikhil Thampi&lt;/P&gt; 
&lt;P&gt;Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jan 2019 16:56:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tELTPostgresqlMap-and-context-variables/m-p/2266785#M45888</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-01-02T16:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: tELTPostgresqlMap and context variables</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tELTPostgresqlMap-and-context-variables/m-p/2266786#M45889</link>
      <description>Hi,
&lt;BR /&gt;
&lt;BR /&gt;the values are set and correct.
&lt;BR /&gt;I'm not Sure what you mean with
&lt;BR /&gt;
&lt;BR /&gt;I would also suggest to give the column values directly without unwanted escape characters and double quotes.
&lt;BR /&gt;
&lt;BR /&gt;I did not quote anything</description>
      <pubDate>Wed, 02 Jan 2019 17:13:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tELTPostgresqlMap-and-context-variables/m-p/2266786#M45889</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-01-02T17:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: tELTPostgresqlMap and context variables</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tELTPostgresqlMap-and-context-variables/m-p/2266787#M45890</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; You have currently given the details as shown below.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 819px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2Cg.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/147265iED046BBC9B03C6AE/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2Cg.png" alt="0683p000009M2Cg.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Could you please try as shown below?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;"SELECT column1,"+context.day+" FROM
 test t1
WHERE t1.day_column &amp;gt; "+context.day&lt;/PRE&gt; 
&lt;P&gt;Warm Regards,&lt;BR /&gt;Nikhil Thampi&lt;/P&gt; 
&lt;P&gt;Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2019 04:41:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tELTPostgresqlMap-and-context-variables/m-p/2266787#M45890</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-01-03T04:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: tELTPostgresqlMap and context variables</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tELTPostgresqlMap-and-context-variables/m-p/2266788#M45891</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;not sure how to do this as the context in a tPostgresqlmap always gets escaped by talend. &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Also if in the final select the context value is in double quotes it is handled as column name and wont work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got it working for string fields by using single quotes but its not working on string fields&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;invalid input syntax for integer: ""123432423456""&lt;BR /&gt;&lt;BR /&gt;In the select the field looks like this:&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN&gt;'"5324324678"'&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Jan 2019 06:57:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tELTPostgresqlMap-and-context-variables/m-p/2266788#M45891</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-01-03T06:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: tELTPostgresqlMap and context variables</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tELTPostgresqlMap-and-context-variables/m-p/2266789#M45892</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp;Apologies for coming back late as I was busy with my real job and could not do data setup for this scenario.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp;I have created a database in AWS MySQL database where I was able to extract the data with minor changes in the query. Please refer the below screen shots for details.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Job execution output" style="width: 933px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M26F.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/145433i8281DFB28CEC11CC/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M26F.png" alt="0683p000009M26F.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Job execution output&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-center" image-alt="Context setup" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M21K.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/152587i374C96FEC4DC9516/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M21K.png" alt="0683p000009M21K.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Context setup&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-center" image-alt="string to date conversion of context variable" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2DK.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/156256i2C33474ED14260EC/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2DK.png" alt="0683p000009M2DK.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;string to date conversion of context variable&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Unfortunately, in my last post, I had overlooked the conversion of data from String to date. Once you convert the context variable to date format, you will be able to execute the query.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;"SELECT id, name, day_column,STR_TO_DATE('"+context.day+ "', '%d/%m/%Y') as day 
FROM test
WHERE day_column &amp;gt;STR_TO_DATE('"+context.day+ "', '%d/%m/%Y')"&lt;/PRE&gt; 
&lt;P&gt;Please note that I am using MySQL for verification. So I have used MySQL functions for String to date conversion. Please refer the below link to get the corresponding PostgreSQL functions and you will have to use&amp;nbsp;to_date&lt;SPAN&gt;(&lt;/SPAN&gt;text&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;text&lt;SPAN&gt;) function for the same.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;A href="https://www.postgresql.org/docs/8.1/functions-formatting.html" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.postgresql.org/docs/8.1/functions-formatting.html&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Hope I have answered your query. Please remember to mark the topic as resolved before signing out for the benefit of our Talend community and Kudos are also welcome &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Warm Regards,&lt;BR /&gt;Nikhil Thampi&lt;/P&gt; 
&lt;P&gt;Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 03:45:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tELTPostgresqlMap-and-context-variables/m-p/2266789#M45892</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-01-04T03:45:08Z</dc:date>
    </item>
  </channel>
</rss>

