db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris K Chew" <ch...@fenetics.com>
Subject RE: Cascading delete?
Date Mon, 07 Apr 2003 19:17:35 GMT
> From: EPugh@upstate.com
>
> I remember seeing some osrt of config setting for that when generating the
> OM objects, but I can't for the life of me find it!

> > From: Gabriel Bauman
> >
> > Is there a configuration option that generates code to do cascading
> > deletions on foreign key records?

I haven't tried it myself, but the shema DTD offers the following options in
the foreign-key tag:

<!ELEMENT foreign-key (reference+)>
<!ATTLIST foreign-key
  foreignTable CDATA #REQUIRED
  name CDATA #IMPLIED
  onUpdate (cascade|setnull|restrict|none) "none"
  onDelete (cascade|setnull|restrict|none) "none"
>

So I guess something like the following might work:

<table name="TABLE1">
    ...
    <foreign-key foreignTable="TABLE2" onDelete="cascade">
        <reference local="TABLE1_ID" foreign="TABLE1_ID"/>
    </foreign-key>
</table>


Good luck,

Chris



Mime
View raw message