<?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 XMLInput to XML column in MSSQLSERVER Database in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/XMLInput-to-XML-column-in-MSSQLSERVER-Database/m-p/2214969#M11586</link>
    <description>I generate XML files from rows in an Excel input file. Each row of XML formed is put into an XML file each.
&lt;BR /&gt;I want to load an xml column in my sql server database with each of these xml rows formed in each of the files. How can I do this?
&lt;BR /&gt;I do not want to load each schema column value in a field in the database. I need to load the whole XML row in each XML file formed into a single XML field in the database table.
&lt;BR /&gt;I get an "schema from the input link is different from the schema defined in the component" because I have all the schema columns as input from xml but have only a single field to load the whole xml file in the database?
&lt;BR /&gt;How can I do this? Do I have to use a tMap to create an xml string again and then load it into the database field or is there something else I am supposed to do here.
&lt;BR /&gt;Any help is appreciated.
&lt;BR /&gt;Attached is the flow I was trying to do. The flow starting with tfileInputExcel is the one I am having trouble with.</description>
    <pubDate>Sat, 16 Nov 2024 14:28:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T14:28:08Z</dc:date>
    <item>
      <title>XMLInput to XML column in MSSQLSERVER Database</title>
      <link>https://community.qlik.com/t5/Talend-Studio/XMLInput-to-XML-column-in-MSSQLSERVER-Database/m-p/2214969#M11586</link>
      <description>I generate XML files from rows in an Excel input file. Each row of XML formed is put into an XML file each.
&lt;BR /&gt;I want to load an xml column in my sql server database with each of these xml rows formed in each of the files. How can I do this?
&lt;BR /&gt;I do not want to load each schema column value in a field in the database. I need to load the whole XML row in each XML file formed into a single XML field in the database table.
&lt;BR /&gt;I get an "schema from the input link is different from the schema defined in the component" because I have all the schema columns as input from xml but have only a single field to load the whole xml file in the database?
&lt;BR /&gt;How can I do this? Do I have to use a tMap to create an xml string again and then load it into the database field or is there something else I am supposed to do here.
&lt;BR /&gt;Any help is appreciated.
&lt;BR /&gt;Attached is the flow I was trying to do. The flow starting with tfileInputExcel is the one I am having trouble with.</description>
      <pubDate>Sat, 16 Nov 2024 14:28:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/XMLInput-to-XML-column-in-MSSQLSERVER-Database/m-p/2214969#M11586</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T14:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: XMLInput to XML column in MSSQLSERVER Database</title>
      <link>https://community.qlik.com/t5/Talend-Studio/XMLInput-to-XML-column-in-MSSQLSERVER-Database/m-p/2214970#M11587</link>
      <description>&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;I get an "schema from the input link is different from the schema defined in the component" because I have all the schema columns as input from xml but have only a single field to load the whole xml file in the database?&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;After you generate the xml file, use a thenRun connector to load this file into database. Please read this topic to learn how to insert a file into DB. 
&lt;BR /&gt; 
&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCjGvCAK" rel="nofollow noopener noreferrer"&gt;https://community.talend.com/t5/Design-and-Development/resolved-File-into-BLOB/td-p/67476&lt;/A&gt; 
&lt;BR /&gt;Best regards 
&lt;BR /&gt; shong</description>
      <pubDate>Thu, 31 Jan 2008 02:32:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/XMLInput-to-XML-column-in-MSSQLSERVER-Database/m-p/2214970#M11587</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-31T02:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: XMLInput to XML column in MSSQLSERVER Database</title>
      <link>https://community.qlik.com/t5/Talend-Studio/XMLInput-to-XML-column-in-MSSQLSERVER-Database/m-p/2214971#M11588</link>
      <description>I followed the post which you had pointed to, but got the error: 
&lt;BR /&gt;"java.sql.SQLException: Unable to convert between java.io.File and JAVA_OBJECT." 
&lt;BR /&gt;I tried using the same routine given in the post which was how the problem was resolved there, 
&lt;BR /&gt;but my requirement was a bit different ( I do not want to store the whole file in the XML column as is, I only want to store 
&lt;BR /&gt;the XML row/string/ content of the XML) because of which i wrote this routine and resolved the issue. 
&lt;BR /&gt;public static String getFiletoInsert(String file) { 
&lt;BR /&gt; try { 
&lt;BR /&gt; FileReader fileReader = new FileReader(file); 
&lt;BR /&gt; StringBuffer fileDataBuff = new StringBuffer(); 
&lt;BR /&gt; String fileData = null; 
&lt;BR /&gt; BufferedReader bufferedReader = new BufferedReader(fileReader); 
&lt;BR /&gt; int i = 0; 
&lt;BR /&gt; while ((fileData = bufferedReader.readLine()) != null) { 
&lt;BR /&gt; if (i != 0) { 
&lt;BR /&gt; fileDataBuff.append(fileData); 
&lt;BR /&gt; } 
&lt;BR /&gt; i++; 
&lt;BR /&gt; } 
&lt;BR /&gt; fileReader.close(); 
&lt;BR /&gt; bufferedReader.close(); 
&lt;BR /&gt; return fileDataBuff.toString(); 
&lt;BR /&gt; } catch (Exception err) { 
&lt;BR /&gt; err.printStackTrace(); 
&lt;BR /&gt; return null; 
&lt;BR /&gt; } 
&lt;BR /&gt; } 
&lt;BR /&gt; 
&lt;BR /&gt;The expression used in the tMap was : 
&lt;BR /&gt;ByteArrayFromFile.getFiletoInsert(((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))) 
&lt;BR /&gt;for the XML field and the Type of the output column (XML field in the database) was specified as an 'String' and not as an Object in this case. 
&lt;BR /&gt;Thanks for the pointers given to resolve.</description>
      <pubDate>Thu, 31 Jan 2008 11:58:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/XMLInput-to-XML-column-in-MSSQLSERVER-Database/m-p/2214971#M11588</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-31T11:58:09Z</dc:date>
    </item>
  </channel>
</rss>

