<?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: [resolved] How to generate database primary key &amp; use it inside tmap ? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-generate-database-primary-key-use-it-inside-tmap/m-p/2214906#M11549</link>
    <description>THank you!
&lt;BR /&gt;That was exactly what i wanted to achive. I wil try that solution right now.</description>
    <pubDate>Tue, 01 Mar 2011 12:48:25 GMT</pubDate>
    <dc:creator>_AnonymousUser</dc:creator>
    <dc:date>2011-03-01T12:48:25Z</dc:date>
    <item>
      <title>[resolved] How to generate database primary key &amp; use it inside tmap ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-generate-database-primary-key-use-it-inside-tmap/m-p/2214904#M11547</link>
      <description>Hi, I need to migrate data from one application to the other with processing &amp;amp; normalizing data to fit new structure. 
&lt;BR /&gt;i would like to have old data as input (1 table) &amp;amp; new data as output (3 tables).
&lt;BR /&gt;Let say that we want to get client data from old application. In old data client had only one contact information, now it can have many contact details. I wanted to do it inside tMap in one step, but i don't know how could i generate contact id in oracle table &amp;amp; use it in client2contact table in the same tMap component. Is it possible somehow?
&lt;BR /&gt;On left side i have:
&lt;BR /&gt; 
&lt;PRE&gt;oldDocument{&lt;BR /&gt;clientId&lt;BR /&gt;clientName&lt;BR /&gt;clientContact&lt;BR /&gt;}&lt;/PRE&gt;
&lt;BR /&gt;i have to migrate this into 3 tables:
&lt;BR /&gt; 
&lt;PRE&gt;contact{&lt;BR /&gt;contactId - which we don't have yet, we have to generate it&lt;BR /&gt;contactDetails - which is mapped to oldDocument.clientContact&lt;BR /&gt;}&lt;BR /&gt;client{&lt;BR /&gt;clientId - this part is easy&lt;BR /&gt;clientName - this part is easy&lt;BR /&gt;}&lt;BR /&gt;client2contact{&lt;BR /&gt;clientId - we have to use contactId generated for table contact&lt;BR /&gt;contactId&lt;BR /&gt;}&lt;/PRE&gt;
&lt;BR /&gt;I know how to generate id using for example hibernate sequence in oracleOutput advanced tab, but i don't know if i can use it somehow in tMap ?
&lt;BR /&gt;Maybe we can use some rutines or sth else? Or maybe i should split it into more steps? 
&lt;BR /&gt;Im just starting with this tool so thanks for any hints.</description>
      <pubDate>Sat, 16 Nov 2024 13:04:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-generate-database-primary-key-use-it-inside-tmap/m-p/2214904#M11547</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2024-11-16T13:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] How to generate database primary key &amp; use it inside tmap ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-generate-database-primary-key-use-it-inside-tmap/m-p/2214905#M11548</link>
      <description>Hello 
&lt;BR /&gt; 
&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;contactId - which we don't have yet, we have to generate it&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;Using Talend build-in function Numeric.sequence("s1",1,1) to generate a sequence id. 
&lt;BR /&gt; 
&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;client2contact{&lt;BR /&gt;clientId - we have to use contactId generated for table contact&lt;BR /&gt;contactId&lt;BR /&gt;}&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;I think you have spelling error, right? The correct intention is: 
&lt;BR /&gt;clientId 
&lt;BR /&gt;contactId - we have to use contactId generated for table contact 
&lt;BR /&gt;For more details, please see my screenshots. 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Mon, 28 Feb 2011 08:08:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-generate-database-primary-key-use-it-inside-tmap/m-p/2214905#M11548</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-02-28T08:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] How to generate database primary key &amp; use it inside tmap ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-generate-database-primary-key-use-it-inside-tmap/m-p/2214906#M11549</link>
      <description>THank you!
&lt;BR /&gt;That was exactly what i wanted to achive. I wil try that solution right now.</description>
      <pubDate>Tue, 01 Mar 2011 12:48:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-generate-database-primary-key-use-it-inside-tmap/m-p/2214906#M11549</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2011-03-01T12:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] How to generate database primary key &amp; use it inside tmap ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-generate-database-primary-key-use-it-inside-tmap/m-p/2214907#M11550</link>
      <description>&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;Hello &lt;BR /&gt; 
     &lt;BLOCKQUOTE&gt; 
      &lt;TABLE border="1"&gt; 
       &lt;TBODY&gt; 
        &lt;TR&gt; 
         &lt;TD&gt;contactId - which we don't have yet, we have to generate it&lt;/TD&gt; 
        &lt;/TR&gt; 
       &lt;/TBODY&gt; 
      &lt;/TABLE&gt; 
     &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;Using Talend build-in function Numeric.sequence("s1",1,1) to generate a sequence id.&lt;BR /&gt; 
     &lt;BLOCKQUOTE&gt; 
      &lt;TABLE border="1"&gt; 
       &lt;TBODY&gt; 
        &lt;TR&gt; 
         &lt;TD&gt;client2contact{&lt;BR /&gt;clientId - we have to use contactId generated for table contact&lt;BR /&gt;contactId&lt;BR /&gt;}&lt;/TD&gt; 
        &lt;/TR&gt; 
       &lt;/TBODY&gt; 
      &lt;/TABLE&gt; 
     &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;I think you have spelling error, right? The correct intention is:&lt;BR /&gt;clientId &lt;BR /&gt;contactId - we have to use contactId generated for table contact&lt;BR /&gt;For more details, please see my screenshots.&lt;BR /&gt;Best regards&lt;BR /&gt;Shong&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;Hi, 
&lt;BR /&gt;unfortunatelly, i need to use my hibernate sequence. 
&lt;BR /&gt;I've added column with expression "HIBERNATE_SEQUENCE.nextval" in contact table &amp;amp; it is saved correctly in database. 
&lt;BR /&gt;But when i want to use this id in last tmap &amp;amp; save as contactId in contact2client table, id is always null &amp;amp; result table is empty. 
&lt;BR /&gt;How can i easilly use database sequence there ?</description>
      <pubDate>Tue, 01 Mar 2011 23:51:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-generate-database-primary-key-use-it-inside-tmap/m-p/2214907#M11550</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2011-03-01T23:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] How to generate database primary key &amp; use it inside tmap ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-generate-database-primary-key-use-it-inside-tmap/m-p/2214908#M11551</link>
      <description>Hi
&lt;BR /&gt;If you use "HIBERNATE_SEQUENCE.nextval" to generate contact id, you need to select the last inserted contact id base on each row before insert it to contact2client table, because the contact id is generated by db engine, not Talend job. Here I redesign the job a little to adjust to your request.
&lt;BR /&gt;Best regards
&lt;BR /&gt;Shong</description>
      <pubDate>Wed, 02 Mar 2011 06:34:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-generate-database-primary-key-use-it-inside-tmap/m-p/2214908#M11551</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-03-02T06:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] How to generate database primary key &amp; use it inside tmap ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-generate-database-primary-key-use-it-inside-tmap/m-p/2214909#M11552</link>
      <description>Hi, 
&lt;BR /&gt;thanks for helping me out 
&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;I've managed to do this yesterday evening, but i didn't ghad a time to poste the solution. 
&lt;BR /&gt;It is quite different from your proposition but it works for me - at least now 
&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;I've added sql query "Select HIBERNATE_SEQUENCE.nextval as nextval from dual" as oracleInput &amp;amp; then directed it to the map where i'm getting contact details &amp;amp; mapping them into contact table. I've mapped contactId to this nextval value &amp;amp; i've also changed this select input tMap settings to reload for each row. Thanks to this, i had new id generated for every row. I had to slightly change connections between components, but this works. 
&lt;BR /&gt;again - thanks for your help.</description>
      <pubDate>Wed, 02 Mar 2011 09:38:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-generate-database-primary-key-use-it-inside-tmap/m-p/2214909#M11552</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2011-03-02T09:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] How to generate database primary key &amp; use it inside tmap ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-generate-database-primary-key-use-it-inside-tmap/m-p/2214910#M11553</link>
      <description>Hi 
&lt;BR /&gt;I am glad to see that you get it works. It is time to close the topic now. 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MA9p.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138034i5F552429DA646D6F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MA9p.png" alt="0683p000009MA9p.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Wed, 02 Mar 2011 15:22:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-generate-database-primary-key-use-it-inside-tmap/m-p/2214910#M11553</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-03-02T15:22:34Z</dc:date>
    </item>
  </channel>
</rss>

