<?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: update and insert in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357841#M123036</link>
    <description>it will not work for IDs with more than 2 occurences 
&lt;BR /&gt;if you want to track updates for specific fields SCD is what you should use</description>
    <pubDate>Tue, 03 Jan 2012 14:46:23 GMT</pubDate>
    <dc:creator>ytuzet</dc:creator>
    <dc:date>2012-01-03T14:46:23Z</dc:date>
    <item>
      <title>update and insert</title>
      <link>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357834#M123029</link>
      <description>Hi,
&lt;BR /&gt;I have a record in tgt table
&lt;BR /&gt;If a record with same id comes to tgt then i want to update the old record and insert the new record at the same time .
&lt;BR /&gt;How can i do this ??
&lt;BR /&gt;I have managed to insert the record but then i also want to change the data of previous record with same id !
&lt;BR /&gt;Please help !</description>
      <pubDate>Sat, 16 Nov 2024 12:28:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357834#M123029</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T12:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: update and insert</title>
      <link>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357835#M123030</link>
      <description>Hi,
&lt;BR /&gt;Choose insert or update in your ouput, and define your id as the primary key.</description>
      <pubDate>Mon, 02 Jan 2012 15:04:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357835#M123030</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-02T15:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: update and insert</title>
      <link>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357836#M123031</link>
      <description>That solution is only updating the record not even inserting.
&lt;BR /&gt;To be precise.....
&lt;BR /&gt;I have say...3 cols - id,val1,val2
&lt;BR /&gt;when duplicate id comes then the same is inserted in the table and the previous id record is updated for col B.
&lt;BR /&gt;How can this be done for subsequent records.</description>
      <pubDate>Mon, 02 Jan 2012 19:20:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357836#M123031</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-02T19:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: update and insert</title>
      <link>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357837#M123032</link>
      <description>Ok,&lt;BR /&gt;First I just wanted to help (sry if my solution doesn't answer your problem....I thought it was a forum).&lt;BR /&gt;Second could you put an example please?</description>
      <pubDate>Mon, 02 Jan 2012 21:04:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357837#M123032</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-02T21:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: update and insert</title>
      <link>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357838#M123033</link>
      <description>&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;Sry.. i didnt mean to be rude. 
&lt;BR /&gt; 
&lt;BR /&gt;I am trying SCD 2. 
&lt;BR /&gt;I which i have 4 cols : ID,VAL1,VAL_ST,VAL_END 
&lt;BR /&gt;My composite key here is ID and VAL_ST. 
&lt;BR /&gt;What i m trying is whenever a record with same id comes 
&lt;BR /&gt;the new record should have current VAL_ST --- 
&lt;BR /&gt;the old record should have VAL1 of new record 
&lt;BR /&gt; and VAL_END of new record 
&lt;BR /&gt;But whenever i run this job the new record is getting inserted but when updating it is updating the new and previous records both keeping the record unchanged with just a new VAL_END of the new record. 
&lt;BR /&gt;Please help !</description>
      <pubDate>Tue, 03 Jan 2012 13:51:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357838#M123033</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-03T13:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: update and insert</title>
      <link>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357839#M123034</link>
      <description>Hi,
&lt;BR /&gt;SCD type 2 will trace every change from the source table for the same id (if there are 3 modifications on the id you define there will be 3 rows in the SCD output)
&lt;BR /&gt;maybe you should use SCD type 3 to have only current and previous version 
&lt;BR /&gt;
&lt;BR /&gt;can you post a screenshot of how you use you SCD component?</description>
      <pubDate>Tue, 03 Jan 2012 14:31:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357839#M123034</guid>
      <dc:creator>ytuzet</dc:creator>
      <dc:date>2012-01-03T14:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: update and insert</title>
      <link>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357840#M123035</link>
      <description>OK I think what you need here is a bit more complex.
&lt;BR /&gt;You need your data input and your tgt table as lookup to a tMap. The tMap needt 2 outputs.
&lt;BR /&gt;Match the input data to the lookup as an inner join on ID.
&lt;BR /&gt;Output 1 will have the data from the lookup for ID and VAL_ST and data from the input data for VAL_1 and VAL_END
&lt;BR /&gt;Output 2 will have all the data from the input data.
&lt;BR /&gt;pass output 1 to modify the tgt table and pass output2 to input the tgt table.</description>
      <pubDate>Tue, 03 Jan 2012 14:36:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357840#M123035</guid>
      <dc:creator>janhess</dc:creator>
      <dc:date>2012-01-03T14:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: update and insert</title>
      <link>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357841#M123036</link>
      <description>it will not work for IDs with more than 2 occurences 
&lt;BR /&gt;if you want to track updates for specific fields SCD is what you should use</description>
      <pubDate>Tue, 03 Jan 2012 14:46:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357841#M123036</guid>
      <dc:creator>ytuzet</dc:creator>
      <dc:date>2012-01-03T14:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: update and insert</title>
      <link>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357842#M123037</link>
      <description>So long as the query sorts the data on descending VAL_END and the join is for first occurrence it will work.&lt;BR /&gt;You could just use the t{databasetype}SCD component.</description>
      <pubDate>Tue, 03 Jan 2012 15:58:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357842#M123037</guid>
      <dc:creator>janhess</dc:creator>
      <dc:date>2012-01-03T15:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: update and insert</title>
      <link>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357843#M123038</link>
      <description>Hi,
&lt;BR /&gt;Thanx for all the help.
&lt;BR /&gt;Somehow finally have got it sorted.
&lt;BR /&gt;I have taken 3 outputs from a tmap which joins src table and target tables.
&lt;BR /&gt;from 1st op i update the same id record
&lt;BR /&gt;from 2nd op i insert the same id record
&lt;BR /&gt;from 3rd op i insert completely new record (inner join reject op)
&lt;BR /&gt;Let me know if this is the right way.. or is there any other optimized way ?</description>
      <pubDate>Tue, 03 Jan 2012 18:48:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357843#M123038</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-03T18:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: update and insert</title>
      <link>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357844#M123039</link>
      <description>I like what you suggested. Make sense to me. 
&lt;BR /&gt;And the "Insert or Update" for tOuputxxx component is so slow it's unbelivable. 
&lt;BR /&gt;I removed all of them and split my jobs in 2 parts : All the updates and the all the inserts. Less clean but this way batch processing is working. 
&lt;BR /&gt;10 time faster. 
&lt;BR /&gt;Regards 
&lt;BR /&gt;M.</description>
      <pubDate>Tue, 03 Jan 2012 21:27:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357844#M123039</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2012-01-03T21:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: update and insert</title>
      <link>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357845#M123040</link>
      <description>I had tried "Insert or Update" for a job but that gives less control and it just somehow does not work as i was expecting. 
&lt;BR /&gt;I guess one can also use the bulk insert for the completely new records. 
&lt;BR /&gt;That could enhance the performance more. 
&lt;BR /&gt;The above suggested way does not work everytime. 
&lt;BR /&gt;i mean i m trying to maintain a history. 
&lt;BR /&gt;But the updating of the previous row does not occur everytime .And i m not able to trace the reason!!!! 
&lt;BR /&gt;Please let me know if any1 could figure it out ! 
&lt;BR /&gt;What i would like to know is if im having 3 ops from a single component can i control their execution i.e can i execute 3 then 2 then 1 or 1,2,3 or any other combination ?</description>
      <pubDate>Wed, 04 Jan 2012 03:54:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357845#M123040</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-04T03:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: update and insert</title>
      <link>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357846#M123041</link>
      <description>Why the 2nd op? If you update your insert will fail with duplicate key.</description>
      <pubDate>Wed, 04 Jan 2012 08:59:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357846#M123041</guid>
      <dc:creator>janhess</dc:creator>
      <dc:date>2012-01-04T08:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: update and insert</title>
      <link>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357847#M123042</link>
      <description>Key is on id and st_date so when a new entry of same id comes it has a different st_date. 
&lt;BR /&gt;But the problem i m facing is : 
&lt;BR /&gt;tMap : Inner Join is on ID and Match Model : UNIQUE MATCH 
&lt;BR /&gt; 
&lt;BR /&gt;suppose Table A : 
&lt;BR /&gt;id;VAL1;VAL_ST 
&lt;BR /&gt;1; A; 1 
&lt;BR /&gt;Table B(target and history is maintained on VAL1) 
&lt;BR /&gt;id;VAL1;VAL_ST,VAL_END 
&lt;BR /&gt;This is empty in the beginning 
&lt;BR /&gt;On my first run according to the job 
&lt;BR /&gt;Data is new so it is simply inserted. 
&lt;BR /&gt;And tables look like : 
&lt;BR /&gt;id;VAL1;VAL_ST; 
&lt;BR /&gt;1; A; 1 
&lt;BR /&gt;Table B(target and history is maintained on VAL1) 
&lt;BR /&gt;id;VAL1;VAL_ST,VAL_END 
&lt;BR /&gt;1;A;1;null 
&lt;BR /&gt;Now i make changes to Table A changing its VAL_ST and VAL1 
&lt;BR /&gt;Table A 
&lt;BR /&gt;id;VAL1;VAL_ST; 
&lt;BR /&gt;1; B ; 2 
&lt;BR /&gt;Table B(target and history is maintained on VAL1) 
&lt;BR /&gt;id;VAL1;VAL_ST;VAL_END 
&lt;BR /&gt;1 ; A ; 1 ;null 
&lt;BR /&gt;1 ; B ; 2 ; 1 
&lt;BR /&gt;Now when i run the job again 
&lt;BR /&gt;The same is getting added again when i m expecting a no change in the target!! 
&lt;BR /&gt;The table looks like : 
&lt;BR /&gt;Table A 
&lt;BR /&gt;id;VAL1;VAL_ST; 
&lt;BR /&gt;1; B ; 2 
&lt;BR /&gt;Table B(target and history is maintained on VAL1) 
&lt;BR /&gt;id;VAL1;VAL_ST;VAL_END 
&lt;BR /&gt;1 ; A ; 1 ;null 
&lt;BR /&gt;1 ; B ; 2 ; 1 
&lt;BR /&gt;1 ; B ; 2 ;null 
&lt;BR /&gt;How do i avoid this ?</description>
      <pubDate>Wed, 04 Jan 2012 09:28:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357847#M123042</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-04T09:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: update and insert</title>
      <link>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357848#M123043</link>
      <description>Doesn't look right.&lt;BR /&gt;After your first change you should have&lt;BR /&gt;id;VAL1;VAL_ST;VAL_END&lt;BR /&gt;1 ; A    ;      1   ;2&lt;BR /&gt;1 ; B    ;      2   ; null&lt;BR /&gt;Can you post a picture of your job and the tMap.</description>
      <pubDate>Wed, 04 Jan 2012 10:22:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357848#M123043</guid>
      <dc:creator>janhess</dc:creator>
      <dc:date>2012-01-04T10:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: update and insert</title>
      <link>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357849#M123044</link>
      <description>i m so sorry for the confusion : 
&lt;BR /&gt;i will rewrite : 
&lt;BR /&gt;Key is on id and st_date so when a new entry of same id comes it has a different st_date. 
&lt;BR /&gt;But the problem i m facing is : 
&lt;BR /&gt;tMap : Inner Join is on ID and Match Model : UNIQUE MATCH 
&lt;BR /&gt; 
&lt;BR /&gt;suppose Table A : 
&lt;BR /&gt;id;VAL1;VAL_ST 
&lt;BR /&gt;1; A; 1 
&lt;BR /&gt;Table B(target and history is maintained on VAL1) 
&lt;BR /&gt;id;VAL1;VAL_ST,VAL_END 
&lt;BR /&gt;This is empty in the beginning 
&lt;BR /&gt;On my first run according to the job 
&lt;BR /&gt;Data is new so it is simply inserted. 
&lt;BR /&gt;And tables look like : 
&lt;BR /&gt;id;VAL1;VAL_ST; 
&lt;BR /&gt;1; A; 1 
&lt;BR /&gt;Table B(target and history is maintained on VAL1) 
&lt;BR /&gt;id;VAL1;VAL_ST,VAL_END 
&lt;BR /&gt;1;A;1;null 
&lt;BR /&gt;Now i make changes to Table A changing its VAL_ST and VAL1 
&lt;BR /&gt;Table A 
&lt;BR /&gt;id;VAL1;VAL_ST; 
&lt;BR /&gt;1; B ; 2 
&lt;BR /&gt;Table B(target and history is maintained on VAL1) 
&lt;BR /&gt;id;VAL1;VAL_ST;VAL_END 
&lt;BR /&gt;1 ; A ; 1 ;2 
&lt;BR /&gt;1 ; B ; 2 ; null 
&lt;BR /&gt;Now when i run the job again 
&lt;BR /&gt;The same is getting added again when i m expecting a no change in the target!! 
&lt;BR /&gt;The table looks like : 
&lt;BR /&gt;Table A 
&lt;BR /&gt;id;VAL1;VAL_ST; 
&lt;BR /&gt;1; B ; 2 
&lt;BR /&gt;Table B(target and history is maintained on VAL1) 
&lt;BR /&gt;id;VAL1;VAL_ST;VAL_END 
&lt;BR /&gt;1 ; A ; 1 ;2 
&lt;BR /&gt;1 ; B ; 2 ; null 
&lt;BR /&gt;1 ; B ; 2 ;null 
&lt;BR /&gt;How do i avoid this ?</description>
      <pubDate>Wed, 04 Jan 2012 10:39:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357849#M123044</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-04T10:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: update and insert</title>
      <link>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357850#M123045</link>
      <description>You need to check in your output insert if the new values are the same as the old values&lt;BR /&gt;eg ! row1.VAL1.equals(row2.VAL1) &amp;amp; ! row1.VAL_ST.equals(row2.VAL_ST)</description>
      <pubDate>Wed, 04 Jan 2012 11:10:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357850#M123045</guid>
      <dc:creator>janhess</dc:creator>
      <dc:date>2012-01-04T11:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: update and insert</title>
      <link>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357851#M123046</link>
      <description>For that kind of operation, I would use 2 steps, linked with a 'onSubjobOk'.
&lt;BR /&gt;First update, second insert.
&lt;BR /&gt;I can't see how, with the existing components, you can easily perform the two actions at the same time.
&lt;BR /&gt;This solution is pretty clear to implement and read later.</description>
      <pubDate>Wed, 04 Jan 2012 15:44:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357851#M123046</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-04T15:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: update and insert</title>
      <link>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357852#M123047</link>
      <description>i will try the OnSubJobOk.&lt;BR /&gt;My solution i have explained in the above posts.&lt;BR /&gt;And when i test it ; it works fine for if i maintain a history upto 3 changes. But then after that it starts behaving unexpectedly.&lt;BR /&gt;I am not able to figure out the reason for it yet!!&lt;BR /&gt;@bcastell : i would like to know y is it not possible to maintain SCD type 2 with the above solution ?</description>
      <pubDate>Wed, 04 Jan 2012 19:55:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357852#M123047</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-04T19:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: update and insert</title>
      <link>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357853#M123048</link>
      <description>Hi,&lt;BR /&gt;Thanx for the help and suggestions.&lt;BR /&gt;My problem has got solved.&lt;BR /&gt;I think we can have SCD type 2 with the above job mentioned.&lt;BR /&gt;If there is any other way(which i can bet there is) please do let me know.&lt;BR /&gt;I think ppl here are a bit shy when it comes to SCD !!&lt;BR /&gt;Please do let me know how else can an SCD 2 be implemented w/o using SCD component.</description>
      <pubDate>Thu, 05 Jan 2012 06:12:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/update-and-insert/m-p/2357853#M123048</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-05T06:12:20Z</dc:date>
    </item>
  </channel>
</rss>

