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: Harald Maier <maierh_at_myself.com>
Date: Sat, 06 Sep 2003 10:05:58 +0200
Message-ID: <m3llt2pcih.fsf@ate.maierh>


hari_om_at_hotmail.com (Hari Om) writes:

> 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'))
> )

Try this:

,----

| create table test
| (
| state varchar2(5) constraint test_c_state (
|   state in('AL','AK','AZ','AR','CA','CO','CT','DE')
|   )
| );

`----

Harald Received on Sat Sep 06 2003 - 03:05:58 CDT

Original text of this message

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