Return-Path: X-Original-To: apmail-db-derby-user-archive@www.apache.org Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 74172D7A5 for ; Wed, 19 Dec 2012 15:47:05 +0000 (UTC) Received: (qmail 49129 invoked by uid 500); 19 Dec 2012 15:47:05 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 49053 invoked by uid 500); 19 Dec 2012 15:47:04 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 49040 invoked by uid 99); 19 Dec 2012 15:47:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Dec 2012 15:47:04 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of bpendleton.derby@gmail.com designates 209.85.160.53 as permitted sender) Received: from [209.85.160.53] (HELO mail-pb0-f53.google.com) (209.85.160.53) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Dec 2012 15:46:56 +0000 Received: by mail-pb0-f53.google.com with SMTP id jt11so1295837pbb.26 for ; Wed, 19 Dec 2012 07:46:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=s1aW1UEK9K6YEaVwNJtFZPsgpLaoeEIHETtC1+vIdxQ=; b=Cz255l9Fj5RpX8aKpr//R1dDNV3mjsV10u4vCE7sUr+3eJtQYcLWjGiJZ/moPOxcCn YzdbXHmrvEMIWITUVnITdllXXWseJNIcl9qfZu42C8NvaJCeFSw9fzae2eTNXwnDbR+n oDNpzq1Y5ENVxuBUBkqzwEupdkTWrytXCUhDoiFWOGCqXaqGMF6tDhfCLCqDElb5ErTD Aqvuta2XLYJACd4LJiy4lUQ0b/xdgzjxFiRSVEo8IpSEPMkoWhiMbOGj9L14Kw/6CMZw 0bQLLWYvUKg+c3tjxRJzDuSBp4SBledeXy9B0he4skOqLYhhob6DhFS/xFalYKbpJefr gVeA== X-Received: by 10.66.84.10 with SMTP id u10mr18672764pay.24.1355931990773; Wed, 19 Dec 2012 07:46:30 -0800 (PST) Received: from [192.168.0.102] (c-67-170-231-73.hsd1.ca.comcast.net. [67.170.231.73]) by mx.google.com with ESMTPS id hc4sm3300472pbc.30.2012.12.19.07.46.29 (version=SSLv3 cipher=OTHER); Wed, 19 Dec 2012 07:46:30 -0800 (PST) Message-ID: <50D1E0E2.1010705@gmail.com> Date: Wed, 19 Dec 2012 07:44:34 -0800 From: Bryan Pendleton User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: =?GB2312?B?zfXQ8Q==?= , derby-user@db.apache.org Subject: Re: Some questions about the Derby References: <012f01cddde1$cae09b70$60a1d250$@sinosoft.com.cn> In-Reply-To: <012f01cddde1$cae09b70$60a1d250$@sinosoft.com.cn> Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Forwarding to the list. On 12/19/2012 04:10 AM, ���� wrote: > *Hello Pendleton* > > ** > > *I am a loyal user of derby database from China. I found some problems > in the course of use, so I need your help urgently.* > > ** > > *Derby Version**��**10.4* > > *Question one**��*** > > Firstly, I created a table. > > CREATE TABLE CV > > ( > > AGE INTEGER NOT NULL, > > RT DECIMAL(20,10), > > PRIMARY KEY (AGE) > > ) > > Then innserted data "insert into CV VALUES (80��10729.5000000000)" > > Finally, an error occured when the SQL statement > "select?(95000.0*1000/1000)/1000.0?*?RT?from?CV?where?Age=80?" was > executed, it displayed "the generated value has gone beyond the data > type of DECIMAL / NUMERIC (31,25)". > > Could you tell me how Derby do the precision control and operation on > the data type of DECIMAL when it performs a variety of arithmetic > operations including add, subtract, multiply and divide? > > *Question two**��*** > > Firstly, I created a table. > > CREATE TABLE CV > > ( > > AGE SMALLINT, > > RT DOUBLE, > > PRIMARY KEY (AGE) > > ) > > Then innserted data "insert into CV VALUES (20��766.3)" > > Finally, I got results of "268204.99999999994" after executing the SQL > statement "select 350000.0/1000 * RT from CV the where age = 20?", but > the actual result should be "268205.0". > > Could you tell me whether the cause of problem is inaccurated data from > a floating-point type double. > > *Let me know whether the above problems are the Derby Bug? Are there any > other similar problems on the version in use? And how should we deal with?* > > *Look forward to your reply, thank you!* > > From Apollo.Wong >