According to the test cases:

http://tinyurl.com/77dbg
http://svn.apache.org/repos/asf/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/OracleClient/Category.xml

This should be the correct syntax:

 <insert id="InsertCategoryNull" parameterMap="insert-null-params">
  <selectKey property="Id" type="pre" resultClass="int">
   select s_categories.nextval as value from dual
  </selectKey>
  insert into Categories (Category_Id, Category_Name, Category_Guid)
  values (?,?,?)
 </insert>

It looks like your selectKey node is incorrect. The .Net version has a
slightly different syntax than the Java version. For example there is
no jdbcType attribute in the xml config files for .Net. It is replaced
by dbType. I suggest reading the IBatisNet documentation for more
information:

 http://ibatis.apache.org/downloads.html

--- Angel Valero <[EMAIL PROTECTED]> wrote:

>    Hi, I'm trying to do an insert with a selectKey
> (oracle database) statement like the next one, but it
> doesn´t assign the sequence value to the especified
> field. Any wrong in the next xml fragment?
>  
> <insert id="insertDocumento"
> parameterClass="Documento">
>                   <selectKey resultClass="int"
> keyProperty="ID_DOCUMENTO" > 
>                  SELECT DOCUMENTOS_SEQ.nextval AS
> ID_DOCUMENTO FROM DUAL
>             </selectKey>
>                       insert into gco_documentos
>                               (ID_DOCUMENTO, 
>                                ID_TEMPORADA, 
>                                FECHA, 
>                                DESCRIPCION, 
>                                FICHERO, 
>                                TIPO_DOC)
>                       values
>                               (#ID_DOCUMENTO#, 
>                                #ID_TEMPORADA#, 
>                                #FECHA#, 
>                                #DESCRIPCION#, 
>                                #FICHERO#, 
>                                #TIPO_DOC# )
>               </insert>
> 
> Thanks in advance
> 
> 
>               
> ______________________________________________ 
> Renovamos el Correo Yahoo! 
> Nuevos servicios, más seguridad 
> http://correo.yahoo.es
> 

Reply via email to