Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 14287 invoked from network); 11 Apr 2006 23:01:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 Apr 2006 23:01:44 -0000 Received: (qmail 82039 invoked by uid 500); 11 Apr 2006 23:01:43 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 81999 invoked by uid 500); 11 Apr 2006 23:01:43 -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 81990 invoked by uid 99); 11 Apr 2006 23:01:43 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Apr 2006 16:01:43 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= 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; Tue, 11 Apr 2006 16:01:42 -0700 Received: from ajax (localhost.localdomain [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id A04B9D4A02 for ; Wed, 12 Apr 2006 00:01:21 +0100 (BST) Message-ID: <1621552739.1144796481654.JavaMail.jira@ajax> Date: Wed, 12 Apr 2006 00:01:21 +0100 (BST) From: "Mike Matrigali (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-896) Cast date to timestamp results in "ERROR 42846: Cannot convert types 'DATE' to 'TIMESTAMP'." In-Reply-To: <1022001272.1138710033081.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-896?page=all ] Mike Matrigali updated DERBY-896: --------------------------------- Component: SQL > Cast date to timestamp results in "ERROR 42846: Cannot convert types 'DATE' to 'TIMESTAMP'." > -------------------------------------------------------------------------------------------- > > Key: DERBY-896 > URL: http://issues.apache.org/jira/browse/DERBY-896 > Project: Derby > Type: Bug > Components: SQL > Versions: 10.1.2.1 > Environment: --------- Derby Information -------- > JRE - JDBC: J2SE 1.4.2 - JDBC 3.0 > [D:\Programme\Derby\bin\lib\derby.jar] 10.1.2.1 - (330608) > [D:\Programme\Derby\bin\lib\derbytools.jar] 10.1.2.1 - (330608) > Reporter: Oleksandr Alesinskyy > > Cast date to timestamp results in "ERROR 42846: Cannot convert types 'DATE' to 'TIMESTAMP'.", > e.g. in ij: > select cast(cast ('2006-01-01' as date) as timestamp) from sys.sysschemas; > or > select cast (current_date as timestamp) from bradi_dat.lpaip01; > The similar issue exists for time ("ERROR 42846: Cannot convert types 'TIME' to 'TIMESTAMP'.", > Documentation clearly states that these conversions are allowed, see table 1 in a description of CAST function in the Derby Reference Manual and comment about "Conversion of date/time values" below that table (see below as well). > Conversions of date/time values > A date/time value can always be converted to and from a TIMESTAMP. If a DATE is > converted to a TIMESTAMP, the TIME component of the resulting TIMESTAMP is always > 00:00:00. If a TIME data value is converted to a TIMESTAMP, the DATE component is > set to the value of CURRENT_DATE at the time the CAST is executed. If a TIMESTAMP > is converted to a DATE, the TIME component is silently truncated. If a TIMESTAMP is > converted to a TIME, the DATE component is silently truncated. > -- 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