pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Markus Schaber <schabi@logix-tt.com>
To: Andreas Ulbrich <ulbrich@osp-dd.de>
Cc: Guillaume Cottenceau <gc@mnc.ch>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: impossible to update rows specifying columns with NULL
Date: Mon, 07 Mar 2005 14:08:47 +0100
Message-ID: <422C525F.2020908@logix-tt.com> (raw)
In-Reply-To: <20050307095906.A28847@kubis.osp-dd.de>
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>

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



view thread (11+ messages)

Message-ID: <422C525F.2020908@logix-tt.com>
Permalink:  ../422C525F.2020908@logix-tt.com/
Also on:    postgresql.org/message-id/422C525F.2020908@logix-tt.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: schabi@logix-tt.com, ulbrich@osp-dd.de, gc@mnc.ch
  Subject: Re: impossible to update rows specifying columns with NULL
  In-Reply-To: <422C525F.2020908@logix-tt.com>
  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> <422C525F.2020908@logix-tt.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox