<?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: Usage of tDBOutput component for insert and update scenario in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Usage-of-tDBOutput-component-for-insert-and-update-scenario/m-p/2426998#M140296</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;Before inserting or updating the data into table, you need to read the data from file and then do an inner join with the key columns from table on tMap to get the data which will be inserted and other data will be updated, use different tDBoutput components to insert data and update data respectively.&lt;/P&gt;
&lt;P&gt;Add a tMap before tDBOutput,&lt;/P&gt;
&lt;P&gt;For inserted data, add extra columns &lt;SPAN&gt;created_by and updated_by in the output table of tMap,&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;and set the expression of&amp;nbsp;created_by and updated_by column as&lt;/SPAN&gt;&amp;nbsp;jobName.&lt;/P&gt;
&lt;P&gt;For updated data, only add extra column&amp;nbsp;&lt;SPAN&gt;updated_by in the output table of tMap, and set&amp;nbsp;the expression of updated_by column as&amp;nbsp;jobName.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;//jobName is a global variable that stores the job name.&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Shicong&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Mar 2024 09:37:03 GMT</pubDate>
    <dc:creator>Shicong_Hong</dc:creator>
    <dc:date>2024-03-05T09:37:03Z</dc:date>
    <item>
      <title>Usage of tDBOutput component for insert and update scenario</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Usage-of-tDBOutput-component-for-insert-and-update-scenario/m-p/2426903#M140294</link>
      <description>&lt;P&gt;Hi team&lt;/P&gt;
&lt;P&gt;I have a query regarding the usage of tDBOutput component in Talend.&lt;/P&gt;
&lt;P&gt;I have a loadable file which is read using tFileInputDelimited and is connected to tDBOutput. In tDBOutput, for "Action on Data" I have selected as "Insert or Update" as I need to insert or update based on the key.&lt;/P&gt;
&lt;P&gt;In table, I have two columns which is created_by and updated_by. During insertion, I have to update both these columns by jobName whereas at the time of updation, I don't want to touch the created_by column. How can this be accomplished.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Dhanoop B S&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2024 06:13:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Usage-of-tDBOutput-component-for-insert-and-update-scenario/m-p/2426903#M140294</guid>
      <dc:creator>DBS1</dc:creator>
      <dc:date>2024-03-05T06:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: Usage of tDBOutput component for insert and update scenario</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Usage-of-tDBOutput-component-for-insert-and-update-scenario/m-p/2426998#M140296</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;Before inserting or updating the data into table, you need to read the data from file and then do an inner join with the key columns from table on tMap to get the data which will be inserted and other data will be updated, use different tDBoutput components to insert data and update data respectively.&lt;/P&gt;
&lt;P&gt;Add a tMap before tDBOutput,&lt;/P&gt;
&lt;P&gt;For inserted data, add extra columns &lt;SPAN&gt;created_by and updated_by in the output table of tMap,&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;and set the expression of&amp;nbsp;created_by and updated_by column as&lt;/SPAN&gt;&amp;nbsp;jobName.&lt;/P&gt;
&lt;P&gt;For updated data, only add extra column&amp;nbsp;&lt;SPAN&gt;updated_by in the output table of tMap, and set&amp;nbsp;the expression of updated_by column as&amp;nbsp;jobName.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;//jobName is a global variable that stores the job name.&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Shicong&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2024 09:37:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Usage-of-tDBOutput-component-for-insert-and-update-scenario/m-p/2426998#M140296</guid>
      <dc:creator>Shicong_Hong</dc:creator>
      <dc:date>2024-03-05T09:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: Usage of tDBOutput component for insert and update scenario</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Usage-of-tDBOutput-component-for-insert-and-update-scenario/m-p/2427005#M140297</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/257838"&gt;@Shicong_Hong&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the response.&lt;/P&gt;
&lt;P&gt;I have only implemented like what you have mentioned below. But this was taking time as we need to load all data from table to perform the inner join operation.&lt;/P&gt;
&lt;P&gt;I would like to know if there is any solution, where Talend itself will determine which rows needs to be inserted/updated based on primary key and have different schemas for insert and update scenario.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Dhanoop B S&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2024 09:45:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Usage-of-tDBOutput-component-for-insert-and-update-scenario/m-p/2427005#M140297</guid>
      <dc:creator>DBS1</dc:creator>
      <dc:date>2024-03-05T09:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: Usage of tDBOutput component for insert and update scenario</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Usage-of-tDBOutput-component-for-insert-and-update-scenario/m-p/2427018#M140298</link>
      <description>Unfortunately, the job can't get which rows have been inserted/updated through tDBOutput component. We have to select the rows before insertion/update for more processing.&lt;BR /&gt;</description>
      <pubDate>Tue, 05 Mar 2024 09:56:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Usage-of-tDBOutput-component-for-insert-and-update-scenario/m-p/2427018#M140298</guid>
      <dc:creator>Shicong_Hong</dc:creator>
      <dc:date>2024-03-05T09:56:50Z</dc:date>
    </item>
  </channel>
</rss>

