<?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: Conditional expression causing errors when not enclosed in opening and closing braces in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Conditional-expression-causing-errors-when-not-enclosed-in/m-p/2287779#M61329</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;The query filed does not support ternary expression, you can define the query on a tJava before tDBInput, eg:&lt;/P&gt;&lt;P&gt;tJava&lt;/P&gt;&lt;P&gt;|onsubjobok&lt;/P&gt;&lt;P&gt;tDBInput--main...&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;on tJava:&lt;/P&gt;&lt;P&gt;if((context.load_type).equalsIgnoreCase("HISTORY")){&lt;/P&gt;&lt;P&gt;context.query="select ln_id, ln_typ from ln_table where 1=1";&lt;/P&gt;&lt;P&gt;}else{&lt;/P&gt;&lt;P&gt;context.query="select ln_id, ln_typ from ln_table where 1=1 and aqsn_dt &amp;lt;= rec_cren_dttm";&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the Query field of tDBInput, set the query as: context.query&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong&lt;/P&gt;</description>
    <pubDate>Tue, 25 Aug 2020 02:33:00 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-08-25T02:33:00Z</dc:date>
    <item>
      <title>Conditional expression causing errors when not enclosed in opening and closing braces</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Conditional-expression-causing-errors-when-not-enclosed-in/m-p/2287778#M61328</link>
      <description>&lt;P&gt;I've the following in tDBInput (Amazon Redshift) - &lt;/P&gt;&lt;P&gt;"select ln_id, ln_typ from ln_table where 1=1" + &lt;/P&gt;&lt;P&gt;&lt;B&gt;(&lt;/B&gt;&lt;/P&gt;&lt;P&gt;(context.load_type).equalsIgnoreCase("HISTORY") ? "" : (" and aqsn_dt &amp;lt;= rec_cren_dttm")&lt;/P&gt;&lt;P&gt;&lt;B&gt;)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;If I do not have the beginning and ending braces after the + sign as shown above, then I get an error in Talend saying - &lt;B&gt;Type mismatch: cannot convert from String to boolean&lt;/B&gt;. What is the need of putting the braces around the whole conditional expression?&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 01:36:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Conditional-expression-causing-errors-when-not-enclosed-in/m-p/2287778#M61328</guid>
      <dc:creator>ksrikanthr</dc:creator>
      <dc:date>2024-11-16T01:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional expression causing errors when not enclosed in opening and closing braces</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Conditional-expression-causing-errors-when-not-enclosed-in/m-p/2287779#M61329</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;The query filed does not support ternary expression, you can define the query on a tJava before tDBInput, eg:&lt;/P&gt;&lt;P&gt;tJava&lt;/P&gt;&lt;P&gt;|onsubjobok&lt;/P&gt;&lt;P&gt;tDBInput--main...&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;on tJava:&lt;/P&gt;&lt;P&gt;if((context.load_type).equalsIgnoreCase("HISTORY")){&lt;/P&gt;&lt;P&gt;context.query="select ln_id, ln_typ from ln_table where 1=1";&lt;/P&gt;&lt;P&gt;}else{&lt;/P&gt;&lt;P&gt;context.query="select ln_id, ln_typ from ln_table where 1=1 and aqsn_dt &amp;lt;= rec_cren_dttm";&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the Query field of tDBInput, set the query as: context.query&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2020 02:33:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Conditional-expression-causing-errors-when-not-enclosed-in/m-p/2287779#M61329</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-25T02:33:00Z</dc:date>
    </item>
  </channel>
</rss>

