Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How can I store a boolean data type in a table or data type object?
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
--
"Beta, n: Latin for 'still does not work'" Received on Fri Feb 18 2000 - 19:36:22 CST
![]() |
![]() |