3 Replies Latest reply: Jan 5, 2013 9:08 AM by user1862659 RSS

    Problem with update when replicating to other table in the same schema

    user1862659
      Hi,

      I´m trying to replicate transactions from one table to other. For example, at destination, if I insert into a table t5, the insert is replicated to t5 at target. What I want is a second map (or whatever) which executes again the same operation against other table t6, like a trigger. The insert works, the update doesn´t because the update operations is done for the columns which is the PK and it is an error , a bug, which can be solved setting the constraint to deferrable at target site and setting the map with HANDLETPKUPDATE. However, when I try to re-execute the same update against t6 it fails.

      The replicat code is very simple:

      TABLEEXCLUDE scott.t6; --> This is to disable operations against t6 from source
      map scott.t*, target scott.* ,HANDLETPKUPDATE;


      map scott.t5, target scott.t6 ,HANDLETPKUPDATE;


      map scott.t5 #exception_handler();
      map scott.t6 #exception_handler();


      But there is an error:

      ORA-00001: unique constraint (SCOTT.PK_T5) violated), SQL<Not available>.

      And, although I set the reperror like this:

      REPERROR (DEFAULT, EXCEPTION)
      REPERROR (DEFAULT2, EXCEPTION)

      The process abends.

      Does anyone know why it fails?.


      Regards.