Re: impossible to update rows specifying columns with NULL - Mailing list pgsql-jdbc

From Markus Schaber
Subject Re: impossible to update rows specifying columns with NULL
Date
Msg-id 422C525F.2020908@logix-tt.com
Whole thread Raw
In response to Re: impossible to update rows specifying columns with NULL  (Andreas Ulbrich <ulbrich@osp-dd.de>)
List pgsql-jdbc
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

pgsql-jdbc by date:

Previous
From: Andreas Ulbrich
Date:
Subject: Re: impossible to update rows specifying columns with NULL
Next
From: Ian Pilcher
Date:
Subject: Re: ident auth postgres 7.4 fedora core 3