Hi all i'm having a problem.

I've a db with 2 tables, one takes posts and one other takes comments. there can be more comments related to a post, so when i delete a row form posts i want to delete every related comment from comments. How to do?

this is the descriptor i use to delete a post:

<Posts>
        <connection>mcblogger</connection>
        <table name="Posts" alias="Posts">
                <keys>
                        <key name="Post_ID" type="int" autoincrement="true">
                                <mode name="auto"  type="autoincr"/>
                        </key>
                </keys>
        </table>
</Posts>

and it run. How to delete also related comments from table comment?
to delete a comment i use this descriptor:

<Comments>
        <connection>mcblogger</connection>
        <table name="Comments" alias="Comments">
                <keys>
                        <key name="Comment_ID" type="int" autoincrement="true">
                                <mode name="auto"  type="autoincr"/>
                        </key>
                </keys>
        </table>
</Comments>

i tried this but it doesn't run:

        <table name="Posts" alias="Posts">
                <keys>
                        <key name="Post_ID" type="int" autoincrement="true">
                                <mode name="auto"  type="autoincr"/>
                        </key>
                </keys>
        </table>
        
        <table name="Comments" alias="Comments">
                <keys>
                        <key name="Comment_ID" type="int" set="slave">
                        </key>
                </keys>
                <values>
                        <value name="Post_ID" type="int" set="master"/>
                </values>
        </table>

how to do??

Thanks all, Best Regards, Davide



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to