Updating historical data in database?

43 views
Skip to first unread message

Steve Preston

unread,
Apr 18, 2020, 1:03:13 PM4/18/20
to weewx-user
I just realized that I imported a few years of data from WLK files where I accidentally swapped the inside vs outside humidity (a bug which is now fixed in my wlkReader app). 
So now I would like to update these values in the database.

Does wee_import "update" records which match the timestamp of existing records in the database or does it only ADD new records?  I'm assuming that it only adds records.  So I suspect that I will need to remove all the historical WLK data from my WeeWx database, then import the correct data again.  Does this make sense?

Thanks
Steve

Thomas Keffer

unread,
Apr 18, 2020, 1:16:51 PM4/18/20
to weewx-user
Why not just swap the columns around?

UPDATE archive SET outHumidity=inHumidity, inHumidity=outHumidity;

Then drop and rebuild the daily summaries.

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/68aa3172-cce9-4b8b-8a3f-f872dbba1cb5%40googlegroups.com.

Steve Preston

unread,
Apr 18, 2020, 4:21:44 PM4/18/20
to weewx-user
Geez... that was almost too easy : )

Thanks!
Steve
Reply all
Reply to author
Forward
0 new messages