ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Barry <paul.ba...@nyu.edu>
Subject Re: selectKey problem
Date Fri, 21 Jan 2005 20:57:26 GMT
What's the datatype in the DB of the id column in the SD_METRIC_LOG 
table?  You might have to use #id:NUMERIC# so it can be correctly 
converted in your SQL statement.  Could be with any of the columns in 
the SD_METRIC_LOG table.

Nathan Maves wrote:
> using the statement below we are getting an invalid column type error. 
> The Log class has a String property named id, and the oracle sequence 
> works fine.
> 
> <insert id="insertMetricLog" parameterClass="Log">
>     <selectKey resultClass="string" keyProperty="id">
>         select SD_METRIC_LOG_CURRENT_ID.nextval as id from dual
>     </selectKey>
>     insert into SD_METRIC_LOG (
>         id,
>         emp_id,
>         modified_date,
>         dashboard_id,
>         category_id,
>         metric_id,
>         log
>         ) values (
>         #id#,
>         #employeeNumber#,
>         SYSDATE,
>         (select dashboard_id from SD_CATEGORY where id =
>             (select category_id from SD_METRIC where id = #metricId#)),
>         (select category_id from SD_METRIC where id = #metricId#),
>         #metricId#,
>         #log#
>         )
>   </insert>
> 
> Nathan

Mime
View raw message