ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emiliano Armellin <earmel...@ateikon.com>
Subject Re: selectkey in sybase
Date Wed, 30 May 2007 09:08:15 GMT
thanks for the answer, I've just tried with no success
the error is the same!

I'm using jconnect6, asa 9 and ibatis 2.3

where is the error?


-- 
Emiliano Armellin

    *
      W_
      www.ateikon.com <http://www.ateikon.com>
    *
      @_
      earmellin@ateikon.com <mailto:earmellin@ateikon.com>
    *
      T_
      *+39 0422 452101*

Get Firefox! <http://www.spreadfirefox.com/?q=affiliates&id=15653&t=86>
Get Thunderbird <http://www.mozilla.org/products/thunderbird/>






Christopher.Mathrusse@sybase.com ha scritto:
> I think you need to specify the alias as follows:
>  
>
> <selectKey keyProperty="tkreq" type="post" resultClass="java.lang.Long">
>
> select @@IDENTITY AS tkreq
>
> </selectKey>
>
> and it is always a good idea to specify the type. (pre or post) I 
> can't remember which is the default so I always specify the value so 
> it is clear. This should work as I am using it with Sybase ASE 12.0 
> without any issues.
>
>
> ------------------------------------------------------------------------
> *From:* Emiliano Armellin <earmellin@ateikon.com> [mailto:Emiliano 
> Armellin <earmellin@ateikon.com>]
> *Sent:* Monday, May 28, 2007 2:39 AM
> *To:* user-java@ibatis.apache.org
> *Subject:* selectkey in sybase
>
> Hello,
>
> I'm trying the selectkey statement in sybase, using abator generated 
> map but I've got this error:
>
> |org.springframework.jdbc.UncategorizedSQLException: SqlMapClient 
> operation; uncategorized SQLException for SQL []; SQL state [JZ0TE]; 
> error code [0];  
> --- The error occurred in 
> com/ateikon/internet/eprogen/dao/ibatis/maps/pgmr/pgmr_atk_request_SqlMap.xml.  
>
> --- The error occurred while applying a result map. 
> --- Check the 
> pgmr_atk_request.abatorgenerated_insert-SelectKey-AutoResultMap. 
> --- Check the result mapping for the '@@identity' property. 
> --- Cause: java.sql.SQLException: JZ0TE: Attempted conversion between 
> an illegal pair of types. Valid database datatypes are: 'tinyint, 
> smallint, int, bit, float, decimal, numeric, char, unichar, varchar, 
> univarchar, text, unitext,  money, short money, unsigned bigint'; 
> nested exception is 
> com.ibatis.common.jdbc.exception.NestedSQLException:   |
>
>
> the generated insert:
>
> |  <insert id="abatorgenerated_insert" 
> parameterClass="com.ateikon.internet.eprogen.domain.pgmr.Atk_request">
>     insert into pgmr.atk_request (emaildest, cdazie, cddipa, profil, 
> dtinse, dtulag)
>     values (#emaildest:VARCHAR#, #cdazie:VARCHAR#, #cddipa:VARCHAR#, 
> #profil:VARCHAR#,
>       #dtinse:TIMESTAMP#, #dtulag:TIMESTAMP#)
>     <selectKey keyProperty="tkreq" resultClass="java.lang.Long">
>       select @@identity
>     </selectKey>
>   </insert>
>
>
> |
> it seems correct... so why thi error? I can't set selectkey result map...
>
> thanks



Mime
View raw message