<?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: How to call a routine in query in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-call-a-routine-in-query/m-p/2375600#M137991</link>
    <description>&lt;P&gt;Try this....&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;"SELECT TABLENAME.Something
FROM TABLENAME
WHERE TABLENAME.Something &amp;gt; " + routines.classname.methodName() + " 
ORDER BY TABLENAME.Something ASC"&lt;/PRE&gt; 
&lt;P&gt;Routines are just classes. The package is "routines", the class name is the routine name and then you have the method name. I'm assuming your method is returning a number (as a string or an int), so it can be expressed as above.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The best way to test dynamically created SQL is to create it in a tJava and output to the console using a System.out call. This will allow you to see what you are generating and test it in a SQL query analyzer.&lt;/P&gt;</description>
    <pubDate>Mon, 11 Jun 2018 16:21:03 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-06-11T16:21:03Z</dc:date>
    <item>
      <title>How to call a routine in query</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-call-a-routine-in-query/m-p/2375598#M137989</link>
      <description>&lt;P&gt;Hello, I want to perform a select request on an access database like this:&lt;/P&gt;
&lt;P&gt;"SELECT TABLENAME.Something&lt;/P&gt;
&lt;P&gt;FROM TABLENAME&lt;/P&gt;
&lt;P&gt;WHERE TABLENAME.Something &amp;gt; routineName()&lt;/P&gt;
&lt;P&gt;ORDER BY TABLENAME.Something ASC"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've tried different return type (string and integer) routines and syntaxes like:&lt;/P&gt;
&lt;P&gt;"...&amp;gt;"+ routineWhoReturnAString() +"ORDER BY..."&lt;/P&gt;
&lt;P&gt;but i always get a null pointer exception or an invalid schema name exception.&lt;/P&gt;
&lt;P&gt;Thank you !!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EDIT : My nullpointereexception comes from a condition in an "if" link even though it was said to be an error in the input componant.&lt;/P&gt;
&lt;P&gt;The correct syntax in the query, if the routine returns a String, is:&lt;/P&gt;
&lt;P&gt;"SELECT TABLENAME.Something&lt;/P&gt;
&lt;P&gt;FROM TABLENAME&lt;/P&gt;
&lt;P&gt;WHERE TABLENAME.Something &amp;gt;&amp;nbsp;"+ class.method() +"&lt;/P&gt;
&lt;P&gt;ORDER BY &lt;SPAN&gt;TABLENAME.&lt;/SPAN&gt;Something ASC"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE: Using a global variable works great too.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 16:11:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-call-a-routine-in-query/m-p/2375598#M137989</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-06-11T16:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to call a routine in query</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-call-a-routine-in-query/m-p/2375599#M137990</link>
      <description>&lt;P&gt;I'm afraid you need to put the routine's result into a global variable, then reuse this variable into your query&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 16:17:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-call-a-routine-in-query/m-p/2375599#M137990</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2018-06-11T16:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to call a routine in query</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-call-a-routine-in-query/m-p/2375600#M137991</link>
      <description>&lt;P&gt;Try this....&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;"SELECT TABLENAME.Something
FROM TABLENAME
WHERE TABLENAME.Something &amp;gt; " + routines.classname.methodName() + " 
ORDER BY TABLENAME.Something ASC"&lt;/PRE&gt; 
&lt;P&gt;Routines are just classes. The package is "routines", the class name is the routine name and then you have the method name. I'm assuming your method is returning a number (as a string or an int), so it can be expressed as above.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The best way to test dynamically created SQL is to create it in a tJava and output to the console using a System.out call. This will allow you to see what you are generating and test it in a SQL query analyzer.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 16:21:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-call-a-routine-in-query/m-p/2375600#M137991</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-06-11T16:21:03Z</dc:date>
    </item>
  </channel>
</rss>

