Boolean fields: 1/0 vs Y/N

This is the international (english) support forum for the SQLite Administrator developed and maintained by Orbmu2k.

Moderators: gto, EgonHugeist, Orbmu2k

igitur
Fresh Boarder
Fresh Boarder
Posts: 7
Joined: 30.04.2007, 14:03
Location: Cape Town
Contact:

Boolean fields: 1/0 vs Y/N

Postby igitur » 01.09.2008, 16:37

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

zippo
Silver Boarder
Silver Boarder
Posts: 322
Joined: 12.10.2005, 18:01
Location: Slovenia

Postby zippo » 03.09.2008, 12:11

Are you sure that both the ways are supported? Somewhere I used one, somewhere the second...

igitur
Fresh Boarder
Fresh Boarder
Posts: 7
Joined: 30.04.2007, 14:03
Location: Cape Town
Contact:

Postby igitur » 03.09.2008, 13:01

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.

igitur
Fresh Boarder
Fresh Boarder
Posts: 7
Joined: 30.04.2007, 14:03
Location: Cape Town
Contact:

Postby igitur » 06.10.2008, 10:07

I'd love to hear the developer's comments on this issue...

igitur
Fresh Boarder
Fresh Boarder
Posts: 7
Joined: 30.04.2007, 14:03
Location: Cape Town
Contact:

Postby igitur » 09.10.2008, 07:57

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.

igitur
Fresh Boarder
Fresh Boarder
Posts: 7
Joined: 30.04.2007, 14:03
Location: Cape Town
Contact:

Postby igitur » 09.10.2008, 08:01

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

MarioR
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 30.07.2009, 07:38

Postby MarioR » 30.07.2009, 08:01

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

infoeon
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 17.03.2010, 22:40

Postby infoeon » 17.03.2010, 23:33

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.


Return to “SQLite Administrator”

Who is online

Users browsing this forum: No registered users and 1 guest