<?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: using sql expression in toracleoutput in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/using-sql-expression-in-toracleoutput/m-p/2310129#M81282</link>
    <description>Thanks for your comments rhall But i am looking for a conditional based insert into the table.
&lt;BR /&gt;"if the status is new then sequence.nextval else put in a predefined value"</description>
    <pubDate>Thu, 25 Jun 2015 06:55:33 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-06-25T06:55:33Z</dc:date>
    <item>
      <title>using sql expression in toracleoutput</title>
      <link>https://community.qlik.com/t5/Talend-Studio/using-sql-expression-in-toracleoutput/m-p/2310127#M81280</link>
      <description>Hi ,
&lt;BR /&gt;I have a scenario where i need to insert dbsquence value into the target table based on certain condition. I have a flat file connected to tmap -&amp;gt; toracleoutput. For the Column Run id i have to populate the value based on the below condition. I tried to add the below in SQL Expression &amp;nbsp;but it is not working&amp;nbsp;
&lt;BR /&gt;"decode("+row1.status+",'NEW',Run_Id.nextval,"+row1.runid+")"
&lt;BR /&gt;is there any other way to achieve this.
&lt;BR /&gt;Thanks&amp;nbsp;
&lt;BR /&gt;VK</description>
      <pubDate>Wed, 24 Jun 2015 17:23:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/using-sql-expression-in-toracleoutput/m-p/2310127#M81280</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-24T17:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: using sql expression in toracleoutput</title>
      <link>https://community.qlik.com/t5/Talend-Studio/using-sql-expression-in-toracleoutput/m-p/2310128#M81281</link>
      <description>Use the Additional Columns section in the Advanced Settings tab. Add a row to the table. Name the column as name of the column you want to overwrite. Put the sequence.nextval call as a string in the SQL Expression. Set the Position to be "replace". Set the Reference Column to be the column you want to set the value for. When you run the Job this column will take the nextval from the sequence.</description>
      <pubDate>Wed, 24 Jun 2015 17:32:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/using-sql-expression-in-toracleoutput/m-p/2310128#M81281</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-24T17:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: using sql expression in toracleoutput</title>
      <link>https://community.qlik.com/t5/Talend-Studio/using-sql-expression-in-toracleoutput/m-p/2310129#M81282</link>
      <description>Thanks for your comments rhall But i am looking for a conditional based insert into the table.
&lt;BR /&gt;"if the status is new then sequence.nextval else put in a predefined value"</description>
      <pubDate>Thu, 25 Jun 2015 06:55:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/using-sql-expression-in-toracleoutput/m-p/2310129#M81282</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-25T06:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: using sql expression in toracleoutput</title>
      <link>https://community.qlik.com/t5/Talend-Studio/using-sql-expression-in-toracleoutput/m-p/2310130#M81283</link>
      <description>OK. You are almost there, but have made a mistake in where and when you asses the change to the SQL. You will receive the value of row1.status in Java. Therefore you need to check the value in Java and build the SQL string using Java. You are checking the value of row1.status using DECODE, an Oracle function. Try doing it at Java time. An example is below....
&lt;BR /&gt;
&lt;PRE&gt;"Select table.column1,&lt;BR /&gt;table.column2,&lt;BR /&gt;table.column3, " +&lt;BR /&gt;(row1.status.compareToIgnoreCase("NEW")==0 ? "sequence.nextval as column4 " : "table.column4 ") + "&lt;BR /&gt;table.column5,&lt;BR /&gt;table.column6&lt;BR /&gt;From table"&lt;/PRE&gt;
&lt;BR /&gt;Something like above should solve your problem.&amp;nbsp;</description>
      <pubDate>Thu, 25 Jun 2015 09:01:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/using-sql-expression-in-toracleoutput/m-p/2310130#M81283</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-25T09:01:10Z</dc:date>
    </item>
  </channel>
</rss>

