<?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>question Re: Nifi cannot handle DB2 BLOB data; sends 'Wrong result column type for requested conversion.' in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Nifi-cannot-handle-DB2-BLOB-data-sends-Wrong-result-column/m-p/107650#M70508</link>
    <description>&lt;P&gt;DB2 might be returning a different JDBC type for BLOB than what the processor is expecting, such that it tries to convert it to a String or something else rather than a byte array.&lt;/P&gt;&lt;P&gt;For your workaround, try a column alias for the case() function, so you can set the name of that column to something Avro will like, such as "blob_contents": &lt;/P&gt;&lt;PRE&gt;SELECT case(BLOBTBL.BLOB_CONTENTS as varchar(2000)) blob_contents FROM BLOB_DECOMP BLOBTBL fetch first 10 rows only with UR&lt;/PRE&gt;</description>
    <pubDate>Thu, 17 Nov 2016 06:19:18 GMT</pubDate>
    <dc:creator>mburgess</dc:creator>
    <dc:date>2016-11-17T06:19:18Z</dc:date>
    <item>
      <title>Nifi cannot handle DB2 BLOB data; sends 'Wrong result column type for requested conversion.'</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Nifi-cannot-handle-DB2-BLOB-data-sends-Wrong-result-column/m-p/107649#M70507</link>
      <description>&lt;P&gt;When using an SQL query with a "BLOB" content the following error is thrown:&lt;/P&gt;&lt;P&gt;ExecuteSQL Unable to execute SQL select query SELECT BLOBTBL.BLOB_CONTENTS FROM BLOB_DECOMP BLOBTBL fetch first 10 rows only with UR due to org.apache.nifi.processor.exception.ProcessException: com.ibm.db2.jcc.am.jo: [jcc][t4][1092][11638][3.57.110] Invalid data conversion: Wrong result column type for requested conversion. ERRORCODE=-4461, SQLSTATE=42815; routing to failure: org.apache.nifi.processor.exception.ProcessException: com.ibm.db2.jcc.am.jo: [jcc][t4][1092][11638][3.57.110] Invalid data conversion: Wrong result column type for requested conversion. ERRORCODE=-4461, SQLSTATE=42815&lt;/P&gt;&lt;P&gt;Tried the work around of using a 'cast' such as  SELECT case(BLOBTBL.BLOB_CONTENTS as varchar(2000))  FROM BLOB_DECOMP BLOBTBL fetch first 10 rows only with UR&lt;/P&gt;&lt;P&gt;But then the following is thrown:&lt;/P&gt;&lt;P&gt;"failed to process session due to org.apache.avro.SchemaParseException: Illegal initial character: 1: org.apache.avro.SchemaParseException: Illegal initial character: 1"&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2016 06:16:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Nifi-cannot-handle-DB2-BLOB-data-sends-Wrong-result-column/m-p/107649#M70507</guid>
      <dc:creator>murphy_sean</dc:creator>
      <dc:date>2016-11-17T06:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi cannot handle DB2 BLOB data; sends 'Wrong result column type for requested conversion.'</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Nifi-cannot-handle-DB2-BLOB-data-sends-Wrong-result-column/m-p/107650#M70508</link>
      <description>&lt;P&gt;DB2 might be returning a different JDBC type for BLOB than what the processor is expecting, such that it tries to convert it to a String or something else rather than a byte array.&lt;/P&gt;&lt;P&gt;For your workaround, try a column alias for the case() function, so you can set the name of that column to something Avro will like, such as "blob_contents": &lt;/P&gt;&lt;PRE&gt;SELECT case(BLOBTBL.BLOB_CONTENTS as varchar(2000)) blob_contents FROM BLOB_DECOMP BLOBTBL fetch first 10 rows only with UR&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Nov 2016 06:19:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Nifi-cannot-handle-DB2-BLOB-data-sends-Wrong-result-column/m-p/107650#M70508</guid>
      <dc:creator>mburgess</dc:creator>
      <dc:date>2016-11-17T06:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi cannot handle DB2 BLOB data; sends 'Wrong result column type for requested conversion.'</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Nifi-cannot-handle-DB2-BLOB-data-sends-Wrong-result-column/m-p/107651#M70509</link>
      <description>&lt;P&gt;Might need an "AS blob_contents", can't remember&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2016 06:19:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Nifi-cannot-handle-DB2-BLOB-data-sends-Wrong-result-column/m-p/107651#M70509</guid>
      <dc:creator>mburgess</dc:creator>
      <dc:date>2016-11-17T06:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi cannot handle DB2 BLOB data; sends 'Wrong result column type for requested conversion.'</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Nifi-cannot-handle-DB2-BLOB-data-sends-Wrong-result-column/m-p/107652#M70510</link>
      <description>&lt;P&gt;Thank you very much.  That worked great.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2016 06:30:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Nifi-cannot-handle-DB2-BLOB-data-sends-Wrong-result-column/m-p/107652#M70510</guid>
      <dc:creator>murphy_sean</dc:creator>
      <dc:date>2016-11-17T06:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi cannot handle DB2 BLOB data; sends 'Wrong result column type for requested conversion.'</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Nifi-cannot-handle-DB2-BLOB-data-sends-Wrong-result-column/m-p/107653#M70511</link>
      <description>&lt;P&gt;Just a quick clarification for others following this post the "SELECT" statement should use 'cast' and not 'case' as I have it above.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2016 07:04:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Nifi-cannot-handle-DB2-BLOB-data-sends-Wrong-result-column/m-p/107653#M70511</guid>
      <dc:creator>murphy_sean</dc:creator>
      <dc:date>2016-11-17T07:04:32Z</dc:date>
    </item>
  </channel>
</rss>

