Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 70336 invoked from network); 25 Dec 2005 14:42:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 25 Dec 2005 14:42:55 -0000 Received: (qmail 6561 invoked by uid 500); 25 Dec 2005 14:42:54 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 6325 invoked by uid 500); 25 Dec 2005 14:42:53 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 6310 invoked by uid 99); 25 Dec 2005 14:42:53 -0000 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=SPF_FAIL X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Dec 2005 06:42:53 -0800 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 1EF5BCB for ; Sun, 25 Dec 2005 15:42:32 +0100 (CET) Message-ID: <58249484.1135521752126.JavaMail.jira@ajax.apache.org> Date: Sun, 25 Dec 2005 15:42:32 +0100 (CET) From: "Thomas Dudziak (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-785) Cannot specify default value for DECIMAL(15,15) column In-Reply-To: <67475114.1135516711183.JavaMail.jira@ajax.apache.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DERBY-785?page=comments#action_12361224 ] Thomas Dudziak commented on DERBY-785: -------------------------------------- Ups, sorry, my bad. Obviously I cannot specify a default value here with a something other than 0 before the fixed point. I would mark this issue invalid if I could ;-) Btw. for some reason this works: CREATE TABLE test ( pk INTEGER NOT NULL, value NUMERIC(15,15) DEFAULT 1 NOT NULL, PRIMARY KEY (pk) ); Also, if I try to insert something into this column, say: PreparedStatement pstmt = conn.prepareStatement("INSERT INTO test (pk, value) VALUEs (?, ?)"); pstmt.setInt(1, 1); pstmt.setBigDecimal(2, new BigDecimal("1")); pstmt.execute(); then I get this exception (which is somewhat misleading): Exception in thread "main" org.apache.derby.client.am.SqlException: BigDecimal conversion exception [converters] Overflow occurred during numeric data type conversion of "1".. See attached Throwable. at org.apache.derby.client.net.Request.writeBigDecimal(Unknown Source) at org.apache.derby.client.net.NetStatementRequest.buildFDODTA(Unknown Source) at org.apache.derby.client.net.NetStatementRequest.buildSQLDTAcommandData(Unknown Source) at org.apache.derby.client.net.NetStatementRequest.writeExecute(Unknown Source) at org.apache.derby.client.net.NetPreparedStatement.writeExecute_(Unknown Source) at org.apache.derby.client.am.PreparedStatement.writeExecute(Unknown Source) at org.apache.derby.client.am.PreparedStatement.flowExecute(Unknown Source) at org.apache.derby.client.am.PreparedStatement.executeX(Unknown Source) at org.apache.derby.client.am.PreparedStatement.execute(Unknown Source) at Main.main(Main.java:28) > Cannot specify default value for DECIMAL(15,15) column > ------------------------------------------------------ > > Key: DERBY-785 > URL: http://issues.apache.org/jira/browse/DERBY-785 > Project: Derby > Type: Bug > Components: SQL > Versions: 10.1.2.1 > Environment: Windows XP, Java 5 > Reporter: Thomas Dudziak > > Creating this table does not work: > CREATE TABLE test > ( > pk INTEGER NOT NULL, > value DECIMAL(15,15) DEFAULT 1.0 NOT NULL, > PRIMARY KEY ("PK") > ); > It does work however without the default value, e.g. > CREATE TABLE test > ( > pk INTEGER NOT NULL, > value DECIMAL(15,15) NOT NULL, > PRIMARY KEY ("PK") > ); > or when reducing the scale: > CREATE TABLE test > ( > pk INTEGER NOT NULL, > value DECIMAL(15,14) DEFAULT 1.0 NOT NULL, > PRIMARY KEY ("PK") > ); > The same holds true for a NUMERIC column. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira