Back to OIM Explorer

dbo.QER_TUBaseTreeHasQERResource

Database TriggerSQL_TRIGGERSandbox DB

Database Trigger on BaseTreeHasQERResource. 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-PersonHasQERResource / QER_ZPersonHasQERResource at line 6

Source: sandbox-db sys.sql_modules

Source size: 2.222 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-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-PersonHasQERResource / QER_ZPersonHasQERResource at line 6
  • 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-PersonHasQERResource / QER_ZPersonHasQERResource at line 9
  • Bulk DBQueue insert -> QER-K-BaseTreeHasObject / QER_ZBaseTreeHasObject at line 10
  • Bulk DBQueue insert -> QER-K-PersonHasQERResource / QER_ZPersonHasQERResource at line 10
  • Bulk DBQueue insert -> QER-K-PersonHasQERResource / QER_ZPersonHasQERResource at line 13
  • References QBM_PDBQueueInsert_Bulk
  • Trigger parent table: BaseTreeHasQERResource

Typed Edges

  • 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_ZBaseTreeHasObject at line 6 Bulk DBQueue insert -> QER-K-BaseTreeHasObject / QER_ZBaseTreeHasObject at line 6
  • queues DBQueue task QER_ZPersonHasQERResource at line 6 Bulk DBQueue insert -> QER-K-PersonHasQERResource / QER_ZPersonHasQERResource at line 6
  • 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_ZPersonHasQERResource at line 9 Bulk DBQueue insert -> QER-K-PersonHasQERResource / QER_ZPersonHasQERResource at line 9
  • queues DBQueue task QER_ZBaseTreeHasObject at line 10 Bulk DBQueue insert -> QER-K-BaseTreeHasObject / QER_ZBaseTreeHasObject at line 10
  • queues DBQueue task QER_ZPersonHasQERResource at line 10 Bulk DBQueue insert -> QER-K-PersonHasQERResource / QER_ZPersonHasQERResource at line 10
  • queues DBQueue task QER_ZPersonHasQERResource at line 13 Bulk DBQueue insert -> QER-K-PersonHasQERResource / QER_ZPersonHasQERResource at line 13
  • trigger on table BaseTreeHasQERResource Trigger parent table: BaseTreeHasQERResource
  • 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

Complete Source

SQL111 lines
1CREATE trigger QER_TUBaseTreeHasQERResource2  ON BaseTreeHasQERResource 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      INSERT INTO @ChangedOrg(UID_SingleGuid)24      SELECT25        DISTINCT d.UID_Org AS uid26      FROM BaseTreeHasQERResource a27      JOIN deleted d28        ON a.XObjectKey = d.XObjectKey29      WHERE30        dbo.QBM_FGIXOriginChanged_Effect(d.XOrigin,31      a.XOrigin,32      d.XIsInEffect,33      a.XIsInEffect) = 134      IF @@ROWCOUNT > 035      BEGIN36        DECLARE @DBQueueElements_01 QBM_YDBQueueRaw37        INSERT INTO @DBQueueElements_01(object,38        subobject,39        genprocid)40        SELECT41          x.uid,42          'QER-K-OrgHasQERResource',43          @GenProcID44        FROM(45        SELECT c.UID_SingleGuid AS uid46        FROM @ChangedOrg c) AS x47        EXEC QBM_PDBQueueInsert_Bulk 'QER-K-AllChildrenOfOrg',48          @DBQueueElements_0149        DECLARE @DBQueueElements_02 QBM_YDBQueueRaw50        INSERT INTO @DBQueueElements_02(object,51        subobject,52        genprocid)53        SELECT54          x.uid,55          NULL,56          @GenProcID57        FROM(58        SELECT b.UID_Org AS uid59        FROM @ChangedOrg c60        JOIN BaseTree b61          ON c.UID_SingleGuid = b.UID_Org62        WHERE63          b.ITShopInfo = 'BO') AS x64        EXEC QBM_PDBQueueInsert_Bulk 'QER-K-OrgAutoChild',65          @DBQueueElements_0266        DECLARE @DBQueueElements_03 QBM_YDBQueueRaw67        INSERT INTO @DBQueueElements_03(object,68        subobject,69        genprocid)70        SELECT71          x.uid,72          NULL,73          @GenProcID74        FROM(75        SELECT c.UID_SingleGuid AS uid76        FROM @ChangedOrg c) AS x77        EXEC QBM_PDBQueueInsert_Bulk 'QER-K-BaseTreeHasObject',78          @DBQueueElements_0379        DECLARE @DBQueueElements_04 QBM_YDBQueueRaw80        INSERT INTO @DBQueueElements_04(object,81        subobject,82        genprocid)83        SELECT84          x.uid,85          NULL,86          @GenProcID87        FROM(88        SELECT pio.UID_Person AS uid89        FROM @ChangedOrg c90        JOIN PersoninBaseTree pio91          ON c.UID_SingleGuid = pio.UID_Org AND pio.XOrigin > 092        UNION93        SELECT hpo.UID_Person AS uid94        FROM @ChangedOrg c95        JOIN HelperPersonOrg hpo96          ON c.UID_SingleGuid = hpo.UID_Org) AS x97        EXEC QBM_PDBQueueInsert_Bulk 'QER-K-PersonHasQERResource',98          @DBQueueElements_0499      END100    END101  END TRY102  BEGIN CATCH103    EXEC QBM_PSessionErrorAdd DEFAULT104    RAISERROR('',105    18,106    1)107      WITH NOWAIT108  END CATCH109  ende:110  RETURN111END
Open raw exported source
SQL ยท Raw16 lines
1create   trigger QER_TUBaseTreeHasQERResource on BaseTreeHasQERResource  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 insert into @ChangedOrg (UID_SingleGuid) select 4distinct d.UID_Org as uid from BaseTreeHasQERResource a join deleted d on a.XObjectKey = d.XObjectKey where dbo.QBM_FGIXOriginChanged_Effect(d.XOrigin,5 a.XOrigin, d.XIsInEffect, a.XIsInEffect) = 1 if @@ROWCOUNT > 0  begin declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object6, subobject, genprocid) select x.uid, 'QER-K-OrgHasQERResource', @GenProcID from ( select c.UID_SingleGuid as uid from @ChangedOrg c ) as x exec QBM_PDBQueueInsert_Bulk7 'QER-K-AllChildrenOfOrg', @DBQueueElements_01 declare @DBQueueElements_02 QBM_YDBQueueRaw insert into @DBQueueElements_02 (object, subobject, genprocid8) select x.uid, null, @GenProcID from ( select b.UID_Org as uid from @ChangedOrg c join BaseTree b on c.UID_SingleGuid = b.UID_Org where b.ITShopInfo =9 'BO' ) as x exec QBM_PDBQueueInsert_Bulk 'QER-K-OrgAutoChild', @DBQueueElements_02   declare @DBQueueElements_03 QBM_YDBQueueRaw insert into @DBQueueElements_0310 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select c.UID_SingleGuid as uid from @ChangedOrg c ) as x exec QBM_PDBQueueInsert_Bulk11 'QER-K-BaseTreeHasObject', @DBQueueElements_03  declare @DBQueueElements_04 QBM_YDBQueueRaw insert into @DBQueueElements_04 (object, subobject, genprocid12) select x.uid, null, @GenProcID from ( select pio.UID_Person as uid from @ChangedOrg c join PersoninBaseTree pio on c.UID_SingleGuid = pio.UID_Org and13 pio.XOrigin > 0 union select hpo.UID_Person as uid from @ChangedOrg c join HelperPersonOrg hpo on c.UID_SingleGuid = hpo.UID_Org ) as x exec QBM_PDBQueueInsert_Bulk14 'QER-K-PersonHasQERResource', @DBQueueElements_04 end  end  END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END15 CATCH ende: return end 16