<?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 Oracle sequence to generte ID while writing in file in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Using-Oracle-sequence-to-generte-ID-while-writing-in-file/m-p/2334476#M103142</link>
    <description>I am not writing into the DB, i need a create an output file from an input file...&lt;BR /&gt;here is the scenario,&lt;BR /&gt;1) I have an input file with 500000 records with PersonId blank&lt;BR /&gt;2) Data exists in oracle data base (similar records or with some extra records)&lt;BR /&gt;3) If the file data matches with DB data then i have to get the PersonId from DB record and assign it to the file data&lt;BR /&gt;else i have to use DB sequence to assign PersonId to these records&lt;BR /&gt;4) Output file should contain the existing input file records with PersonId assigned&lt;BR /&gt;</description>
    <pubDate>Fri, 08 Sep 2017 08:02:41 GMT</pubDate>
    <dc:creator>vidya821</dc:creator>
    <dc:date>2017-09-08T08:02:41Z</dc:date>
    <item>
      <title>Using Oracle sequence to generte ID while writing in file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Using-Oracle-sequence-to-generte-ID-while-writing-in-file/m-p/2334467#M103133</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have this requirement wherein input file has below format&lt;/P&gt;&lt;P&gt;Person_ID | Name | DOB&lt;/P&gt;&lt;P&gt;Now, the Person_ID value in the input file can be blank sometimes and so i need to assign Person_ID generated via Oracle sequence,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone please tell me what is best way to call Oracle sequence for this matter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(One way is i can&amp;nbsp;create Code Routine&amp;nbsp;in Talend to call every time when Person_ID is blank or null,&lt;/P&gt;&lt;P&gt;The only thing is i have to open, create and close DB connection in the code everytime it is called )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2017 10:04:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Using-Oracle-sequence-to-generte-ID-while-writing-in-file/m-p/2334467#M103133</guid>
      <dc:creator>vidya821</dc:creator>
      <dc:date>2017-09-07T10:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: Using Oracle sequence to generte ID while writing in file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Using-Oracle-sequence-to-generte-ID-while-writing-in-file/m-p/2334468#M103134</link>
      <description>&lt;P&gt;You can either use a t{database}Input component and just select the next value. Below is the code I use for a MS SQL Server version of this...&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;"SELECT NEXT VALUE FOR "+((String)globalMap.get("sequence"))+" as seqnum" &lt;/PRE&gt; 
&lt;P&gt;....this allows me to select the next value from a dynamically selected sequence.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Alternatively you can use the Additional Columns functionality. This is explained here....&lt;/P&gt; 
&lt;P&gt;&lt;A href="https://community.qlik.com/s/article/ka03p0000006EaOAAU" target="_blank"&gt;https://community.talend.com/t5/Troubleshooting-Development/Using-an-Oracle-sequence-while-inserting-data/ta-p/21700&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2017 10:15:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Using-Oracle-sequence-to-generte-ID-while-writing-in-file/m-p/2334468#M103134</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-07T10:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: Using Oracle sequence to generte ID while writing in file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Using-Oracle-sequence-to-generte-ID-while-writing-in-file/m-p/2334469#M103135</link>
      <description>Hi Rhall,
&lt;BR /&gt;
&lt;BR /&gt;I have to assign the Person_ID in tMap component while generating an output file,
&lt;BR /&gt;in this case how can i use DB input component ?</description>
      <pubDate>Thu, 07 Sep 2017 10:20:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Using-Oracle-sequence-to-generte-ID-while-writing-in-file/m-p/2334469#M103135</guid>
      <dc:creator>vidya821</dc:creator>
      <dc:date>2017-09-07T10:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: Using Oracle sequence to generte ID while writing in file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Using-Oracle-sequence-to-generte-ID-while-writing-in-file/m-p/2334470#M103136</link>
      <description>&lt;P&gt;Use the t{Database}Input as a lookup to the tMap. Set the lookup model to "Reload at each row". This will generate a new ID for every row in the main flow. If you do not want a new ID for every row in the main flow, you will have to put some logic in to ensure the main flow does not include that data. You can have another process to load the ID-less data afterwards or before.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2017 10:27:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Using-Oracle-sequence-to-generte-ID-while-writing-in-file/m-p/2334470#M103136</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-07T10:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: Using Oracle sequence to generte ID while writing in file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Using-Oracle-sequence-to-generte-ID-while-writing-in-file/m-p/2334471#M103137</link>
      <description>&lt;P&gt;Alternatively, you can load all data (regardless of whether it needs an ID or not) through the tMap and use some funky logic in the t{database}Input to identify if the next ID needs to be returned. To do this requires a bit of configuration using the "globalMap key" you will see appearing in the tMap when you set the Lookup Model to "Reload at each row". If you add a boolean there to identify if you need a new ID or not, you can pass the boolean value to your Select query. I have actually used logic similar to this, like below...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(globalMap.get("sequence")!=null ? 
"SELECT NEXT VALUE FOR "+((String)globalMap.get("sequence"))+" as seqnum" 
:
"SELECT null")&lt;/PRE&gt;
&lt;P&gt;In the above example I am checking for the presence of a "sequence" to decide whether I return anything or not.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2017 10:32:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Using-Oracle-sequence-to-generte-ID-while-writing-in-file/m-p/2334471#M103137</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-07T10:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using Oracle sequence to generte ID while writing in file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Using-Oracle-sequence-to-generte-ID-while-writing-in-file/m-p/2334472#M103138</link>
      <description>&lt;P&gt;The logic to avoid use of sequence if the person id already exists - in the lookup table if i use a filter on Main table Person_ID is blank or null and give outer join along with Reload at each row should help rt ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But will this always call sequence irrespective of Main Table Person_ID being blank/null or not and then assign the value to the output Person_ID file ?&lt;/P&gt;&lt;P&gt;If this is case then there is a waste of sequence which is not at all feasbile&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2017 10:33:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Using-Oracle-sequence-to-generte-ID-while-writing-in-file/m-p/2334472#M103138</guid>
      <dc:creator>vidya821</dc:creator>
      <dc:date>2017-09-07T10:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using Oracle sequence to generte ID while writing in file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Using-Oracle-sequence-to-generte-ID-while-writing-in-file/m-p/2334473#M103139</link>
      <description>&lt;P&gt;My second post covered the above scenario&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2017 10:47:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Using-Oracle-sequence-to-generte-ID-while-writing-in-file/m-p/2334473#M103139</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-07T10:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: Using Oracle sequence to generte ID while writing in file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Using-Oracle-sequence-to-generte-ID-while-writing-in-file/m-p/2334474#M103140</link>
      <description>Thanks, this worked.
&lt;BR /&gt;I have one more question
&lt;BR /&gt;when talend component reads the file data using inputfile component then does it loads the data at once in memory or it reads line by line ?
&lt;BR /&gt;
&lt;BR /&gt;I have a situation here,
&lt;BR /&gt;I have to generate an output file but before this file i have to generate the person id for person_id column in the file as per by post subject.
&lt;BR /&gt;
&lt;BR /&gt;There seems to be two ways to do it
&lt;BR /&gt;1) Create a temp file and then perform the operation of assigning person id and write the data in final file
&lt;BR /&gt;or
&lt;BR /&gt;2) before temp file creation, let the data flow to tHashOutput and i can then work on this data and create final file without going for temp file
&lt;BR /&gt;
&lt;BR /&gt;Can you please provide me inputs for this as performance is a major concern here
&lt;BR /&gt;Note: The records processed are around 500000 and may increase in future
&lt;BR /&gt;or any other solution is most welcomed !!
&lt;BR /&gt;
&lt;BR /&gt;Thanks</description>
      <pubDate>Thu, 07 Sep 2017 16:47:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Using-Oracle-sequence-to-generte-ID-while-writing-in-file/m-p/2334474#M103140</guid>
      <dc:creator>vidya821</dc:creator>
      <dc:date>2017-09-07T16:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: Using Oracle sequence to generte ID while writing in file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Using-Oracle-sequence-to-generte-ID-while-writing-in-file/m-p/2334475#M103141</link>
      <description>&lt;P&gt;The DB writes can be done in batches (look at the Advanced tab for options on this).&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I would recommend you avoid writing to a temp file if performance is going to be a concern. In this situation (if I understand you correctly), I would use the tHash components. However, you *may* run into memory issues, so keep that in mind.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2017 16:52:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Using-Oracle-sequence-to-generte-ID-while-writing-in-file/m-p/2334475#M103141</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-07T16:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using Oracle sequence to generte ID while writing in file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Using-Oracle-sequence-to-generte-ID-while-writing-in-file/m-p/2334476#M103142</link>
      <description>I am not writing into the DB, i need a create an output file from an input file...&lt;BR /&gt;here is the scenario,&lt;BR /&gt;1) I have an input file with 500000 records with PersonId blank&lt;BR /&gt;2) Data exists in oracle data base (similar records or with some extra records)&lt;BR /&gt;3) If the file data matches with DB data then i have to get the PersonId from DB record and assign it to the file data&lt;BR /&gt;else i have to use DB sequence to assign PersonId to these records&lt;BR /&gt;4) Output file should contain the existing input file records with PersonId assigned&lt;BR /&gt;</description>
      <pubDate>Fri, 08 Sep 2017 08:02:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Using-Oracle-sequence-to-generte-ID-while-writing-in-file/m-p/2334476#M103142</guid>
      <dc:creator>vidya821</dc:creator>
      <dc:date>2017-09-08T08:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using Oracle sequence to generte ID while writing in file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Using-Oracle-sequence-to-generte-ID-while-writing-in-file/m-p/2334477#M103143</link>
      <description>&lt;P&gt;To be honest, it doesn't matter where you are writing your data, it will be quicker to carry out the intermediary processing in memory rather than writing to a file. Are you not writing the generated ID to the database at all? Not even an update to the record set you are querying?&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2017 09:41:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Using-Oracle-sequence-to-generte-ID-while-writing-in-file/m-p/2334477#M103143</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-08T09:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Using Oracle sequence to generte ID while writing in file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Using-Oracle-sequence-to-generte-ID-while-writing-in-file/m-p/2334478#M103144</link>
      <description>&lt;P&gt;Thanks, my task is till file generation, what exactly is to be done with the file further - am not sure &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;anyways i have implented using tHash, now checking the performnce...hope it comes out good&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Moreover i m thinkig of using sequence generator in talend to improve performance&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2017 11:22:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Using-Oracle-sequence-to-generte-ID-while-writing-in-file/m-p/2334478#M103144</guid>
      <dc:creator>vidya821</dc:creator>
      <dc:date>2017-09-08T11:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using Oracle sequence to generte ID while writing in file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Using-Oracle-sequence-to-generte-ID-while-writing-in-file/m-p/2334479#M103145</link>
      <description>&lt;P&gt;The sequence generator in Talend would have been my suggestion earlier had I known it was just for a file, but I suspect that you will need to ensure that numbers are not repeated. A sequence handled by the database is better for that. If your IDs can be repeated and there is no need to do anything inside the database, use a Talend sequence.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2017 11:27:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Using-Oracle-sequence-to-generte-ID-while-writing-in-file/m-p/2334479#M103145</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-08T11:27:56Z</dc:date>
    </item>
  </channel>
</rss>

