Re: 9i: Check- constraint Upper(Column)

From: Carlos <miotromailcarlos_at_netscape.net>
Date: Wed, 2 Apr 2008 06:24:35 -0700 (PDT)
Message-ID: <221a3638-5b82-4086-b097-8e06e50bdccf@x41g2000hsb.googlegroups.com>


On 2 abr, 11:19, Andreas Mosmann <mosm..._at_expires-30-04-2008.news- group.org> wrote:
> Hi newsgroup,
>
> Is it possible to build a constraint, that ensures, that there are not
> more entries in a column, that look like
> 'Abc   ' -> trim(upper(..))='ABC'
> 'ABC'    -> trim(upper(..))='ABC'
> 'aBC '   -> trim(upper(..))='ABC'
> ?
>
> Alternativ I could build a shadow column filled by a trigger that
> containes trim(upper(..)) and a check constraint on this, but it seems
> to me that there is a better way.
>
> Thank you in advance
> Andreas Mosmann
>
> --
> wenn email, dann AndreasMosmann <bei> web <punkt> de

Not sure about what you're trying to do, but a Function Based Unique Index on (trim(upper(column))) may do the trick...

HTH. Cheers.

Carlos. Received on Wed Apr 02 2008 - 08:24:35 CDT

Original text of this message