mySQL not working with new sensor variable **solved**
Posted: Sun Oct 25, 2020 9:56 pm
With the new PM2.5 air quality variables I am not able to do the mySQL insert query.
Previously '[air0pm-max5=.0]' worked just fine. Now the new variable is '[air0!0pm-max5=.0]' and it doesn't work. I suspect it has something to do with the mySQL not liking the ! symbol in there but I'm not certain. I thought it should work because of the quotes but I'm not certain.
Why does the new variable have to have an exclamation mark in it?
Does anyone have a recommendation on how to resolve this?
Here is my query:
Previously '[air0pm-max5=.0]' worked just fine. Now the new variable is '[air0!0pm-max5=.0]' and it doesn't work. I suspect it has something to do with the mySQL not liking the ! symbol in there but I'm not certain. I thought it should work because of the quotes but I'm not certain.
Why does the new variable have to have an exclamation mark in it?
Does anyone have a recommendation on how to resolve this?
Here is my query:
Code: Select all
INSERT INTO `mystation` (`ID`, `DateTime`, `TempOutCur`, `HumOutCur`, `PressCur`, `DewCur`, `HeatIdxCur`, `WindChillCur`, `TempInCur`, `HumInCur`, `WindSpeedCur`, `WindAvgSpeedCur`, `WindDirCur`, `WindDirCurEng`, `WindGust10`, `WindDirAvg10`, `WindDirAvg10Eng`, `RainRateCur`, `RainDay`, `RainYest`, `RainMonth`, `RainYear`, `UV`, `Solar`, `PM2.5`) VALUES (NULL, '[YYYY]-[MM]-[DD] [hh]:[mm]:[ss]', '[th0temp-act=F]', '[th0hum-act]', '[thb0seapress-act=inHg.2]', '[th0dew-act=F]', '[th0heatindex-act=F]', '[wind0chill-act=F]', '[thb0temp-act=F]', '[thb0hum-act]', '[wind0wind-act=mph]', '[wind0avgwind-act=mph]', '[wind0dir-act]', '[wind0dir-act=endir]', '[wind0wind-max10=mph]', '[wind0dir-avg10]', '[wind0dir-avg10=endir]', '[rain0rate-act=in.2]', '[rain0total-daysum=in.2]', '[rain0total-ydaysum=in.2]', '[rain0total-monthsum=in.2]', '[rain0total-yearsum=in.2]', '[uv0index-act]', '[sol0rad-act]', CASE '#if#{*[air0pm-age:999]<300*}#then#GOOD#else#BAD#fi#' WHEN 'GOOD' THEN '[air0!0pm-max5=.0]' ELSE NULL END)