Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cascade delete -8i

Status
Not open for further replies.

sweetleaf

Programmer
Jan 16, 2001
439
CA
I am using 8i and I have a parent table that has 2 child tables -each with a foreign key to the parent.

i would like it so that when i delete from the parent the related child data gets deleted too.

in my ddl i've defined the FK's like this:

-- Foreign Keys
ALTER TABLE child_tab1
ADD FOREIGN KEY (load_no)
REFERENCES USER1.parent_tab (load_no) ON DELETE CASCADE
/

ALTER TABLE child_tab2
ADD FOREIGN KEY (load_no)
REFERENCES USER1.parent_tab (load_no) ON DELETE CASCADE
/

..yet when i delete from the parent my session just hangs like i'm being wait stated or something.

can anyone help?

thanks much!
 
Do you have indexes on child_tab1(load_no) and child_tab2(load_no)? If those tables are large deleting without indexes may take a lot of time.

Regards, Dima
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top