<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:clearspace="http://www.jivesoftware.com/xmlns/jive/rss" version="2.0">
  <channel>
    <title>Adobe Community: Message List - Oracle error ORA-01461when trying to insert into an ORACLE BLOB field</title>
    <link>https://forums.adobe.com/community/coldfusion/coldfusion_database?view=discussions</link>
    <description>Most recent forum messages</description>
    <language>en</language>
    <pubDate>Wed, 05 Mar 2014 22:32:19 GMT</pubDate>
    <generator>Jive Engage 7.0.0.1  (http://jivesoftware.com/products/)</generator>
    <dc:date>2014-03-05T22:32:19Z</dc:date>
    <dc:language>en</dc:language>
    <item>
      <title>Oracle error ORA-01461when trying to insert into an ORACLE BLOB field</title>
      <link>https://forums.adobe.com/message/6182953?tstart=0#6182953</link>
      <description>&lt;!-- [DocumentBodyStart:764f126c-4db8-4d05-b441-52201c248661] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;I am getting Oracle error &amp;lsquo;ORA-01461: can bind a LONG value only&amp;nbsp; for insert into a LONG column' when trying to insert into an ORACLE BLOB field. The error occurs when trying to insert a large BLOB (JPG), but does not occur when inserting a small (&amp;lt;1K) picture BLOB.(JPG). Any ideas?&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;BTW, when using a SQL Server datasource using the same code.... everything works with no problems.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;ORACLE version is 11.2.0.1&lt;/p&gt;&lt;p&gt;The ORACLE datasource is JDBC using Oracle's JDBC driver ojdbc6.jar v11.2.0.1 (I also have tried ojdbc5.jar v11.2.0.1; ojdbc5.jar v11.2.0.4; and ojdbc6.jar v11.2.0.4 with the same error result.)&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Here is my code:&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;lt;cfset file_mime = Lcase(Right(postedXMLRoot.objname.XmlText, 3))&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;lt;cfif file_mime EQ 'jpg'&amp;gt;&amp;lt;cfset file_mime = 'jpeg'&amp;gt;&amp;lt;/cfif&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;lt;cfset file_mime = 'data:image/' &amp;amp; file_mime &amp;amp; ';base64,'&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;lt;cfset image64 = ImageReadBase64("#file_mime##postedXMLRoot.objbase64.XmlText#")&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;lt;cfset ramfile = "ram://" &amp;amp; postedXMLRoot.objname.XmlText&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;lt;cfimage action="write" source="#image64#" destination="#ramfile#" overwrite="true"&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;lt;cffile action="readbinary" file="#ramfile#" variable="image_bin"&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;lt;cffile action="delete" file="#ramfile#"&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;lt;cfquery name="InsertImage" datasource="#datasource#"&amp;gt;&lt;/p&gt;&lt;p&gt;INSERT INTO test_images&lt;/p&gt;&lt;p&gt;( &lt;/p&gt;&lt;p&gt;image_blob&lt;/p&gt;&lt;p&gt;)&lt;/p&gt;&lt;p&gt;SELECT&lt;/p&gt;&lt;p&gt;&amp;lt;cfqueryparam value="#image_bin#" cfsqltype="CF_SQL_BLOB"&amp;gt;&lt;/p&gt;&lt;p&gt;FROM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dual&lt;/p&gt;&lt;p&gt;&amp;lt;/cfquery&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:764f126c-4db8-4d05-b441-52201c248661] --&gt;&lt;img src='/beacon?t=1415921123376' /&gt;</description>
      <pubDate>Wed, 05 Mar 2014 22:32:19 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/message/6182953?tstart=0#6182953</guid>
      <dc:date>2014-03-05T22:32:19Z</dc:date>
      <clearspace:dateToText>8 months 1 week ago</clearspace:dateToText>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
  </channel>
</rss>

