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 ConstraintsQ

Re: CHECK ConstraintsQ

From: Andy Hassall <andy_at_andyh.co.uk>
Date: Sat, 06 Sep 2003 12:54:37 +0100
Message-ID: <4rhjlvou4ci5c8srvi7jdasraf7rjh00a0@4ax.com>


On Fri, 05 Sep 2003 21:33:52 -0700, Daniel Morgan <damorgan_at_exxesolutions.com> wrote:

>You should not be creating check constraints on any field in the create
>table statement. Create constraints after table creation in separate
>ALTER TABLE statements so that they can be named.

 You can supply a name for in-line or out-of-line constraints within a CREATE TABLE statement; you are not forced to do it in a separate ALTER TABLE to avoid having the bad system-generated names for constraints.

http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/clauses3a.htm#1001944

CREATE TABLE t (

    id            number      not null,
    flag_boo      varchar2(1) not null,
    constraint t_pk
        primary key (id),
    constraint t_c1 
        check (flag_boo in ('T', 'F'))

);

 [storage clauses omitted for brevity]

--
Andy Hassall (andy@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Received on Sat Sep 06 2003 - 06:54:37 CDT

Original text of this message

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