Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > Informix > cascading delete

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-20-02, 06:15
mchih mchih is offline
Registered User
 
Join Date: Nov 2002
Posts: 98
cascading delete

does any one have instances where "on delete cascade" is written in, but when trying to delete the record in parent table, it still gives errors stating the key is still being referenced?
Reply With Quote
  #2 (permalink)  
Old 12-20-02, 09:18
Roelwe Roelwe is offline
Registered User
 
Join Date: Aug 2002
Location: Belgium
Posts: 534
Did you try to implement it with triggers?
__________________
rws
Reply With Quote
  #3 (permalink)  
Old 12-22-02, 21:56
mchih mchih is offline
Registered User
 
Join Date: Nov 2002
Posts: 98
Quote:
Originally posted by Roelwe
Did you try to implement it with triggers?


that's precisely the problem...
in my understanding the "on delete cascade" should serve the function of a delete trigger.

i am sure it would work if i write a delete trigger, but i want to know why would the "on delete cascade" not work..
Reply With Quote
  #4 (permalink)  
Old 12-22-02, 23:15
mchih mchih is offline
Registered User
 
Join Date: Nov 2002
Posts: 98
example:

create table test
(testid serial primary key)

create table test2
(testid integer,
foreign key (testid)
references test
on delete cascade)

if i delete a record in test(which is referenced in test2)
the error message would state that the key is still being referenced and could not be deleted

but isn't it what "on delete cascade" is supposed to handle??
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On