[Tutor] Strange sqlite3 behavior

Lang Hurst lang at tharin.com
Sat Jul 17 09:10:06 CEST 2010


I just had the weirdest issue with sqlite3.  I was trying to update a 
field to "Active".  I have a little database of students and sometimes 
they get sent to juvi, or just check out for a couple of months and show 
back up.  Anyway, I wanted to just have a field that had either "Active" 
or "Inactive".  I know, could go all boolean, but wanted to leave my 
options open.

Anyway, my code was along the lines of

    UPDATE students SET active="Inactive" where id="123456"


That would work, but

    UPDATE students SET active="Active" where id="123456"


wouldn't.  It wouldn't do anything, the field still held "Inactive".  I 
tried it manually through sqlite3browser and had the same result.  Strange.

    UPDATE students SET active="Bob Sagat" where id="123456"


worked.  Anything but "Active" works.  I was unable to update to 
"Active".  You can imagine how frustrating this was.  When I finally 
realized that it was only Active that didn't work, I changed my program 
to either "Active Student" or "Inactive Student" and it works fine.

Just had to post this somewhere, after loosing even more hair.

-Lang


-- 
There are no stupid questions, just stupid people.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100717/b8248656/attachment.html>


More information about the Tutor mailing list