If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-20-02, 05: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, 08: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, 20: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, 22: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

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