<?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] Use Context variable in component SQL in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/RESOLVED-Use-Context-variable-in-component-SQL/m-p/2367722#M131068</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you're running your job with log4j debug logs it will print the actual query submitted to the database. From that you could see how the parameters work. There's no variable substitution in talend. The queries are java Strings. So instead of:&lt;/P&gt;&lt;P&gt;"SELECT * FROM [TABLE]" you can use: "SELECT * FROM [" + context.table + "]"&lt;/P&gt;&lt;P&gt;And this will generate the right query. &lt;/P&gt;</description>
    <pubDate>Tue, 21 Sep 2021 07:25:27 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-09-21T07:25:27Z</dc:date>
    <item>
      <title>[RESOLVED] Use Context variable in component SQL</title>
      <link>https://community.qlik.com/t5/Talend-Studio/RESOLVED-Use-Context-variable-in-component-SQL/m-p/2367721#M131067</link>
      <description>&lt;P&gt;Hello Community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get an issue when I use the component tDBInput. I would like to use the context variable in SQL but it's not working.&lt;/P&gt;&lt;P&gt;I need to replace in the SQL the syntax in the clause FROM like :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;SELECT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;"NAV2K9R2-PROD".dbo."CK sa$Purch_ Inv_ Header"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I read on another post to use simple quote but I do not understand how it's work. I still have an error when I write like this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;+&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;context.dbWorkflow_Database&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;+&lt;/P&gt;&lt;P&gt; "&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;+&lt;/P&gt;&lt;P&gt;context.dbNavision1_Schema&lt;/P&gt;&lt;P&gt;+&lt;/P&gt;&lt;P&gt; "&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;" &lt;/P&gt;&lt;P&gt;+&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;context.vPurchInvoice&lt;/P&gt;&lt;P&gt;" &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How is it work in SQL to use context because I have the error 'Invalid object name' or '+' invalid syntax. ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot,&lt;/P&gt;&lt;P&gt;Romain.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 23:42:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/RESOLVED-Use-Context-variable-in-component-SQL/m-p/2367721#M131067</guid>
      <dc:creator>Roman01</dc:creator>
      <dc:date>2024-11-15T23:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: [RESOLVED] Use Context variable in component SQL</title>
      <link>https://community.qlik.com/t5/Talend-Studio/RESOLVED-Use-Context-variable-in-component-SQL/m-p/2367722#M131068</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you're running your job with log4j debug logs it will print the actual query submitted to the database. From that you could see how the parameters work. There's no variable substitution in talend. The queries are java Strings. So instead of:&lt;/P&gt;&lt;P&gt;"SELECT * FROM [TABLE]" you can use: "SELECT * FROM [" + context.table + "]"&lt;/P&gt;&lt;P&gt;And this will generate the right query. &lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 07:25:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/RESOLVED-Use-Context-variable-in-component-SQL/m-p/2367722#M131068</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-21T07:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: [RESOLVED] Use Context variable in component SQL</title>
      <link>https://community.qlik.com/t5/Talend-Studio/RESOLVED-Use-Context-variable-in-component-SQL/m-p/2367723#M131069</link>
      <description>&lt;P&gt;Thank for you reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I have still the error 'Incorrect syntax near '+'' (below attachment ) It seems the SQL doesn't work with double quote or the brackets are not working ?&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000IfoX9AAJ.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/139567i1E6035977E8E1426/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000IfoX9AAJ.jpg" alt="0695b00000IfoX9AAJ.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 11:55:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/RESOLVED-Use-Context-variable-in-component-SQL/m-p/2367723#M131069</guid>
      <dc:creator>Roman01</dc:creator>
      <dc:date>2021-09-21T11:55:12Z</dc:date>
    </item>
  </channel>
</rss>

