sqlite administrator: querying boolean fields

Forum related to SQLite

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
JCollum
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 23.01.2009, 23:33

sqlite administrator: querying boolean fields

Post by JCollum »

I've set up a table called Photos. In that table there are two boolean fields, Public and Active. No rocket science here. However, when I query on those fields I get no records back (within SQLite admin).

-- 4 rows, with Active and Public = true for all
SELECT pics$.Caption, pics$.Id, pics$.Path, pics$.Public, pics$.Active
FROM main.Pictures pics$

-- no rows
SELECT pics$.Caption, pics$.Id, pics$.Path, pics$.Public, pics$.Active
FROM main.Pictures pics$
where pics$.Active = 1

-- also no rows
SELECT pics$.Caption, pics$.Id, pics$.Path, pics$.Public, pics$.Active
FROM main.Pictures pics$
where pics$.Active = '1'


Is this a bug in the SQLite Admin tool? I'm going to try a different tool and see... But it could be my query that's the problem. Also, the dollar signs are weird, they're generated by DbLinq tho.
JCollum
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 23.01.2009, 23:33

Post by JCollum »

Not a bug, but could be improved. When I assigned a default for the BOOLEAN field, I put in 1, when it should have been Y. So the fix for the query was to use ='Y'. Dblinq was generating ='TRUE' instead of ='Y'.
Post Reply