<?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: How to only insert record which is not exist in database? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-only-insert-record-which-is-not-exist-in-database/m-p/2276883#M52833</link>
    <description>&lt;P&gt;&lt;STRONG&gt;choice 2)&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;create stage table in DB2, insert all rows into stage table. Run SQL command for INSERT into main table only new data , truncate (delete) stage table at the end&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hi Sir,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As you mentioned choice 2, what is command for&amp;nbsp;INSERT into main table only new data. Could you please mention the INSERT command for getting only newly added records from the table which contain historical data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Amar&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Feb 2018 07:14:49 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-02-21T07:14:49Z</dc:date>
    <item>
      <title>How to only insert record which is not exist in database?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-only-insert-record-which-is-not-exist-in-database/m-p/2276880#M52830</link>
      <description>&lt;P&gt;I have a table in db2. Three fields are combined as a key. But this key only for certain data in the table. So I cannot set this key in database.&lt;/P&gt; 
&lt;P&gt;But I would like to set this key in t(DB)output component for insert. I only want the records which is not existing in the table can be inserted. If it exists, no update.&lt;/P&gt; 
&lt;P&gt;I know update/insert will work if I update the record. But I won't update record.&lt;/P&gt; 
&lt;P&gt;I also tried just insert, but it insert all records (exist or not) since I couldn't add key in database.&lt;/P&gt; 
&lt;P&gt;Do you know if there is a&amp;nbsp;better way to do this?&lt;/P&gt; 
&lt;P&gt;Thanks!&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2017 22:21:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-only-insert-record-which-is-not-exist-in-database/m-p/2276880#M52830</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-12T22:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to only insert record which is not exist in database?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-only-insert-record-which-is-not-exist-in-database/m-p/2276881#M52831</link>
      <description>&lt;P&gt;Without indexes - it always extremely Bad, so seriously talk with DBA for add Primary Key or at least indexes for this columns&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;But You have 2 choices, depending from how big Your data New and in Table&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;choice 1)&lt;/STRONG&gt; create 2 Flows - new data and original table, than in tMap make a INNER JOIN and INSERT rejected rows back into table&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;choice 2)&lt;/STRONG&gt; create stage table in DB2, insert all rows into stage table. Run SQL command for INSERT into main table only new data , truncate (delete) stage table at the end&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;choice 1&lt;/STRONG&gt; good when new data regular have a lot of rejected rows and size of new data +- similar with size of main table, and also could help&amp;nbsp;if no indexes on table&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;choice 2&lt;/STRONG&gt; good when main table huge and new data regular add "small" (if compare) number of new records&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;DB2 good database, but without indexes it could take a ages in both case&lt;/P&gt;</description>
      <pubDate>Sat, 13 May 2017 02:37:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-only-insert-record-which-is-not-exist-in-database/m-p/2276881#M52831</guid>
      <dc:creator>vapukov</dc:creator>
      <dc:date>2017-05-13T02:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to only insert record which is not exist in database?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-only-insert-record-which-is-not-exist-in-database/m-p/2276882#M52832</link>
      <description>&lt;P&gt;Echoing what vapukov said in his intro sentence about DBAs - if you have a table&amp;nbsp;that "a key only fits part of" you possibly have two tables and might consider splitting it into "those rows that do" and "those rows that don't". &amp;nbsp; You can then have one set completely keyless so open to always inserts and the other half subject to a well formed key so properly open to update and insert.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;i.e. possibly trying to use an integration tool to 'paper over' a flaw in database design.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;If that is true it will not end well for either your or the too as you will be fighting against how things are ordered on a continual basis, including further steps such as adding a consuming application on top.&amp;nbsp; Only you would know whether the above applies in your specific case of course... &amp;nbsp;&amp;nbsp; Advice on a forum can only be general on something like this.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jan 2018 10:22:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-only-insert-record-which-is-not-exist-in-database/m-p/2276882#M52832</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-20T10:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to only insert record which is not exist in database?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-only-insert-record-which-is-not-exist-in-database/m-p/2276883#M52833</link>
      <description>&lt;P&gt;&lt;STRONG&gt;choice 2)&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;create stage table in DB2, insert all rows into stage table. Run SQL command for INSERT into main table only new data , truncate (delete) stage table at the end&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hi Sir,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As you mentioned choice 2, what is command for&amp;nbsp;INSERT into main table only new data. Could you please mention the INSERT command for getting only newly added records from the table which contain historical data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Amar&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2018 07:14:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-only-insert-record-which-is-not-exist-in-database/m-p/2276883#M52833</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-21T07:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to only insert record which is not exist in database?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-only-insert-record-which-is-not-exist-in-database/m-p/2276884#M52834</link>
      <description>&lt;PRE&gt;insert into table2 select * from table1 where not exists (select * from table2 where table2.PK = table1.PK)&lt;/PRE&gt;&lt;P&gt;PK - is Primary Key column, but could be used any conditions&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2018 07:49:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-only-insert-record-which-is-not-exist-in-database/m-p/2276884#M52834</guid>
      <dc:creator>vapukov</dc:creator>
      <dc:date>2018-02-21T07:49:12Z</dc:date>
    </item>
  </channel>
</rss>

