Re: impossible to update rows specifying columns with NULL

From: Markus Schaber <schabi(at)logix-tt(dot)com>
To: Andreas Ulbrich <ulbrich(at)osp-dd(dot)de>
Cc: Guillaume Cottenceau <gc(at)mnc(dot)ch>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: impossible to update rows specifying columns with NULL
Date: 2005-03-07 13:08:47
Message-ID: 422C525F.2020908@logix-tt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Vadim Nasardinov 2005-03-07 15:32:12 Re: ident auth postgres 7.4 fedora core 3
Previous Message Andreas Ulbrich 2005-03-07 08:59:06 Re: impossible to update rows specifying columns with NULL