Re: Implementation of boolean types.

From: Kenneth Downs <knode.wants.this_at_see.sigblock>
Date: Wed, 13 Jul 2005 21:21:06 -0400
Message-Id: <59rgq2-78b.ln1_at_pluto.downsfam.net>


-CELKO- wrote:

> You missed the class on scales and measurements. SQL deliberately left
> out Booleans and deprecated bits. They are a sign of "punch card" and
> assembly language programming.
>

>>> I personally think that this should be design using a relationship with
>>> other tables such as Human <<

>
> No, you should use a CHECK() on a vlaue that is limited to a particular
> scale.
>
> Your sex code example has an ISO Standard which you would have found if
> you researched before you coded. 0= Unknown, 1= male, 2= female and 9=
> lawful person (corporations, organizations, etc.)
>
> Get a copy of SQL PROGRAMMING STYLE for some details on how to create
> encoding schemes -- there is no single magic answer.

only a committee would come up with values of 1=male and 2=female. If you protest that these are multilingual, I say pick French, pick English, pick anything. but 1=male? nobody will ever remember that, and they'll just use the values for their language.

-- 
Kenneth Downs
Secure Data Software, Inc.
(Ken)nneth_at_(Sec)ure(Dat)a(.com)
Received on Thu Jul 14 2005 - 03:21:06 CEST

Original text of this message