Update Persistence without changing timestamps

If you change for some reason your Unit of Measurement of an item and like to update your persistence for that item (or if you just like to update specific items for whatever reason), you surely came across the problem of the auto-update in the items-tables (CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)).

The following SQL-syntax works with updating values (e.g. changing from cm to mm):

UPDATE itemXXX SET time = time, value = value * 10 

if enabled, you have to turn off safe mode - and turn it on afterwards! :wink: :

SET SQL_SAFE_UPDATES=0;
   UPDATE itemXXX SET time = time, value = value * 10 
SET SQL_SAFE_UPDATES=1;
1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.