Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: CHECK ConstraintsQ
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