<?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] Oracle Sequence current value in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-Oracle-Sequence-current-value/m-p/2330554#M99621</link>
    <description>Hi,
&lt;BR /&gt;Thanks for your reply.
&lt;BR /&gt;according to my knowledge i can get same sequence using seq.currval for that session.In order to get currval i have to first use seq.nextval for that session.(I had same doubt as you so i performed a simple test in oracle DB).
&lt;BR /&gt;I am not hung up on currval i just need same sequence i used to insert that record so i can use it in update query.
&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;select a value from the sequence with &lt;B&gt;seq.nextval&lt;/B&gt; and keep this value in your job for further processing. Anything else is a design flaw!&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;How can i store sequence.nextval in global variable???
&lt;BR /&gt;an example will really help.
&lt;BR /&gt;
&lt;BR /&gt;Thanks,
&lt;BR /&gt;Pankaj</description>
    <pubDate>Fri, 29 May 2015 06:36:29 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-05-29T06:36:29Z</dc:date>
    <item>
      <title>[resolved] Oracle Sequence current value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Oracle-Sequence-current-value/m-p/2330552#M99619</link>
      <description>Hi,
&lt;BR /&gt;I have a table and its primary key is generated with oracle sequence.
&lt;BR /&gt;In my case I am inserting few columns in that table.(I gave sequence in additional columns ... I worked)
&lt;BR /&gt;after few operations on data i need to 
&lt;B&gt;update&lt;/B&gt; few columns on the 
&lt;B&gt;same record.&lt;/B&gt; In order to do that I need current value of oracle_sequence .(as its my primary key)
&lt;BR /&gt;Is that 
&lt;B&gt;possible&lt;/B&gt;???
&lt;BR /&gt;I know i can do it with join.But I need 
&lt;B&gt;current value of oracle_sequence.&lt;/B&gt;
&lt;BR /&gt;when i try "sequence.currval" i get 
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;ORA-00957: duplicate column name &lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;Thanks,
&lt;BR /&gt;Pankaj</description>
      <pubDate>Thu, 28 May 2015 12:53:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Oracle-Sequence-current-value/m-p/2330552#M99619</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-28T12:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Oracle Sequence current value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Oracle-Sequence-current-value/m-p/2330553#M99620</link>
      <description>No this is a very bad idea because you can never be sure anybody else is selecting another value of the sequence.&lt;BR /&gt;The only reliable way is to select a value from the sequence with seq.nextval und keep this value in your job for further processing. Anything else is a design flaw!</description>
      <pubDate>Thu, 28 May 2015 21:45:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Oracle-Sequence-current-value/m-p/2330553#M99620</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-28T21:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Oracle Sequence current value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Oracle-Sequence-current-value/m-p/2330554#M99621</link>
      <description>Hi,
&lt;BR /&gt;Thanks for your reply.
&lt;BR /&gt;according to my knowledge i can get same sequence using seq.currval for that session.In order to get currval i have to first use seq.nextval for that session.(I had same doubt as you so i performed a simple test in oracle DB).
&lt;BR /&gt;I am not hung up on currval i just need same sequence i used to insert that record so i can use it in update query.
&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;select a value from the sequence with &lt;B&gt;seq.nextval&lt;/B&gt; and keep this value in your job for further processing. Anything else is a design flaw!&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;How can i store sequence.nextval in global variable???
&lt;BR /&gt;an example will really help.
&lt;BR /&gt;
&lt;BR /&gt;Thanks,
&lt;BR /&gt;Pankaj</description>
      <pubDate>Fri, 29 May 2015 06:36:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Oracle-Sequence-current-value/m-p/2330554#M99621</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-29T06:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Oracle Sequence current value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Oracle-Sequence-current-value/m-p/2330555#M99622</link>
      <description>If you want to use the sequence for several things inside your job, I would get the next sequence number (as jlolling suggested) using a query against "DUAL". Return that value to the job and use a tSetGlobalVar component to store the value. The tSetGlobalVar will store the value in a global HashMap called "globalMap". You can store values in this using the tSetGlobalVar component or manually using a bit of Java (see below)... 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;PRE&gt;globalMap.put("VariableKey", variable);&lt;/PRE&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;You can retrieve these values practically anywhere in Talend using a variant on the code below.... 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;PRE&gt;((String)globalMap.get("VariableKey"));&lt;/PRE&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;In the example above, we are casting the value to a String as all values are stored as Objects. You will need to cast to whatever type you start with. The "VariableKey" is the name of the value. 
&lt;BR /&gt;This should allow you to retrieve the value once from the sequence and use it as many times as you wish in the Job.&amp;nbsp;</description>
      <pubDate>Fri, 29 May 2015 09:04:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Oracle-Sequence-current-value/m-p/2330555#M99622</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-29T09:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Oracle Sequence current value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Oracle-Sequence-current-value/m-p/2330556#M99623</link>
      <description>Hi,&lt;BR /&gt;how to fire query to DB.what component should i use???&lt;BR /&gt;(I know to to get data from table (i knw toracleinput))&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Pankaj</description>
      <pubDate>Fri, 29 May 2015 10:46:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Oracle-Sequence-current-value/m-p/2330556#M99623</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-29T10:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Oracle Sequence current value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Oracle-Sequence-current-value/m-p/2330557#M99624</link>
      <description>You can use the tOracleInput component for this. Change the query to ....&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;"Select seq.nextval as keyNum&lt;BR /&gt;From DUAL"&lt;/PRE&gt;&lt;BR /&gt;...and make sure you set the schema to be one column of a numeric type</description>
      <pubDate>Fri, 29 May 2015 10:53:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Oracle-Sequence-current-value/m-p/2330557#M99624</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-29T10:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Oracle Sequence current value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Oracle-Sequence-current-value/m-p/2330558#M99625</link>
      <description>Hi, 
&lt;BR /&gt;It worked!! 
&lt;BR /&gt;thanks rhall and jlolling for your help. 
&lt;BR /&gt;regards, 
&lt;BR /&gt;Pankaj</description>
      <pubDate>Fri, 29 May 2015 13:23:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Oracle-Sequence-current-value/m-p/2330558#M99625</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-29T13:23:47Z</dc:date>
    </item>
  </channel>
</rss>

