ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Warren Bell" <war...@clarksnutrition.com>
Subject RE: Cannot convert CRV100 to a numeric(30,6)
Date Mon, 07 Mar 2005 22:02:25 GMT
I am still getting the same exception message:

com.sybase.jdbc2.jdbc.SybSQLException: ASA Error -157: Cannot convert CRV100
to a numeric(30,6)

I have tried the sql map below and it works:

<select id="getItem" parameterClass="item" resultMap="get-Item-Result">
  SELECT INV_ScanCode FROM StockInventory WHERE INV_ScanCode = '65801011111
'
</select>

I have tried this sql map and it does not work:

<select id="getItem" parameterClass="item" resultMap="get-Item-Result">
  SELECT INV_ScanCode FROM StockInventory WHERE INV_ScanCode = #upc:CHAR#
</select>

upc is a String and I have had it equal '65801011111   ', 'abcde' and
'65801011111'. I get the same exception with all three. I replaced the view
I was using with the table StockInventory. Why does the first map work and
the second does not? Is this still a driver issue?

-----Original Message-----
From: Warren Bell [mailto:warren@clarksnutrition.com]
Sent: Saturday, March 05, 2005 1:11 PM
To: ibatis-user-java@incubator.apache.org; cbegin@ibatis.com
Subject: RE: Cannot convert CRV100 to a numeric(30,6)


It's a view, I will test it out.

Thanks

-----Original Message-----
From: Clinton Begin [mailto:clinton.begin@gmail.com]
Sent: Friday, March 04, 2005 1:41 PM
To: ibatis-user-java@incubator.apache.org
Subject: Re: Cannot convert CRV100 to a numeric(30,6)


This isn't an ibatis error.  It's usually a problem with a join (which
you don't have) or some implicit conversion that takes place somewhere
in the statement.  It can happen inside of views or other indirect
relationships.

Cheers,
Clinton


On Fri, 4 Mar 2005 13:32:21 -0800, Warren Bell
<warren@clarksnutrition.com> wrote:
> I am getting the following Exception message:
>
> ASA Error -157: Cannot convert CRV100 to a numeric(30,6)
>
> I am running Sybase with a JConnect JDBC driver. This is the correct
driver
> for this db. My sql map is:
>
> <resultMap id="get-Item-Result" class="item">
>   <result property="upc" column="INV_ScanCode" javaType="string"
> jdbcType="CHAR" nullValue="NULL"/>
> </resultMap>
>
> <select id="getItem" parameterClass="item" resultMap="get-Item-Result">
>   SELECT INV_ScanCode FROM v_InventoryMaster WHERE INV_ScanCode =
#upc:CHAR#
> </select>
>
> I have simplified this map to locate the problem. The upc property is a
> string and the INV_ScanCode column is a CHAR(14). I have been explicit
about
> the javaType and jdbcType, but the driver still throws this exception. If
I
> run the following map it works fine:
>
> <select id="getItem" parameterClass="item" resultMap="get-Item-Result">
>   SELECT INV_ScanCode FROM v_InventoryMaster WHERE INV_ScanCode =
> '65801011111   '
> </select>
>
> I have tried many different combinations but I can not get it to work. Any
> help will be greatly appreciated.
>
> Thanks,
>
> Warren Bell
> Systems Administrator
> Clark's Nutritional Centers
>
>




Mime
View raw message