<?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: Bulk DB update in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Bulk-DB-update/m-p/2537591#M148201</link>
    <description>Hello,&lt;BR /&gt;&lt;BR /&gt;To handle this situation and ensure only the transferred records are updated, you should capture the unique identifiers (e.g., primary keys or a list of IDs) of the records you are processing during the extraction phase and use these specific IDs in your update query&lt;BR /&gt;. This avoids a race condition where new records inserted concurrently with transfer_flag="N" are accidentally flagged as "Y".&lt;BR /&gt;Here is a recommended job design pattern:&lt;BR /&gt;&lt;BR /&gt;Talend Job Design with ID Management&lt;BR /&gt;1. Extract Specific Records:&lt;BR /&gt;Use a tDBInput component to select the records with transfer_flag = 'N'. Crucially, select only the primary key(s) or unique ID(s) of these records, along with any other necessary data columns.&lt;BR /&gt;2. Store IDs for Update:&lt;BR /&gt;o Pipe the output of tDBInput to a component like tHashOutput to temporarily store all the processed record IDs in memory or a temporary file. This list is a snapshot of the exact records being handled by the current job run.&lt;BR /&gt;3. Process and FTP Data:&lt;BR /&gt;o Replicate the data flow from tDBInput (or use a separate flow linked to tDBInputvia tReplicate) to your file output components (tFileOutputDelimited, etc.) and then to your tFTPPut components. This part of the job handles the actual data transfer.&lt;BR /&gt;4. On Successful Transfer, Update Flags:&lt;BR /&gt;o Use an OnSubjobOk trigger from the FTP component's subjob to ensure the update only happens if the FTP transfer is successful.&lt;BR /&gt;o Read the stored IDs from tHashInput (linked to the tHashOutput from step 2).&lt;BR /&gt;o Pipe the IDs to a tDBRow component.&lt;BR /&gt;5. Execute Precise Update:&lt;BR /&gt;o In the tDBRow component, write a parameterized SQL UPDATE statement that uses the specific IDs from the input flow in a WHERE IN (...) clause or similar condition.&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
    <pubDate>Sat, 29 Nov 2025 19:06:17 GMT</pubDate>
    <dc:creator>gvarun_arthasolutions</dc:creator>
    <dc:date>2025-11-29T19:06:17Z</dc:date>
    <item>
      <title>Bulk DB update</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Bulk-DB-update/m-p/2505577#M141768</link>
      <description>&lt;P&gt;Hi Team&lt;BR /&gt;&lt;BR /&gt;I have a requirement where I need to fetch data from multiple DB tables based on transfer_flag as "N" and write to individual files and then FTP to a particular server.&lt;BR /&gt;Once the transfer is done, I need to update the transfer_flag as "Y" for all these records. I was planning to use tDBRow where I would write the query to set&amp;nbsp;transfer_flag as "Y" for records having transfer_flag as "N". &lt;BR /&gt;But this may result in an issue as the transfer flag for the records which were newly updated/inserted into the table at time of processing will also be set to "Y" even though those records are not transferred via FTP,&lt;BR /&gt;&lt;BR /&gt;Please let me know how to handle this situation as I don't want to use tDBOutput Component as this will result in more time to update based on key columns.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;DBS&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2025 12:58:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Bulk-DB-update/m-p/2505577#M141768</guid>
      <dc:creator>Dhanoop</dc:creator>
      <dc:date>2025-02-12T12:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk DB update</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Bulk-DB-update/m-p/2537591#M148201</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;To handle this situation and ensure only the transferred records are updated, you should capture the unique identifiers (e.g., primary keys or a list of IDs) of the records you are processing during the extraction phase and use these specific IDs in your update query&lt;BR /&gt;. This avoids a race condition where new records inserted concurrently with transfer_flag="N" are accidentally flagged as "Y".&lt;BR /&gt;Here is a recommended job design pattern:&lt;BR /&gt;&lt;BR /&gt;Talend Job Design with ID Management&lt;BR /&gt;1. Extract Specific Records:&lt;BR /&gt;Use a tDBInput component to select the records with transfer_flag = 'N'. Crucially, select only the primary key(s) or unique ID(s) of these records, along with any other necessary data columns.&lt;BR /&gt;2. Store IDs for Update:&lt;BR /&gt;o Pipe the output of tDBInput to a component like tHashOutput to temporarily store all the processed record IDs in memory or a temporary file. This list is a snapshot of the exact records being handled by the current job run.&lt;BR /&gt;3. Process and FTP Data:&lt;BR /&gt;o Replicate the data flow from tDBInput (or use a separate flow linked to tDBInputvia tReplicate) to your file output components (tFileOutputDelimited, etc.) and then to your tFTPPut components. This part of the job handles the actual data transfer.&lt;BR /&gt;4. On Successful Transfer, Update Flags:&lt;BR /&gt;o Use an OnSubjobOk trigger from the FTP component's subjob to ensure the update only happens if the FTP transfer is successful.&lt;BR /&gt;o Read the stored IDs from tHashInput (linked to the tHashOutput from step 2).&lt;BR /&gt;o Pipe the IDs to a tDBRow component.&lt;BR /&gt;5. Execute Precise Update:&lt;BR /&gt;o In the tDBRow component, write a parameterized SQL UPDATE statement that uses the specific IDs from the input flow in a WHERE IN (...) clause or similar condition.&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Sat, 29 Nov 2025 19:06:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Bulk-DB-update/m-p/2537591#M148201</guid>
      <dc:creator>gvarun_arthasolutions</dc:creator>
      <dc:date>2025-11-29T19:06:17Z</dc:date>
    </item>
  </channel>
</rss>

