On Mon, 26 Nov 2012 00:16:39 +1300, Keith Chew <keith.c...@gmail.com>
wrote:

>Hi Richard
>
>
>>
>> UPDATE user SET user_name='Keith' WHERE user_name!='Keith';
>>
>>
>>
>The example I provided was simplified only to explain the scenario. In a
>production environment, there are over 40-50 columns, and the suggested
>workaround above is impractical.

Yet it is the way to do this in SQL.
It is only impractical if you write the code by hand, perhaps you should
generate it instead. Use the output of PRAGMA table_info(yourtablename)
for the code generator to make the column list dynamic.

Or create a BEFORE UPDATE trigger that takes care of it and
RAISE(IGNORE,'Nothing to do') when there's nothing to do.


-- 
Groet, Cordialement, Pozdrawiam, Regards,

Kees Nuyt

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to