db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Segel" <mse...@mycingular.blackberry.net>
Subject Re: Best choice for column's data type to represent boolean data
Date Thu, 07 Dec 2006 17:14:58 GMT
I'm not sure where that came from, however I'm sure its somewhere on the wish list. 
Since the boolean type has been around for a while,  and its implemented in other databases,
its not out of the realm of being added.

With respect to java objects, what are they?

Note: that was a rhetorical question.
The point being is that one can define a boolean data type in terms of how to store it within
a database. 

POJOs are a different story. 

Before you think about java objects, you're going to want to redesign derby itself . 

But that's a different issue.

Sent via BlackBerry.

-Mike Segel
312 952 8175

-----Original Message-----
From: "Bayless Kirtley" <bkirt@cox.net>
Date: Thu, 7 Dec 2006 09:20:07 
To:"Derby Discussion" <derby-user@db.apache.org>
Subject: Re: Best choice for column's data type to represent boolean data

Is there reason to think the next version may support Boolean data type?
If so then what about Java Objects?


----- Original Message ----- 
From: "Leslie Software" <lesliesoftware@yahoo.com>
To: "Derby Discussion" <derby-user@db.apache.org>
Sent: Thursday, December 07, 2006 8:07 AM
Subject: Re: Best choice for column's data type to represent boolean data

Thanks for the advice I was leaning towards the numeric solution but using 
'T' / 'F' as a visual clue makes a lot of sense.  After all until we do have 
a new boolean data type that visual clue is all we have.  I am already 
looking forward to the next version:-)


----- Original Message ----
From: "derby@segel.com" <derby@segel.com>

Well the best practice would be to extend the known data types to include a
Boolean. ;-)

There are two options.
You can create a CHAR(1) column, or if the database you could do a
byte/short column as well.

If you use a CHAR(1) you could represent the Boolean as either ('T' or 'F')
or ('Y','N'). You would also want to put a check constraint on the column
only allowing a true and a false value.

You could also use a 1 or a 0 in the column as well and provide the same
check constraint, however using a T/F or Y/N provides a visual cue that
would be missing from a numeric solution.



Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around

View raw message