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

Home -> Community -> Usenet -> c.d.o.misc -> Re: SOS please help with constraint check with like

Re: SOS please help with constraint check with like

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Sat, 07 Feb 2004 17:16:32 -0800
Message-ID: <1076202941.399512@yasure>


juan wrote:
> for start i am spanish and my english is not very good, i am sorry for this.
>
> i want made a constraint like this
>
> CONSTRAINT "CHECPCP" CHECK(CODPOSTAL LIKE '[0-9][0-9][0-9][0-9][0-9]')
>
> this constraint works correctly in SQL Server, but not in oracle.
>
> how can i specify a rank like wich i use in SQL Server for oracle?
>
> thank very much.

Use TRANSLATE and make sure that TRANSLATE(column_value, '0123456789', '99999') is true.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Sat Feb 07 2004 - 19:16:32 CST

Original text of this message

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