Page 1 of 1

Boolean fields: 1/0 vs Y/N

Posted: 01.09.2008, 16:37
by igitur
Hi,

When editing table data by using the Edit Data tab, checking / unchecking checkboxes for boolean fields enters Y or N in the fields.

I understand that Sqlite is weakly typed and that using Y/N as opposed to 1/0 is a personal choice, but I really feel that 1/0 is a better option.

Almost all the other Sqlite GUI's I've encountered uses 1/0 for boolean fields. So my colleagues use some of the other tools and this one application we use does queries like "SELECT * FROM Users WHERE IsActive=1".

We don't have access to change that code. I'm one of the few to use Sqlite Administrator and the Y/N is creating a lot of problems. I have to update the table manually with queries.

Don't you think 1/0 is more of an industry standard than Y/N ?

If you agree, please switch to 1/0 or at least make it an optional preference somewhere.

Thanks again for a great tool.

Francois

Posted: 03.09.2008, 12:11
by zippo
Are you sure that both the ways are supported? Somewhere I used one, somewhere the second...

Posted: 03.09.2008, 13:01
by igitur
zippo wrote:Are you sure that both the ways are supported? Somewhere I used one, somewhere the second...
Yes I'm quite sure.

At the moment I have a table with a boolean field. Half of the entries are from an import that I did from a CSV file. These entries' boolean fields are either 1 or 0.

The other entries were entered in manually using Sqlite Administrator. These entries' boolean fields are either Y or N.

So, this application we use sometimes does something like "WHERE myBooleanField=1" and sometimes "ORDER BY myBooleanField"

In both cases, the results are not as expected.

Posted: 06.10.2008, 10:07
by igitur
I'd love to hear the developer's comments on this issue...

Posted: 09.10.2008, 07:57
by igitur
The Y/N also causes problems in other Sqlite GUIs, like SQLite2008 Pro, that don't recognise the Y/N as valid BOOLEAN fields.

Really guys... 1/0 is the standard.

Posted: 09.10.2008, 08:01
by igitur
Administrator, am I to understand from http://zeos.firmos.at/viewtopic.php?t=1 ... 3ec9c24a15 that you will NOT fix this?

Posted: 30.07.2009, 08:01
by MarioR
Hello,

the SQLiteAdmin set the bool true/false to Y/N.
That is not standart (standart is 1/0).
The ADO.NET provider-function SQLite.GetBoolean(NumberOfField)
trow an Exeption when the Boolen-Field contains not 1/0.

Can your change the Bool-Values from Y/N to 1/0 ?

many greets

Mario

Posted: 17.03.2010, 23:33
by infoeon
This is also causing an issue with the .net sqlite integration. Its Reader.GetBoolean() function only sees 1 as true, other values are false. This is fairly standard amongst database vendors.