Leonardo J. Tramontina wrote:
I have the following situation:
Book |----------| BooksAuthor |----------| Author
<snip>
====================================
And this is the trigger I tried to create at Author class:
====================================
Trigger DeleteBookAuthor [ Event = DELETE ] { ///
when Time is BEFORE, it doesn't appear
&SQL(DELETE FROM BookAuthor
WHERE rAuthor = ? /// how to reference this is the one I want
to delete?
)
}
Leonardo,
&SQL(DELETE FROM BookAuthor
should be
&SQL(DELETE FROM BooksAuthor
and, as i understood,
"The problem is when I delete a Book,
I want to delete its relationship with the Author."
So,
It will appear like:
Obviously at Book Class !!!
Trigger DeleteBookAuthor [ Event = DELETE ] {
Set xid = {ID}
&SQL(DELETE FROM BookAuthor
WHERE rBook = :xid /// the one you want to delete
)
}
I didn't try it but you can try !!!
Regards
Nuno