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: CHECK Constraints

Re: CHECK Constraints

From: Chris O <itoys1>
Date: Sat, 6 Sep 2003 14:31:44 +1000
Message-ID: <3f596333$0$14558$afc38c87@news.optusnet.com.au>


"Hari Om" <hari_om_at_hotmail.com> wrote in message news:d1d5ebe4.0309051319.742b0867_at_posting.google.com...
> Hi ORAPERTS (ORAcle xPERTS)
>
> How can I define a CHECK CONSTRAINT on a table for a field like zip
> code....?
>
> Here is what I am doing:
> create table test
> (
> state varchar2(5) check (state
> in('AL','AK','AZ','AR','CA','CO','CT','DE'))
>
> )
>
> but it seems that it freaks out....wonder why...? I tried using DOUBLE
> QUOTES also but in vain....what is a correct way?
>
> THANKS!
I assume that you are trying to execute this DDL statement using SQL*Plus. If so, then by "freaks out" you probably mean it does not like the blank line.

If this is the case, do either:

  1. Remove the blank line before the closing right parenthesis.

--or--

2. Issue the following SQL*Plus command prior to executing the DDL:

SET sqlblanklines ON

.

Cheers Received on Fri Sep 05 2003 - 23:31:44 CDT

Original text of this message

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