Hi,
Have you try to set a size on your parameter
as in Unit test
<
parameter property="PictureData" dbType="Blob" size="4000"/> -GillesOn 9/5/05, Sebastien Lucas <[EMAIL PROTECTED]> wrote:
Hi,
I use IBatis.Net for a big project and without any problem ....... except today.
First the background : I use the DataMapper 1.2.1 with c# and my database is Oracle 10g.
my problem is with the only table of my project with a Blob column. Here is the sql :
CREATE TABLE T_FACE_PHOTO (
FPH_NUM NUMBER (10) NOT NULL,
FPH_IMAGE BLOB NOT NULL,
FPH_COMMENTAIRES VARCHAR2 (4000),
FPH_FAC_CODE VARCHAR2 (20) NOT NULL,
USER_CREATION VARCHAR2 (50),
DATE_CREATION DATE,
USER_MODIF VARCHAR2 (50),
DATE_MODIF DATE,
VERSION NUMBER (3) DEFAULT 0 NOT NULL,
CONSTRAINT PK_T_FACE_PHOTO
PRIMARY KEY ( FPH_NUM ) ) ;
I built the following sqlmap :
<?xml version='1.0 '?>
<!-- ATTENTION: Ceci est un fichier genere automatiquement. Ne pas modifier -->
<sqlMap namespace="TFacePhoto" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="SqlMap.xsd">
<alias>
<typeAlias alias="TFacePhoto" type="GB.Persistance.Metier.Patrimoine.TFacePhoto , Persistance" />
</alias>
<statements>
<insert id="insertTFacePhoto" parameterMap="insert-tfacephoto-param" >
<selectKey resultClass="int" type="pre" property="DbNum" >
select FPH_NUM.nextval as value from dual
</selectKey>
insert into T_FACE_PHOTO
(FPH_NUM, FPH_COMMENTAIRES, FPH_FAC_CODE, FPH_IMAGE, USER_CREATION, USER_MODIF, DATE_MODIF, VERSION)
values
(?, ?, ?, ?, ?, ?, ?)
</insert>
</statements>
<parameterMaps>
<parameterMap id="insert-tfacephoto-param">
<parameter property="DbNum" />
<parameter property="DbCommentaires" />
<parameter property="DbFacCode" />
<parameter property="DbImage" dbType="Blob"/>
<parameter property="DbUserCreation" />
<parameter property="DbUserModif" />
<parameter property="DbDateModif" />
<parameter property="DbVersion" />
</parameterMap>
</parameterMaps>
</sqlMap>
This sqlmap cause an Oracle ORA01036 error each time I try to insert a row in the database.
The funny part is that if I remove the parameter DbDateModif and change the insert to also remove the column DATE_MODIF, I can insert without any problem.
My c# class shouldn't be the problem, So I'm totally lost here.
Thanks in advance for any hints or (better) a solution ;)
Sebastien

