Re: Set Null constraints in Oracle 8.0.5?????
Date: Fri, 25 Feb 2000 11:33:27 +0100
Message-ID: <895lpq$h5r18_at_abp.nl>
Hi,
You should either delete all children first with father_id=1 prior to deleting the father himself, or redefine the constraint and add the 'on delete cascade' keywords.
Best regards,
Huberto
Carole Darche <cdarche_at_ispalliance.net> schreef in berichtnieuws
38B5FEB9.570444BC_at_ispalliance.net...
> Hi all,
>
> Our D.B.A. is having a very strange problem with foreign keys in Oracle
> 8.0.5.
>
> The object is to create a set null constraint, so she followed the
> following procedure
>
> create father and child tables
>
> desc father;
> Column Name Null? Type
> ------------------------------ -------- ----
> FATHER_ID NOT NULL NUMBER
> BIDON VARCHAR2(2)
>
> desc child;
> Column Name Null? Type
> ------------------------------ -------- ----
> CHILD_ID NOT NULL NUMBER
> FATHER_ID NUMBER
> TEXT VARCHAR2(2)
>
> alter table child
> add constraint fk1_child foreign key (father_id) references father
> (father_id);
>
> delete from father where father_id=1;
> ORA-02292: integrity constraint (AMSUSER.FK1_CHILD) violated - child
> record found
>
> How to work our way arround this, How oracle is handling the set null
> constraints?????
>
> Please reply to the following email address: cdarche_at_america.net Or
> belbagri_at_america.net
>
> Thanks for your help
>
>
Received on Fri Feb 25 2000 - 11:33:27 CET
