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: Qestion about check constraints. Need help.

Re: Qestion about check constraints. Need help.

From: Dave Macpherson <dave_at_fifthd.ca>
Date: 1997/05/20
Message-ID: <3381b89d.427849502@news.sas.ab.ca>#1/1

On Mon, 19 May 1997 11:36:30 -0600, tomas_at_senna.std.lt wrote:

>Is it possible to create check constraint that check if data contain only
>letters (not numbers or other symbols)
>
>-------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet

If you know all the possible characters in the data column, then the following will probably work:

check (columnname = translate(columnname, 'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()', 'abcdefghijklmnopqrstuvwxyz'))

Of course, you will have to substitute uppercase for the above if the data only contains uppercase. The idea here being that the original column value must equal the translated valued with all characters you aren't interested in having been stripped out.

Dave Macpherson Received on Tue May 20 1997 - 00:00:00 CDT

Original text of this message

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