X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0D3D3563A8 for ; Mon, 7 Mar 2005 13:08:49 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 48915-10 for ; Mon, 7 Mar 2005 13:08:47 +0000 (GMT) Received: from mail.logix-tt.com (wallaby.dingens.org [212.75.36.180]) by svr1.postgresql.org (Postfix) with ESMTP id BF96D563F0 for ; Mon, 7 Mar 2005 13:08:46 +0000 (GMT) Received: from kingfisher.intern.logi-track.com (J208d.j.pppool.de [85.74.32.141]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logix-tt.com (Postfix) with ESMTP id 963D6A85EB; Mon, 7 Mar 2005 14:08:51 +0100 (CET) Received: from [127.0.0.1] (localhost [127.0.0.1]) by kingfisher.intern.logi-track.com (Postfix) with ESMTP id 798E1AB3D9; Mon, 7 Mar 2005 14:08:48 +0100 (CET) Message-ID: <422C525F.2020908@logix-tt.com> Date: Mon, 07 Mar 2005 14:08:47 +0100 From: Markus Schaber Organization: Logical Tracking&Tracing International AG User-Agent: Mozilla Thunderbird 1.0 (X11/20050116) X-Accept-Language: de-DE, de, en-us, en MIME-Version: 1.0 To: Andreas Ulbrich Cc: Guillaume Cottenceau , pgsql-jdbc@postgresql.org Subject: Re: impossible to update rows specifying columns with NULL References: <87wtssj2c4.fsf@meuh.mnc.ch> <42237EFA.1060502@opencloud.com> <87fyzfzqgd.fsf@meuh.mnc.ch> <4224528A.3010606@opencloud.com> <422460E3.3040100@fastcrypt.com> <42247349.8030205@logi-track.com> <877jkrxxoa.fsf@meuh.mnc.ch> <19062.1109700228@sss.pgh.pa.us> <87mztmv46x.fsf@meuh.mnc.ch> <20050307095906.A28847@kubis.osp-dd.de> In-Reply-To: <20050307095906.A28847@kubis.osp-dd.de> X-Enigmail-Version: 0.90.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200503/39 X-Sequence-Number: 12432 Hi, Andreas, Andreas Ulbrich schrieb: > I found in our project the following construct to handle this situation: > > UPDATE tab SET colx = ... WHERE ... coly IS NULL AND ? IS NULL OR coly = ? ... > > - You must bind the value twice. > - We are using ORACLE, but it seems to bo standard like Maybe you can encapsulate this in a plpgsql function, so you need to bind the value only once. Markus -- Markus Schaber | Logical Tracking&Tracing International AG Dipl. Inf. | Software Development GIS Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org