Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004
    Location
    Mumbai, India
    Posts
    16

    Unanswered: How to Create a Trigger with Atomic option in DB2UDb in windows

    i have created 2 databases and created link between those 2 dbs using federated db.
    now i want to create a trigger that, if i insert a row in client table which is in db2, then it should check the master table whichis in db1.
    i tried to create trigger but it is not working.
    i can select the rows using join from those tables residing in diff dbs.
    pls help me out how to create a trigger fo r this Db2Udb in windows
    Sakthi
    G.Sakthi

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Did you create a wrapper for the master table in database db2? If so what name did you give it? Could you also post the trigger definition that you are trying to create?

    Andy

  3. #3
    Join Date
    Jan 2004
    Location
    Mumbai, India
    Posts
    16

    Thumbs up

    Originally posted by ARWinner
    Did you create a wrapper for the master table in database db2? If so what name did you give it? Could you also post the trigger definition that you are trying to create?

    Andy
    Hi

    its worked now,
    this is the trigger i created

    CREATE TRIGGER Test1 no cascade before insert ON emp1 REFERENCING NEW AS N FOR EACH ROW MODE DB2SQL WHEN (deptno NOT IN (SELECT deptno FROM dept)) SIGNAL SQLSTATE '75000' ('Referencial integrity Error before insert')

    thanx a lot again
    G.Sakthi

Posting Permissions

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