db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bruehlicke <bruehli...@gmail.com>
Subject Re: Basic SQL question Update statement
Date Mon, 28 Sep 2009 03:11:06 GMT
Tusind takk. Virker perfekt.

On Sun, Sep 27, 2009 at 1:22 PM, Knut Anders Hatlen <Knut.Hatlen@sun.com> wrote:
> bruehlicke <bruehlicke@gmail.com> writes:
>
>> I have a trigger something like
>>
>> ..... UPDATE X SET A=(SELECT ..... )
>>
>>
>> Now, if the embedded SELECT statement returns no rows I would NOT like
>> to change the value from A to "bank/null" but let it keep the value it
>> currently has.
>>
>> Any suggestions for a one liner which fits into a create trigger statement
>
> I think this should do the trick:
>
> UPDATE X SET A=COALESCE((SELECT ......), A)
>
> --
> Knut Anders
>

Mime
View raw message