Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 6993 invoked from network); 15 Feb 2011 08:42:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Feb 2011 08:42:24 -0000 Received: (qmail 52274 invoked by uid 500); 15 Feb 2011 08:42:24 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 52019 invoked by uid 500); 15 Feb 2011 08:42:22 -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 52002 invoked by uid 99); 15 Feb 2011 08:42:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Feb 2011 08:42:21 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Feb 2011 08:42:18 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 919521A5F3D for ; Tue, 15 Feb 2011 08:41:57 +0000 (UTC) Date: Tue, 15 Feb 2011 08:41:57 +0000 (UTC) From: "Knut Anders Hatlen (JIRA)" To: derby-dev@db.apache.org Message-ID: <1469902178.17076.1297759317592.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <804014703.16584.1297738797476.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] Commented: (DERBY-5042) ResultSet.updateBoolean() on new BOOLEAN type throws exception MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-5042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12994697#comment-12994697 ] Knut Anders Hatlen commented on DERBY-5042: ------------------------------------------- > Does/will ALTER TABLE support a change from SMALLINT to BOOLEAN? ALTER TABLE doesn't support changing the type of the column at all, currently. It only allows changing the length of those types that have a length attribute (VARCHAR, BLOB, CLOB, etc). ij> create table t(x smallint); 0 rows inserted/updated/deleted ij> insert into t values 0,1,1,0,1,0,0,1; 8 rows inserted/updated/deleted ij> alter table t alter column x set data type boolean; ERROR 42Z15: Invalid type specified for column 'X'. The type of a column may not be changed. > ResultSet.updateBoolean() on new BOOLEAN type throws exception > -------------------------------------------------------------- > > Key: DERBY-5042 > URL: https://issues.apache.org/jira/browse/DERBY-5042 > Project: Derby > Issue Type: Bug > Affects Versions: 10.7.1.1 > Environment: OS X 10.6.5, Java 1.6 > Reporter: Brett Wooldridge > Assignee: C.S. Nirmal J. Fernando > > I am encountering an error trying to update a BOOLEAN type through an > updatable ResultSet. My table looks like this: > CREATE TABLE file_store ( > path VARCHAR(255) NOT NULL, > network VARCHAR(32) NOT NULL, > file_blob BLOB, > file_md5 VARCHAR(32), > is_directory BOOLEAN NOT NULL DEFAULT false, > PRIMARY KEY (path, network) > ); > My SQL looks like this: > SELECT path, network, is_directory FROM file_store > WHERE path=? AND network=? AND is_directory=true FOR UPDATE OF path, network, is_directory > My Java code looks like this: > ... > resultSet.moveToInsertRow(); > resultSet.updateString("path", dirPath); > resultSet.updateString("network", network); > resultSet.updateBoolean("is_directory", true); > resultSet.insertRow(); > An exception is thrown in the call to updateBoolean() as follows: > java.sql.SQLException: An attempt was made to put a data value of type 'byte' into a data value of type 'BOOLEAN'. > It's a shame, I was looking forward to using the new BOOLEAN type before I roll out the next version of our software. For now I will fallback to SMALLINT. Does/will ALTER TABLE support a change from SMALLINT to BOOLEAN? -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira