-
Hi,
I am trying to delete a contacts table using the following command but it gives me an error
1* delete from contacts cascade where contact_id=56123
SQL> /
delete from contacts cascade where contact_id=56123
*
ERROR at line 1:
ORA-02292: integrity constraint (COMPANY.SYS_C0029597) violated - child record
found
why doesnt the cascade option work in this case.
Ronnie
-
because when you create the table you have to specify thaT it supports delete cascade
-
How do i do that.
where can i find more inforation on that.
Thanks
Ronnie
-
You need to add the delete cascade on the foreign key not the table.
ALTER TABLE childtable
ADD ( FOREIGN KEY (pkey)
REFERENCES myparenttable
ON DELETE CASCADE ) ;
so every foreign key needs the on delete cascade.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|