| Mailing List | | Home | | MySQL General - General MySQL discussion | | MaxDB - Everything about MaxDB, formerly known as SAP DB | | MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP | | MySQL++ - Programming with the C++ API to MySQL | | ODBC - ODBC with the MySQL Connector/ODBC driver | | Java Help - Mostly related to the MySQL Connector/J driver | | Perl - Perl support for MySQL with DBI and DBD::mysql | | GUI - MySQL GUI Tools | | Announcement |
|
|
  | |  | Update columns with not NULL | Update columns with not NULL 2004-04-07 - By Dusan Kolesar
Back Hello,
Is it posible to make : update tab1 (col1, col2) values (:myvar1, :myvar2) where id=1; But I want to update only columns where myvarX is not NULL, when the value is NULL I want to let previous value of column. I know when I divide my query : if (myvar1 <> NULL) then update tab1 (col1) values (:myvar1) where id=1; if (myvar2 <> NULL) then update tab1 (col2) values (:myvar2) where id=1; it will work, but when I have some UPDATE trigger defined for the table, this trigger will fire for every update and I prefer when it fires only once.
Thank you, for your suggestions.
Best regards, Dusan
-- MaxDB Discussion Mailing List For list archives: http://lists.mysql.com/maxdb To unsubscribe: http://lists.mysql.com/maxdb?unsub=mysql@(protected)
|
|
 |