Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2004

    Unanswered: create delete trigger without knowing table name

    I have 4 tables:

    A document table
    A doctype table
    a general table
    a drawing table

    document is a parent table to general and drawing. There is a identifying relationsionship between document and general and document and drawing. (1:0-N)
    document contains an attribute doctype_id which references doctype.doctype_id. doctype is a parent table to document. There is a non-identifying relationship between doctype and document. (1:0-N)

    I would like to create a trigger that enforces the constraint that any time a record is deleted from the document table the associated reference, whether it be a general or a drawing will also be deleted.


  2. #2
    Join Date
    Nov 2003
    down on the cube farm, left then right then another left
    Must be finals time again. Second maybe third request that sounds a lot like a class assignment to me.

    Maybe I am just being cynical.
    NOTE: Please disregard the label "Senior Member".

  3. #3
    Join Date
    Sep 2002
    Provided Answers: 1
    You don't need a trigger - ON DELETE CASCADE on the foreign key constraints does that.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts