Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 87722 invoked from network); 13 Sep 2006 13:53:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Sep 2006 13:53:28 -0000 Received: (qmail 57743 invoked by uid 500); 13 Sep 2006 13:53:27 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 57477 invoked by uid 500); 13 Sep 2006 13:53:26 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 57466 invoked by uid 99); 13 Sep 2006 13:53:26 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Sep 2006 06:53:26 -0700 Authentication-Results: idunn.apache.osuosl.org smtp.mail=Christian.Poitras@ircm.qc.ca; spf=permerror X-ASF-Spam-Status: No, hits=1.6 required=5.0 tests=DNS_FROM_RFC_BOGUSMX,FORGED_RCVD_HELO,HTML_40_50,HTML_MESSAGE Received-SPF: error (idunn.apache.osuosl.org: domain ircm.qc.ca from 207.162.51.5 cause and error) Received: from ([207.162.51.5:20002] helo=pandore.ircm.priv) by idunn.apache.osuosl.org (ecelerity 2.1 r(10620)) with ESMTP id A7/34-09463-36D08054 for ; Wed, 13 Sep 2006 06:53:40 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C6D73B.F82A6D6C" Subject: RE: How to pass a parameter with DECIMAL data type Date: Wed, 13 Sep 2006 09:53:19 -0400 Message-ID: <5820E7E2A928DB46824297946AC2024A9A5FC7@pandore.ircm.priv> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: How to pass a parameter with DECIMAL data type Thread-Index: AcbWrlz/WaRVxqq+Qh+YiDN6taMr9AAjVSNw From: "Poitras Christian" To: X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------_=_NextPart_001_01C6D73B.F82A6D6C Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable If your passing a double to iBATIS, it won't truncate it to DECIMAL(5,2) before calling the procedure. You should truncate the data yourself to 2 decimals in the procedure or in the sql. =20 Christian ________________________________ From: Brad Balmer [mailto:bbalmer@peapod.com]=20 Sent: Tuesday, 12 September 2006 16:59 To: user-java@ibatis.apache.org Subject: Re: How to pass a parameter with DECIMAL data type If you are using MySQL 5, could this be an issue using strict sql mode? Cs2000xli@cs.com wrote:=20 I am passing a parameter for DECIMAL(5, 2) to a stored procedure. I have the following parameterMap. {call sp_getInfo(?)} =09 When I call the stored procedure using DAO object, I got the following error sql error with the cause. =09 --- Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data truncated for column 'dollarAmount' at row 1 =09 What did I do wrong? =09 Thanks! =09 Xiao. =09 =09 --=20 ___________________________ Brad Balmer Application Architect Peapod, Inc. 847-583-6306 This email may contain confidential or legally privileged information that is intended only for the individual or entity named as the recipient. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or reliance upon the contents of this email is strictly prohibited. If you have received this email in error, please contact the sender so that proper delivery can be arranged, and then please delete this message. Thank you. ------_=_NextPart_001_01C6D73B.F82A6D6C Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
If your passing a double to iBATIS, it won't = truncate it=20 to DECIMAL(5,2) before calling the procedure.
You should truncate the data yourself to 2 = decimals in the=20 procedure or in the sql.
 
Christian


From: Brad Balmer = [mailto:bbalmer@peapod.com]=20
Sent: Tuesday, 12 September 2006 16:59
To:=20 user-java@ibatis.apache.org
Subject: Re: How to pass a = parameter with=20 DECIMAL data type

If you are using MySQL 5, could this be an issue using strict sql mode?



Cs2000xli@cs.com wrote:=20
I am passing a parameter for DECIMAL(5, 2) to a stored = procedure.=20 I have the following parameterMap.
<parameterMap = id=3D"getInfoMap"=20 class=3D"map" >
  <parameter property=3D"dollarAmount"=20 jdbcType=3D"DECIMAL" javaType=3D"java.math.BigDecimal"=20 mode=3D"IN"/>
</parameterMap>
<procedure = id=3D"getInfo"=20 parameterMap=3D"getInfoMap">
      = {call=20 sp_getInfo(?)}
</procedure>

When I call the stored = procedure=20 using DAO object, I got the following error sql error with the=20 cause.

--- Cause: com.mysql.jdbc.MysqlDataTruncation: Data = truncation:=20 Data truncated for column 'dollarAmount' at row 1

What did I do = = wrong?

Thanks!

Xiao.


=
--=20

___________________________
Brad Balmer
Application Architect
Peapod, Inc.
847-583-6306

This email may contain confidential or legally privileged information =
that is intended only for the individual or entity named as the =
recipient. If you are not the intended recipient, you are hereby =
notified that any disclosure, copying, distribution, or reliance upon =
the contents of this email is strictly prohibited. If you have received =
this email in error, please contact the sender so that proper delivery =
can be arranged, and then please delete this message. Thank =
you.
------_=_NextPart_001_01C6D73B.F82A6D6C--