Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2006
    Posts
    2

    Unanswered: Trigger invocation during replication

    I am trying to replicate two tables from host A to host B.

    I have defined after insert/update triggers on these two tables tableA and tableB. I want these triggers for these two tables to be invoked during replication. Also I want tableA to be replicated first as triggers for tableB depends on data from tableA.

    The replication works fine, but triggers are not invoked at all.

    Please let me know the solution for this problem.

    Thanks in advance
    Sam

  2. #2
    Join Date
    Nov 2004
    Posts
    374

    triggers

    triggers are independent from replication
    if an insert /update occures, the trigger should fire.
    apply is executing insert-delete-update statements
    if you mean after sql statements defined by replication, these are regular statements and not triggers, that fire after the apply finishes a cycle.
    if you want to keep the sequence of operation as on source, there is a setting in apply - transaction based... this will respect the order
    Best Regards, Guy Przytula
    DB2/ORA/SQL Services
    DB2 DBA & Advanced DBA Certified
    DB2 Dprop Certified
    http://users.skynet.be/przytula/dbss.html

  3. #3
    Join Date
    Feb 2006
    Posts
    2

    triggers in replication

    Acctually the replication uses load mechanism for tableB and import mechanism for tableA. So the trigger gets fired for tableA, but not for
    tableB (because load doesn't fire trigger). However I want both triggers
    to get fired and also I want to replicate tableA first and tableB first.
    So that trigger for tableA fires first as trigger from tableB depends on
    data from tableA.

    I will appreciate if you can provide a solution for my requirement.

    Thanks in advance

  4. #4
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    You should be able to put the trigger logic into a SQL stmt or a Stored Proc and run after each subscription-set processing cycle.

    HTH

    Sathyaram

    Quote Originally Posted by forjim
    Acctually the replication uses load mechanism for tableB and import mechanism for tableA. So the trigger gets fired for tableA, but not for
    tableB (because load doesn't fire trigger). However I want both triggers
    to get fired and also I want to replicate tableA first and tableB first.
    So that trigger for tableA fires first as trigger from tableB depends on
    data from tableA.

    I will appreciate if you can provide a solution for my requirement.

    Thanks in advance
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  5. #5
    Join Date
    Nov 2004
    Posts
    374

    trigger

    whenever apply applies the modifications, it uses regular statements
    is this the initial load ?
    do the initial load manually with import and let apply keep the tables maintained
    Best Regards, Guy Przytula
    DB2/ORA/SQL Services
    DB2 DBA & Advanced DBA Certified
    DB2 Dprop Certified
    http://users.skynet.be/przytula/dbss.html

Posting Permissions

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