Back to OIM Explorer

dbo.QER_TUBaseTreeHasQERReuseUS

Database TriggerSQL_TRIGGERSandbox DB

Database Trigger on BaseTreeHasQERReuseUS. Bulk DBQueue insert -> QER-K-BaseTreeHasObject / QER_ZBaseTreeHasObject at line 6; Bulk DBQueue insert -> QER-K-AllChildrenOfOrg / QER_ZAllChildrenOfOrg at line 6; Bulk DBQueue insert -> QER-K-OrgAutoChild / QER_ZITShopProductNodeCheck at line 6; Bulk DBQueue insert -> QER-K-BaseTreeHasObject / QER_ZBaseTreeHasObject at line 6

Source: sandbox-db sys.sql_modules

Source size: 2.651 characters

Interpretation

  • Database trigger. Treat parent table and enqueue/object-layer calls as the main relation points.
  • DBQueue relation detected. Follow the task procedure and referenced-by list for async processing.

Relations

  • Bulk DBQueue insert -> QER-K-BaseTreeHasObject / QER_ZBaseTreeHasObject at line 6
  • Bulk DBQueue insert -> QER-K-AllChildrenOfOrg / QER_ZAllChildrenOfOrg at line 6
  • Bulk DBQueue insert -> QER-K-OrgAutoChild / QER_ZITShopProductNodeCheck at line 6
  • Bulk DBQueue insert -> QER-K-BaseTreeHasObject / QER_ZBaseTreeHasObject at line 6
  • Bulk DBQueue insert -> QER-K-PersonHasQERReuseUS / QER_ZPersonHasQERReuseUS at line 6
  • Bulk DBQueue insert -> QER-K-AllChildrenOfOrg / QER_ZAllChildrenOfOrg at line 9
  • Bulk DBQueue insert -> QER-K-OrgAutoChild / QER_ZITShopProductNodeCheck at line 9
  • Bulk DBQueue insert -> QER-K-BaseTreeHasObject / QER_ZBaseTreeHasObject at line 9
  • Bulk DBQueue insert -> QER-K-PersonHasQERReuseUS / QER_ZPersonHasQERReuseUS at line 9
  • Bulk DBQueue insert -> QER-K-OrgAutoChild / QER_ZITShopProductNodeCheck at line 11
  • Bulk DBQueue insert -> QER-K-BaseTreeHasObject / QER_ZBaseTreeHasObject at line 11
  • Bulk DBQueue insert -> QER-K-PersonHasQERReuseUS / QER_ZPersonHasQERReuseUS at line 11
  • Bulk DBQueue insert -> QER-K-BaseTreeHasObject / QER_ZBaseTreeHasObject at line 13
  • Bulk DBQueue insert -> QER-K-PersonHasQERReuseUS / QER_ZPersonHasQERReuseUS at line 13
  • Bulk DBQueue insert -> QER-K-PersonHasQERReuseUS / QER_ZPersonHasQERReuseUS at line 16
  • References QBM_PDBQueueInsert_Bulk
  • Trigger parent table: BaseTreeHasQERReuseUS

Typed Edges

  • queues DBQueue task QER_ZBaseTreeHasObject at line 6 Bulk DBQueue insert -> QER-K-BaseTreeHasObject / QER_ZBaseTreeHasObject at line 6
  • queues DBQueue task QER_ZAllChildrenOfOrg at line 6 Bulk DBQueue insert -> QER-K-AllChildrenOfOrg / QER_ZAllChildrenOfOrg at line 6
  • queues DBQueue task QER_ZITShopProductNodeCheck at line 6 Bulk DBQueue insert -> QER-K-OrgAutoChild / QER_ZITShopProductNodeCheck at line 6
  • queues DBQueue task QER_ZPersonHasQERReuseUS at line 6 Bulk DBQueue insert -> QER-K-PersonHasQERReuseUS / QER_ZPersonHasQERReuseUS at line 6
  • queues DBQueue task QER_ZAllChildrenOfOrg at line 9 Bulk DBQueue insert -> QER-K-AllChildrenOfOrg / QER_ZAllChildrenOfOrg at line 9
  • queues DBQueue task QER_ZITShopProductNodeCheck at line 9 Bulk DBQueue insert -> QER-K-OrgAutoChild / QER_ZITShopProductNodeCheck at line 9
  • queues DBQueue task QER_ZBaseTreeHasObject at line 9 Bulk DBQueue insert -> QER-K-BaseTreeHasObject / QER_ZBaseTreeHasObject at line 9
  • queues DBQueue task QER_ZPersonHasQERReuseUS at line 9 Bulk DBQueue insert -> QER-K-PersonHasQERReuseUS / QER_ZPersonHasQERReuseUS at line 9
  • queues DBQueue task QER_ZITShopProductNodeCheck at line 11 Bulk DBQueue insert -> QER-K-OrgAutoChild / QER_ZITShopProductNodeCheck at line 11
  • queues DBQueue task QER_ZBaseTreeHasObject at line 11 Bulk DBQueue insert -> QER-K-BaseTreeHasObject / QER_ZBaseTreeHasObject at line 11
  • queues DBQueue task QER_ZPersonHasQERReuseUS at line 11 Bulk DBQueue insert -> QER-K-PersonHasQERReuseUS / QER_ZPersonHasQERReuseUS at line 11
  • queues DBQueue task QER_ZBaseTreeHasObject at line 13 Bulk DBQueue insert -> QER-K-BaseTreeHasObject / QER_ZBaseTreeHasObject at line 13
  • queues DBQueue task QER_ZPersonHasQERReuseUS at line 13 Bulk DBQueue insert -> QER-K-PersonHasQERReuseUS / QER_ZPersonHasQERReuseUS at line 13
  • queues DBQueue task QER_ZPersonHasQERReuseUS at line 16 Bulk DBQueue insert -> QER-K-PersonHasQERReuseUS / QER_ZPersonHasQERReuseUS at line 16
  • trigger on table BaseTreeHasQERReuseUS Trigger parent table: BaseTreeHasQERReuseUS
  • references source dbo.QBM_FGISessionContext source text reference
  • references source dbo.QBM_FGIXOriginChanged_Effect source text reference
  • references source dbo.QBM_PDBQueueInsert_Bulk source text reference
  • references source dbo.QBM_PSessionErrorAdd source text reference
  • references source dbo.QER_TUBaseTree source text reference
  • references source dbo.QER_TUBaseTreeHasQERReuse source text reference

Complete Source

SQL129 lines
1CREATE trigger QER_TUBaseTreeHasQERReuseUS2  ON BaseTreeHasQERReuseUS FOR3UPDATE NOT FOR Replication4AS5BEGIN6  DECLARE @ChangedOrg QBM_YSingleGUID7  BEGIN TRY8    IF EXISTS(9      SELECT TOP 1 110      FROM inserted)11    GOTO start12    IF EXISTS(13      SELECT TOP 1 114      FROM deleted)15    GOTO start16    RETURN start:17    DECLARE @GenProcID varchar(38)18    SELECT @GenProcID = dbo.QBM_FGISessionContext('')19    IF20    UPDATE(XOrigin) OR21    UPDATE(XIsInEffect)22    BEGIN23      DECLARE @DBQueueElements_01 QBM_YDBQueueRaw24      INSERT INTO @DBQueueElements_01(object,25      subobject,26      genprocid)27      SELECT28        x.uid,29        NULL,30        @GenProcID31      FROM(32      SELECT33        DISTINCT a.UID_Org AS uid34      FROM BaseTreeHasQERReuseUS a35      JOIN deleted d36        ON a.XObjectKey = d.XObjectKey37      WHERE38        dbo.QBM_FGIXOriginChanged_Effect(d.XOrigin, a.XOrigin, d.XIsInEffect, a.XIsInEffect) = 1) AS x39      EXEC QBM_PDBQueueInsert_Bulk 'QER-K-BaseTreeHasObject',40        @DBQueueElements_0141      INSERT INTO @ChangedOrg(UID_SingleGuid)42      SELECT43        DISTINCT d.UID_Org AS uid44      FROM BaseTreeHasQERReuseUS a45      JOIN deleted d46        ON a.XObjectKey = d.XObjectKey47      WHERE48        dbo.QBM_FGIXOriginChanged_Effect(d.XOrigin,49      a.XOrigin,50      d.XIsInEffect,51      a.XIsInEffect) = 152      IF @@ROWCOUNT > 053      BEGIN54        DECLARE @DBQueueElements_02 QBM_YDBQueueRaw55        INSERT INTO @DBQueueElements_02(object,56        subobject,57        genprocid)58        SELECT59          x.uid,60          'QER-K-OrgHasQERReuseUS',61          @GenProcID62        FROM(63        SELECT c.UID_SingleGuid AS uid64        FROM @ChangedOrg c) AS x65        EXEC QBM_PDBQueueInsert_Bulk 'QER-K-AllChildrenOfOrg',66          @DBQueueElements_0267        DECLARE @DBQueueElements_03 QBM_YDBQueueRaw68        INSERT INTO @DBQueueElements_03(object,69        subobject,70        genprocid)71        SELECT72          x.uid,73          NULL,74          @GenProcID75        FROM(76        SELECT b.UID_Org AS uid77        FROM @ChangedOrg c78        JOIN BaseTree b79          ON c.UID_SingleGuid = b.UID_Org80        WHERE81          b.ITShopInfo = 'BO') AS x82        EXEC QBM_PDBQueueInsert_Bulk 'QER-K-OrgAutoChild',83          @DBQueueElements_0384        DECLARE @DBQueueElements_04 QBM_YDBQueueRaw85        INSERT INTO @DBQueueElements_04(object,86        subobject,87        genprocid)88        SELECT89          x.uid,90          NULL,91          @GenProcID92        FROM(93        SELECT c.UID_SingleGuid AS uid94        FROM @ChangedOrg c) AS x95        EXEC QBM_PDBQueueInsert_Bulk 'QER-K-BaseTreeHasObject',96          @DBQueueElements_0497        DECLARE @DBQueueElements_05 QBM_YDBQueueRaw98        INSERT INTO @DBQueueElements_05(object,99        subobject,100        genprocid)101        SELECT102          x.uid,103          NULL,104          @GenProcID105        FROM(106        SELECT pio.UID_Person AS uid107        FROM @ChangedOrg c108        JOIN PersoninBaseTree pio109          ON c.UID_SingleGuid = pio.UID_Org AND pio.XOrigin > 0110        UNION111        SELECT hpo.UID_Person AS uid112        FROM @ChangedOrg c113        JOIN HelperPersonOrg hpo114          ON c.UID_SingleGuid = hpo.UID_Org) AS x115        EXEC QBM_PDBQueueInsert_Bulk 'QER-K-PersonHasQERReuseUS',116          @DBQueueElements_05117      END118    END119  END TRY120  BEGIN CATCH121    EXEC QBM_PSessionErrorAdd DEFAULT122    RAISERROR('',123    18,124    1)125      WITH NOWAIT126  END CATCH127  ende:128  RETURN129END
Open raw exported source
SQL ยท Raw18 lines
1create   trigger QER_TUBaseTreeHasQERReuseUS on BaseTreeHasQERReuseUS  for Update not for Replication as begin  declare @ChangedOrg QBM_YSingleGUID2 BEGIN TRY if exists (select top 1 1 from inserted) goto start if exists (select top 1 1 from deleted) goto start return start: declare @GenProcID varchar3(38) select @GenProcID = dbo.QBM_FGISessionContext('') if update(XOrigin) or update(XIsInEffect) begin declare @DBQueueElements_01 QBM_YDBQueueRaw insert4 into @DBQueueElements_01 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select distinct a.UID_Org as uid from BaseTreeHasQERReuseUS5 a join deleted d on a.XObjectKey = d.XObjectKey where dbo.QBM_FGIXOriginChanged_Effect(d.XOrigin, a.XOrigin, d.XIsInEffect, a.XIsInEffect) = 1 ) as x 6exec QBM_PDBQueueInsert_Bulk 'QER-K-BaseTreeHasObject', @DBQueueElements_01 insert into @ChangedOrg (UID_SingleGuid) select distinct d.UID_Org as uid from7 BaseTreeHasQERReuseUS a join deleted d on a.XObjectKey = d.XObjectKey where dbo.QBM_FGIXOriginChanged_Effect(d.XOrigin, a.XOrigin, d.XIsInEffect, a.XIsInEffect8) = 1 if @@ROWCOUNT > 0  begin declare @DBQueueElements_02 QBM_YDBQueueRaw insert into @DBQueueElements_02 (object, subobject, genprocid) select x.uid,9 'QER-K-OrgHasQERReuseUS', @GenProcID from ( select c.UID_SingleGuid as uid from @ChangedOrg c ) as x exec QBM_PDBQueueInsert_Bulk 'QER-K-AllChildrenOfOrg'10, @DBQueueElements_02 declare @DBQueueElements_03 QBM_YDBQueueRaw insert into @DBQueueElements_03 (object, subobject, genprocid) select x.uid, null, @GenProcID11 from ( select b.UID_Org as uid from @ChangedOrg c join BaseTree b on c.UID_SingleGuid = b.UID_Org where b.ITShopInfo = 'BO' ) as x exec QBM_PDBQueueInsert_Bulk12 'QER-K-OrgAutoChild', @DBQueueElements_03  declare @DBQueueElements_04 QBM_YDBQueueRaw insert into @DBQueueElements_04 (object, subobject, genprocid) 13select x.uid, null, @GenProcID from ( select c.UID_SingleGuid as uid from @ChangedOrg c ) as x exec QBM_PDBQueueInsert_Bulk 'QER-K-BaseTreeHasObject', 14@DBQueueElements_04  declare @DBQueueElements_05 QBM_YDBQueueRaw insert into @DBQueueElements_05 (object, subobject, genprocid) select x.uid, null, @GenProcID15 from ( select pio.UID_Person as uid from @ChangedOrg c join PersoninBaseTree pio on c.UID_SingleGuid = pio.UID_Org and pio.XOrigin > 0 union select hpo.UID_Person16 as uid from @ChangedOrg c join HelperPersonOrg hpo on c.UID_SingleGuid = hpo.UID_Org ) as x exec QBM_PDBQueueInsert_Bulk 'QER-K-PersonHasQERReuseUS', 17@DBQueueElements_05 end  end  END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end 18