<?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] File into BLOB in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-File-into-BLOB/m-p/2269926#M47993</link>
    <description>I solved this by creating by creating a small routine. I can then call it as a function in the tMap 
&lt;BR /&gt; public static Object ByteArrayFromFile(java.io.File file) { 
&lt;BR /&gt; try 
&lt;BR /&gt; { 
&lt;BR /&gt; java.io.FileInputStream fis = new java.io.FileInputStream(file); 
&lt;BR /&gt; int fileLength = (int) file.length(); 
&lt;BR /&gt; byte[] incoming_file_data = new byte; // allocate byte array of right size 
&lt;BR /&gt; fis.read(incoming_file_data, 0, fileLength ); // read into byte array 
&lt;BR /&gt; fis.close(); 
&lt;BR /&gt; return incoming_file_data; 
&lt;BR /&gt; } 
&lt;BR /&gt; catch(Exception err) 
&lt;BR /&gt; { 
&lt;BR /&gt; err.printStackTrace(); 
&lt;BR /&gt; return null; 
&lt;BR /&gt; } 
&lt;BR /&gt; 
&lt;BR /&gt;Works well in 2.2.2 and now 2.2.3</description>
    <pubDate>Thu, 06 Dec 2007 23:18:30 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2007-12-06T23:18:30Z</dc:date>
    <item>
      <title>[resolved] File into BLOB</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-File-into-BLOB/m-p/2269920#M47987</link>
      <description>I have a delimited file which I use to generate rows.  I go thru a replace and a tMap process.  At that point, I need to grab a file off of the filesystem based on a field value.  That file is then to be a BLOB in the given row.  I've got everything running well except I cannot find a clean way to get the file into the BLOB column.  Any help or suggestions would be appreciated.</description>
      <pubDate>Sat, 16 Nov 2024 14:29:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-File-into-BLOB/m-p/2269920#M47987</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T14:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] File into BLOB</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-File-into-BLOB/m-p/2269921#M47988</link>
      <description>Hi
&lt;BR /&gt;Set the datatype as 'Object' for BLOB column when define the schema in tMap.
&lt;BR /&gt;Best regards
&lt;BR /&gt; 
&lt;BR /&gt; shong</description>
      <pubDate>Fri, 30 Nov 2007 03:22:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-File-into-BLOB/m-p/2269921#M47988</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-11-30T03:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] File into BLOB</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-File-into-BLOB/m-p/2269922#M47989</link>
      <description>I do have that column as a BLOB.  How do I load a file off of the disk into an OBJECT column in the row?</description>
      <pubDate>Fri, 30 Nov 2007 19:01:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-File-into-BLOB/m-p/2269922#M47989</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-11-30T19:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] File into BLOB</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-File-into-BLOB/m-p/2269923#M47990</link>
      <description>Here is a simple example converting this simple delimited file with a reference to another file into a BLOB
&lt;BR /&gt;
&lt;PRE&gt;Samuel;Johnson;35;C:/temp/Samuel_Johnson.txt&lt;BR /&gt;David;Palmer;43;C:/temp/David_Palmer.txt&lt;/PRE&gt;
&lt;BR /&gt;Note the tMap conversion in the first capture.
&lt;BR /&gt;Regards,</description>
      <pubDate>Sun, 02 Dec 2007 20:33:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-File-into-BLOB/m-p/2269923#M47990</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-12-02T20:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] File into BLOB</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-File-into-BLOB/m-p/2269924#M47991</link>
      <description>This results in
&lt;BR /&gt;java.sql.SQLException: Unable to convert between java.io.File and JAVA_OBJECT.
&lt;BR /&gt;Any thoughts? I can do this in Java by copying byte arrays around but it is very slow.</description>
      <pubDate>Tue, 04 Dec 2007 22:36:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-File-into-BLOB/m-p/2269924#M47991</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-12-04T22:36:47Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] File into BLOB</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-File-into-BLOB/m-p/2269925#M47992</link>
      <description>Hi 
&lt;BR /&gt; 
&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;java.sql.SQLException: Unable to convert between java.io.File and JAVA_OBJECT.&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;Which version of TOS did you use? Can you succeed in create a simple job as mhirt did? 
&lt;BR /&gt;Best regards 
&lt;BR /&gt; 
&lt;BR /&gt; shong</description>
      <pubDate>Wed, 05 Dec 2007 03:18:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-File-into-BLOB/m-p/2269925#M47992</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-12-05T03:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] File into BLOB</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-File-into-BLOB/m-p/2269926#M47993</link>
      <description>I solved this by creating by creating a small routine. I can then call it as a function in the tMap 
&lt;BR /&gt; public static Object ByteArrayFromFile(java.io.File file) { 
&lt;BR /&gt; try 
&lt;BR /&gt; { 
&lt;BR /&gt; java.io.FileInputStream fis = new java.io.FileInputStream(file); 
&lt;BR /&gt; int fileLength = (int) file.length(); 
&lt;BR /&gt; byte[] incoming_file_data = new byte; // allocate byte array of right size 
&lt;BR /&gt; fis.read(incoming_file_data, 0, fileLength ); // read into byte array 
&lt;BR /&gt; fis.close(); 
&lt;BR /&gt; return incoming_file_data; 
&lt;BR /&gt; } 
&lt;BR /&gt; catch(Exception err) 
&lt;BR /&gt; { 
&lt;BR /&gt; err.printStackTrace(); 
&lt;BR /&gt; return null; 
&lt;BR /&gt; } 
&lt;BR /&gt; 
&lt;BR /&gt;Works well in 2.2.2 and now 2.2.3</description>
      <pubDate>Thu, 06 Dec 2007 23:18:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-File-into-BLOB/m-p/2269926#M47993</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-12-06T23:18:30Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] File into BLOB</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-File-into-BLOB/m-p/2269927#M47994</link>
      <description>Hi All,&lt;BR /&gt;i am struggling with the process of inserting image in sql server using talend. I have even gone through the process mentioned help.talend.com.&lt;BR /&gt;As i am new to talend so i dont have much idea. can anybody help me with detailed process of doing so.&lt;BR /&gt;Thanks &amp;amp; Regards</description>
      <pubDate>Tue, 19 Apr 2016 06:42:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-File-into-BLOB/m-p/2269927#M47994</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-19T06:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] File into BLOB</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-File-into-BLOB/m-p/2269928#M47995</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I've solved it by adding a tJavaRow with following content, before tMap:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;java.io.File file = new java.io.File(((String)globalMap.get("tFileInputRaw_1_FILENAME_PATH")));
java.io.FileInputStream fis = new java.io.FileInputStream(file);
int fileLength = (int) file.length();
byte[] incoming_file_data = new byte[fileLength]; // allocate byte array of right size
fis.read(incoming_file_data, 0, fileLength ); // read into byte array
fis.close();
output_row.content = incoming_file_data;&lt;/PRE&gt; 
&lt;P&gt;I attach sample job screenshot.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;1) tFileList loops through files to load&lt;/P&gt; 
&lt;P&gt;2)&amp;nbsp;tFileInputRaw reads each file as Object&lt;/P&gt; 
&lt;P&gt;3)&amp;nbsp;tJavaRow converts Object to byte[]&lt;/P&gt; 
&lt;P&gt;4) tMap retrieves byte[]&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;5) tOracleOutput stores byte[] column as BLOB DB internal type&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Hope it helps!&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009LsZ1"&gt;2018-05-03_13h18_29.png&lt;/A&gt;</description>
      <pubDate>Thu, 03 May 2018 12:21:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-File-into-BLOB/m-p/2269928#M47995</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-05-03T12:21:18Z</dc:date>
    </item>
  </channel>
</rss>

