Re: CHECK Constraint

From: Guido Konsolke <Guido.Konsolke_at_triaton.com>
Date: Mon, 8 Sep 2003 13:25:54 +0200
Message-ID: <1063020075.339526_at_news.thyssen.com>


"Hari Om" <hari_om_at_hotmail.com> wrote in  news:d1d5ebe4.0309051319.33b3c3b2_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!
Hi Hari Om,

your example works for me. What do you mean with 'seems to freak out'? By the way: I prefer the 'alter table... add constraint...' statement. In this I can easily define descriptive names for them.

hth,
Guido Received on Mon Sep 08 2003 - 13:25:54 CEST

Original text of this message