Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 55949 invoked from network); 24 Jul 2006 09:45:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 24 Jul 2006 09:45:39 -0000 Received: (qmail 87771 invoked by uid 500); 24 Jul 2006 09:45:38 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 87394 invoked by uid 500); 24 Jul 2006 09:45:38 -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 87383 invoked by uid 99); 24 Jul 2006 09:45:38 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Jul 2006 02:45:38 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [192.18.1.36] (HELO gmpea-pix-1.sun.com) (192.18.1.36) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Jul 2006 02:45:37 -0700 Received: from d1-emea-10.sun.com ([192.18.2.120]) by gmpea-pix-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id k6O9jB6A017234 for ; Mon, 24 Jul 2006 10:45:13 +0100 (BST) Received: from conversion-daemon.d1-emea-10.sun.com by d1-emea-10.sun.com (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) id <0J2W00601J1X8A00@d1-emea-10.sun.com> (original mail from Knut.Hatlen@Sun.COM) for derby-user@db.apache.org; Mon, 24 Jul 2006 10:45:11 +0100 (BST) Received: from khepri19 ([129.159.112.231]) by d1-emea-10.sun.com (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPSA id <0J2W0046KJ38V4FM@d1-emea-10.sun.com> for derby-user@db.apache.org; Mon, 24 Jul 2006 10:45:11 +0100 (BST) Date: Mon, 24 Jul 2006 11:45:08 +0200 From: Knut Anders Hatlen Subject: Re: setNull in select doesn't work In-reply-to: Sender: Knut.Hatlen@Sun.COM To: Derby Discussion Message-id: Organization: Sun Microsystems MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT References: User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (usg-unix-v) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Marieke Vandamme writes: > Hello, > > We are trying to perform a select query to the Derby database with > PreparedStatement > > PreparedStatement ps = c.prepareStatement("select * from table where value > = ?"); > //several methods performed on statement (separately ofcourse) > 1. ps.setNull(1,Types.VARCHAR); > 2. ps.setObject(1, null, Types.VARCHAR); > 3. ps.setString(1, null) ; > > The table contains null values, but the resultset is empty for the 3 > cases. It doesn't return any rows because "value = null" does not evaluate to true even when value in fact is null, in which case it evaluates to unknown. "value is null" should work. -- Knut Anders