Subject | Re[2]: [ib-support] Delete * with child fields. |
---|---|
Author | Carlos H. Cantu |
Post date | 2001-02-20T19:39:13Z |
Yeh Ann, I though about that too, but I think he wants a more "flexible"
way where he dont need to specify the children table(s). Maybe using the
system tables to retrieve the relations, but I dont know if this could be
done in a single SQL (???)
[]s
Carlos
WarmBoot Informatica - http://www.warmboot.com.br
Interbase-BR - http://www.interbase-br.com
AWH> At 04:20 PM 2/20/2001 -0300, Carlos H. Cantu wrote:
AWH> delete from whatever
AWH> where not any (select child_id from children
AWH> where children.parent = whatever.id)
AWH> ?
AWH> Regards,
AWH> Ann
AWH> www.ibphoenix.com
AWH> We have answers.
AWH> To unsubscribe from this group, send an email to:
AWH> ib-support-unsubscribe@egroups.com
way where he dont need to specify the children table(s). Maybe using the
system tables to retrieve the relations, but I dont know if this could be
done in a single SQL (???)
[]s
Carlos
WarmBoot Informatica - http://www.warmboot.com.br
Interbase-BR - http://www.interbase-br.com
AWH> At 04:20 PM 2/20/2001 -0300, Carlos H. Cantu wrote:
>>Someone posted this on my discussion group :AWH> Something like
>>
>>Is there a way to delete all the records on a table who actually dont have
>>any child on other table (with FK defined) and keep the others out of the
>>delete ?
AWH> delete from whatever
AWH> where not any (select child_id from children
AWH> where children.parent = whatever.id)
AWH> ?
AWH> Regards,
AWH> Ann
AWH> www.ibphoenix.com
AWH> We have answers.
AWH> To unsubscribe from this group, send an email to:
AWH> ib-support-unsubscribe@egroups.com