-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: BLOB filed problem
PostPosted: Tue Mar 31, 2009 9:30 am 
Hi everyone.

I'm having a problem when inserting data into BLOB filed.


ORA:-00932: inconsistent datatypes: expected - got BLOB


I'm using NHibernate 2.0 and Oracle 11g.

This is my mapping file
Code:
<?xml version="1.0" encoding="utf-8" ?>

<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
                   assembly="ProjetoGEO"
                   namespace="ProjetoGEO.modelo">

  <class name="Arquivo" table="Arquivo">

    <id name="id"
        column="ID"
        type="Int32">
      <generator class="identity" />
    </id>

    <!-- # COLUNAS # -->
    <property name="dado"
              type="BinaryBlob"
              column="DADO"
              not-null="true" />

    <!-- #FIM COLUNAS# -->
   
  </class>

</hibernate-mapping>


Here is my code to read a file.
Code:
            try {
                FileStream fs = new FileStream("test.pdf", FileMode.Open, FileAccess.Read);

                BinaryReader br = new BinaryReader(fs);

                long numBytes = new FileInfo("test.pdf").Length;

                arq = br.ReadBytes((int)numBytes);

            }

            catch (Exception ex) {

                throw ex;

            }



Tks


Top
  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.