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

Home -> Community -> Usenet -> c.d.o.server -> Re: Boolean data type?

Re: Boolean data type?

From: Ed Bruce <Ed.Bruce_at_ha.hac.com>
Date: 1998/09/16
Message-ID: <36002979.EA04097F@ha.hac.com>#1/1

"David R. Robison" wrote:
>
> What is the best way to store a boolean data type in an Oracle database?

I can't say there is any best way. How are you interfacing to your database? What programming language? How will you be manipulating the results? There are lots of choices.

number(1) with values of 0 and 1. Put a check on column restricting values.

char(1) and restrict to 'T' or 'F'

varchar2(5) and set to 'True' or 'False' more user readable.

I prefer the first and third because we use Pro*Ada and have enumerated types and can easily convert to a numeric or string representation as neccessary. We use number(1) to save space and varchar2 when the data may be used with MS Access and a more user readable form is needed.

later,
Ed Bruce
Systems Engineer
Raytheon Systems Company Received on Wed Sep 16 1998 - 00:00:00 CDT

Original text of this message

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