Re: CHECK Constraint

From: Mike Sherrill <MSherrill_at_compuserve.com>
Date: Fri, 12 Sep 2003 13:03:21 -0500
Message-ID: <0a4tlvkrtrg70des7hurnbb01ife15b0of_at_4ax.com>


On 5 Sep 2003 14:19:59 -0700, hari_om_at_hotmail.com (Hari Om) wrote:

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

FWIW, those aren't ZIP codes. Consider putting all your postal codes into a table and set a foreign key reference to it.

-- 
Mike Sherrill
Information Management Systems
Received on Fri Sep 12 2003 - 20:03:21 CEST

Original text of this message