cleaning up database

Skip to first unread message

Graham Eddy

Apr 20, 2019, 2:44:43 AM4/20/19
to wview Google Group
another thing to look for in cleaning up wview database:
i encountered a few strings in rows instead of reals. maybe i patched them badly years ago and wview was forgiving but weewx spits the dummy

knew there was a database problem when weewx crashed on load. first suspected a type problem when
  > select max(outTemp) from archive;
gave the stupidly low result of 43.7. discovered it (there was only one) was a string with
  > select max(outTemp), typeof(outTemp) from archive;
  > select outTemp, typeof(outTemp) from archive where typeof(outTemp) = ‘text’;
and fixed it with
  > update archive set outTemp = 43.7 where typeof(outTemp) = ‘text’;

Graham Eddy

Tom Keffer

Apr 21, 2019, 12:01:59 PM4/21/19
to wview
Strings in the database usually come from using one of the visual sqlite editors, then deleting a value. Instead of inserting a NULL, they substitute an empty string.
Reply all
Reply to author
0 new messages