SQLite Forum

Serious problems with STORED columns
Login
You specify what value they are to have by the expression that generates them. The intent is that it will ALWAYS have that value. STORED means err on the side of saving the computed value, and use that saved value if you can. Omitting the STORED says always recompute.

The error was that you used a function for the value that keeps changing, but SQLite didn't realize that. Thus it would give you back wrong values because it didn't realize it needed to recompute the value.

Storing a cached value so that you don't need to recompute every time is different than a 'normal' persistent value which absolutely won't change until you explicitly write a new value to it.