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