<?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: Parse an XML and write datas on database. in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Parse-an-XML-and-write-datas-on-database/m-p/2291099#M64313</link>
    <description>Without really understanding what you're trying to do: can you not tMap with lookups and filtered outputs instead of your tFlowToIterate etc.? Also, if you're iterating to create individual rows, you can combine the iterations back into one flow with tIterateToFlow or tUnite.</description>
    <pubDate>Fri, 19 Apr 2013 05:02:58 GMT</pubDate>
    <dc:creator>alevy</dc:creator>
    <dc:date>2013-04-19T05:02:58Z</dc:date>
    <item>
      <title>Parse an XML and write datas on database.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Parse-an-XML-and-write-datas-on-database/m-p/2291098#M64312</link>
      <description>Hi, 
&lt;BR /&gt;I'm new to Talend and I need a suggestion because I'm quite sure the way I solved my problem is quite far from being the best one. 
&lt;BR /&gt;First of all sorry for my bad English! 
&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;That's the scenario: 
&lt;BR /&gt;I need to parse an xml file, extract various elements and than perfom several SQL "insert" whose value depends on each retrieved XML's element value. 
&lt;BR /&gt;The way I do it is shown in the first image. 
&lt;BR /&gt;1) I parse the xml file (e.g.100 elements) and then I create 100 new records on a db's table using the tMySQLOutput module (the one called first in the first image). 
&lt;BR /&gt;In this case Talend performs a "bulk" write from XML to db. 
&lt;BR /&gt;2) I examine again the 100 elements parsed from the XML file and than I need to write other values that the 100 elements contain on various db's tables. 
&lt;BR /&gt;Before writing each of the 100 elements I need to perform various tests (test1, test2 and test3 in the first image) to correctly set up the FK in every record I'm going to create. 
&lt;BR /&gt;The only way I found to accomplish point 2 is to use tMySQLRow to write the set of records corresponding to the first XML element, before examining the second XML element and so on. 
&lt;BR /&gt;This solution works but is really hard to debug the job when something goes wrong during the execution. 
&lt;BR /&gt;I'd like to use a tXMLMap and a tMySQLOutput like I do at the point one, it wouyld be much more easy to debug my job. 
&lt;BR /&gt;The problem, as shown in the second image, is that with tXMLMap and tMySQLOutput I can only perform a bulk write and I can't do the tests I need to correctly set up FKs. 
&lt;BR /&gt;In addition to this I can't connect a tMySQLoutput as a "writeORnot-trigger" to a tXMLMap. 
&lt;BR /&gt;Can someone show me the way to fix the job shown in the second image? 
&lt;BR /&gt;Thanks a lot!!! 
&lt;BR /&gt; 
&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; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MENV.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/144567iD606EEEF6069D43E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MENV.png" alt="0683p000009MENV.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009ME81.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/149996iB18168853C138F78/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009ME81.png" alt="0683p000009ME81.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Thu, 18 Apr 2013 14:01:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Parse-an-XML-and-write-datas-on-database/m-p/2291098#M64312</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-04-18T14:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: Parse an XML and write datas on database.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Parse-an-XML-and-write-datas-on-database/m-p/2291099#M64313</link>
      <description>Without really understanding what you're trying to do: can you not tMap with lookups and filtered outputs instead of your tFlowToIterate etc.? Also, if you're iterating to create individual rows, you can combine the iterations back into one flow with tIterateToFlow or tUnite.</description>
      <pubDate>Fri, 19 Apr 2013 05:02:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Parse-an-XML-and-write-datas-on-database/m-p/2291099#M64313</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2013-04-19T05:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: Parse an XML and write datas on database.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Parse-an-XML-and-write-datas-on-database/m-p/2291100#M64314</link>
      <description>&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;can you not tMap with lookups and filtered outputs instead of your tFlowToIterate etc.?&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;mmmmm alevy I think I've not understood what do you mean with "with lookups" and "filtered output". 
&lt;BR /&gt;Which t-modules do you refer?
&lt;BR /&gt;Matteo</description>
      <pubDate>Fri, 19 Apr 2013 08:32:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Parse-an-XML-and-write-datas-on-database/m-p/2291100#M64314</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-04-19T08:32:30Z</dc:date>
    </item>
    <item>
      <title>Re: Parse an XML and write datas on database.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Parse-an-XML-and-write-datas-on-database/m-p/2291101#M64315</link>
      <description>I'm referring just to tMap. All I can see from your job is that you're reading from the DB and doing stuff in tJavaRow before writing with tMySQLRow. I think you should be able to bring all your requirements for the processing logic together in tMap, replacing tFlowToIterate, tJavaRow and the If connections. You'll need to provide more detail on exactly what you're trying to do if you want more help.</description>
      <pubDate>Mon, 22 Apr 2013 00:55:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Parse-an-XML-and-write-datas-on-database/m-p/2291101#M64315</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2013-04-22T00:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: Parse an XML and write datas on database.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Parse-an-XML-and-write-datas-on-database/m-p/2291102#M64316</link>
      <description>&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;I'm referring just to tMap. All I can see from your job is that you're reading from the DB and doing stuff in tJavaRow before writing with tMySQLRow. I think you should be able to bring all your requirements for the processing logic together in tMap, replacing tFlowToIterate, tJavaRow and the If connections. You'll need to provide more detail on exactly what you're trying to do if you want more help.&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;Ok now I got what you mean 
&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;Sorry but I've got such little experience with Talend. 
&lt;BR /&gt;I'd really love to use only a tMap to perform all the verifications I need but how can I implement something like: 
&lt;BR /&gt; 
&lt;I&gt;read the value N from Values.xml file, compare it with the result of the query "SELECT table.id FROM db.table WHERE table.name=XYZ", if N=id perfom "INSERT INTO ....." otherwise skip to the next row of the Values.xml file&lt;/I&gt; 
&lt;BR /&gt;only using a tMap module? 
&lt;BR /&gt;Onche again thanks for your help! 
&lt;BR /&gt;Matteo</description>
      <pubDate>Mon, 22 Apr 2013 08:18:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Parse-an-XML-and-write-datas-on-database/m-p/2291102#M64316</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-04-22T08:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: Parse an XML and write datas on database.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Parse-an-XML-and-write-datas-on-database/m-p/2291103#M64317</link>
      <description>That sounds like using a very simple lookup with inner-join in tMap, passing the output to tMySQLOutput.  I suggest you start by closely reading the tMap component help to understand how it works and maybe look at some of the tutorials on the website.  Then, if you have a specific problem achieving what you want, start a new topic with the details.</description>
      <pubDate>Mon, 22 Apr 2013 08:41:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Parse-an-XML-and-write-datas-on-database/m-p/2291103#M64317</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2013-04-22T08:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: Parse an XML and write datas on database.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Parse-an-XML-and-write-datas-on-database/m-p/2291104#M64318</link>
      <description>Hi Matteo, &lt;BR /&gt;I think these references will be helpful for your working:&lt;BR /&gt;&lt;A href="https://help.talend.com/search/all?query=tMap&amp;amp;content-lang=en" target="_blank" rel="nofollow noopener noreferrer"&gt;tMap&lt;/A&gt;, &lt;A href="https://help.talend.com/search/all?query=tMap+operation&amp;amp;content-lang=en" target="_blank" rel="nofollow noopener noreferrer"&gt;tMap operation&lt;/A&gt; and &lt;A href="https://help.talend.com/search/all?query=tMap+Job+example&amp;amp;content-lang=en" target="_blank" rel="nofollow noopener noreferrer"&gt;tMap Job example&lt;/A&gt;.&lt;BR /&gt;Best regards&lt;BR /&gt;Sabrina</description>
      <pubDate>Tue, 23 Apr 2013 07:54:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Parse-an-XML-and-write-datas-on-database/m-p/2291104#M64318</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-04-23T07:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: Parse an XML and write datas on database.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Parse-an-XML-and-write-datas-on-database/m-p/2291105#M64319</link>
      <description>Thanks 
&lt;B&gt;xdshi&lt;/B&gt; and 
&lt;B&gt;alevy&lt;/B&gt;, I should have studied more before start working with Talend but time to market is really killing me! 
&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;</description>
      <pubDate>Tue, 23 Apr 2013 08:55:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Parse-an-XML-and-write-datas-on-database/m-p/2291105#M64319</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-04-23T08:55:17Z</dc:date>
    </item>
  </channel>
</rss>

