Re: question about constraint
From: Klaus Eichler <ek2918_at_m30x.nbg.scn.de>
Date: 1996/04/29
Message-ID: <4m29je$6u3_at_centurio.m30x.nbg.scn.de>#1/1
Date: 1996/04/29
Message-ID: <4m29je$6u3_at_centurio.m30x.nbg.scn.de>#1/1
duffy_at_cais2.cais.com (MCC) wrote:
>
>What is the purpose of having a CONSTRAINT in the following statement:
>
> CREATE TABLE s_ord
> (id NUMBER(7),
> customer_id NUMBER(7)
> CONSTRAINT s_ord_customer_id nn NOT NULL,
> .
> .
> .
> );
>
> why can't we just define customer_id to NUMBER(7) NOT NULL?
>Thanks,
>Duffy
As far as I know, the only difference is the name of the constraint.
(In USER_CONSTRAINTS it will appear as S_ORD_CUSTOMER_ID instead of
SYS_Cnnnnn).
If the constraint is violated, you will not get a more detailed error message
than with a simple not null constraint.
Regards, Klaus
-- Klaus Eichler | Haus 2, 3C7.1 | email ek2918_at_m30x.nbg.scn.de Siemens AG, AUT 652 | Moorenbrunn | Postfach 4848 | Gleiwitzer Str. 555 | Tel +49 911 895-2918 D-90327 Nuernberg | D-90475 Nuernberg | Fax +49 911 895-4802Received on Mon Apr 29 1996 - 00:00:00 CEST