Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How can I store a boolean data type in a table or data type object?

Re: How can I store a boolean data type in a table or data type object?

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Sat, 19 Feb 2000 09:36:22 +0800
Message-ID: <38ADF396.6282@yahoo.com>


Rookie wrote:
>
> I would like to store a boolean data type in a table. Do I use an int, 0
> for false and 1 for true, or do I use a char(1) or varchar2(1), 'N' for
> false and 'Y' for true?

Shouldn't really matter which you use as long as you set a check constraint to ensure that the two values is ALL that you get...

You could optionally look at having one of the values NULL which would save some space and give a smaller b-tree index (if a bitmap index was not appropriate)

HTH
--



Connor McDonald
http://www.oracledba.co.uk

"Beta, n: Latin for 'still does not work'" Received on Fri Feb 18 2000 - 19:36:22 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US