Subject sql update
Author Henrik Sitter
Hi, in a stored procedure I say something like this:

update aTable
set col1 = :inVal1, col2 = :inVal2, col3 = :inVal3
where col4 = '...';

inVal1, inVal2, inVal3 and inVal4 are input parameters, and the thing is
that I just want to update the columns where the input parameters are
not null. So if inVal1 is null and the other input parameters are not, I
want to update col2 and col3 but not col1.

Is there a clever way to do this, using some sort of if/case...


Thx,
Henrik