Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Represent boolean
Bricklen Anderson wrote:
> Or possibly implement a check constraint that allows (for example), only
> TRUE or FALSE, or T or F
>
> Jim Kennedy wrote:
> >
> > Because if you read the documentation you will find that there is no Boolean
> > data type for a table. So Daniel was telling you exactly that - in Oracle
> > you cannot have a field type that is Boolean. In addition, the error you
> > are getting from Oracle is telling you you cannot have a Boolean data type
> > as a field.
> >
> > You can make a field that only allows 0 and 1 as a number if you want.
> > Jim
> >
> > "alex" <alienhipopotamus_at_caramail.com> wrote in message
> > news:1d3c465f.0206020900.60e55b36_at_posting.google.com...
> > > > If you are talking about a table field ... you can define it any way you
> > > > want but Boolean is not an option.
> > >
> > > I have try this SQL command:
> > > CREATE TABLE TEST (myvar BOOLEAN);
> > > Oracle responde this:
> > > ORA-00902: invalid datatype
> > > Why can't I use BOOLEAN here?
> > > Thanks.
The critical thing here Alex is that Boolean makes sense as a variable but makes no sense as data. So whether you choose to do it the MS way as integers storing -1 and 0, or 0 and 1 or to represent it in characters at T and F or Y and N is up to you.
But why you didn't read any documentation, and read my message an insisted on ignoring the advice, is something I can not fathom.
Daniel Morgan Received on Sun Jun 02 2002 - 14:36:53 CDT