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

Home -> Community -> Usenet -> comp.databases.theory -> Re: SQL Humor

Re: SQL Humor

From: Mikito Harakiri <mikharakiri_nospaum_at_yahoo.com>
Date: 19 Aug 2005 15:11:14 -0700
Message-ID: <1124489474.385537.312510@g49g2000cwa.googlegroups.com>

AK wrote:
> >>
> >>> In fact, those ugly length
> >limited datatypes are just artifacts of the early SQL days,
> ><<
>
> >on the contrary, it is a very powerful tool in enforsing data integrity
>
>
>
> Oh? How?
> <<
>
> by declaring STATE_CODE CHAR(2) I don't let old style abbreviations
> 'Fla' and 'Ill' in
>
> by declaring COUNTRY_CODE CHAR(3), etc.

Why not

CHECK CONSTRAINT(LENGTH(COUNTRY_CODE)<=2)

BTW, this way you could also declare that COUNTRY_CODE has exactly 2 characters. Received on Fri Aug 19 2005 - 17:11:14 CDT

Original text of this message

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