Back to OIM Explorer

dbo.QER_TUPWODecisionMethod

Database TriggerSQL_TRIGGERSandbox DB

Database Trigger on PWODecisionMethod. Bulk DBQueue insert -> QER-K-ITSHOPOrder-RESET / QER_ZITShopOrderReset at line 13; Bulk DBQueue insert -> QER-K-ITSHOPOrder-ABORT / QER_ZITShopOrderAbort at line 13; Bulk DBQueue insert -> QER-K-ShoppingRack-All / QER_ZITShopCheckStructure at line 13; Bulk DBQueue insert -> QER-K-ITSHOPOrder-ABORT / QER_ZITShopOrderAbort at line 14

Source: sandbox-db sys.sql_modules

Source size: 3.310 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-ITSHOPOrder-RESET / QER_ZITShopOrderReset at line 13
  • Bulk DBQueue insert -> QER-K-ITSHOPOrder-ABORT / QER_ZITShopOrderAbort at line 13
  • Bulk DBQueue insert -> QER-K-ShoppingRack-All / QER_ZITShopCheckStructure at line 13
  • Bulk DBQueue insert -> QER-K-ITSHOPOrder-ABORT / QER_ZITShopOrderAbort at line 14
  • Bulk DBQueue insert -> QER-K-ShoppingRack-All / QER_ZITShopCheckStructure at line 14
  • Bulk DBQueue insert -> QER-K-ShoppingRack-All / QER_ZITShopCheckStructure at line 20
  • References QBM_PDBQueueInsert_Bulk
  • Trigger parent table: PWODecisionMethod

Typed Edges

  • queues DBQueue task QER_ZITShopOrderReset at line 13 Bulk DBQueue insert -> QER-K-ITSHOPOrder-RESET / QER_ZITShopOrderReset at line 13
  • queues DBQueue task QER_ZITShopOrderAbort at line 13 Bulk DBQueue insert -> QER-K-ITSHOPOrder-ABORT / QER_ZITShopOrderAbort at line 13
  • queues DBQueue task QER_ZITShopCheckStructure at line 13 Bulk DBQueue insert -> QER-K-ShoppingRack-All / QER_ZITShopCheckStructure at line 13
  • queues DBQueue task QER_ZITShopOrderAbort at line 14 Bulk DBQueue insert -> QER-K-ITSHOPOrder-ABORT / QER_ZITShopOrderAbort at line 14
  • queues DBQueue task QER_ZITShopCheckStructure at line 14 Bulk DBQueue insert -> QER-K-ShoppingRack-All / QER_ZITShopCheckStructure at line 14
  • queues DBQueue task QER_ZITShopCheckStructure at line 20 Bulk DBQueue insert -> QER-K-ShoppingRack-All / QER_ZITShopCheckStructure at line 20
  • trigger on table PWODecisionMethod Trigger parent table: PWODecisionMethod
  • references source dbo.QBM_FGIConfigparmValue source text reference
  • references source dbo.QBM_FGISessionContext source text reference
  • references source dbo.QBM_PDBQueueInsert_Bulk source text reference
  • references source dbo.QBM_PSessionErrorAdd source text reference

References

Referenced By

  • No direct source references extracted.

Complete Source

SQL122 lines
1CREATE trigger QER_TUPWODecisionMethod2  ON PWODecisionMethod FOR3UPDATE NOT FOR Replication4AS5BEGIN6  DECLARE @QER_ITShop_OnWorkflowAssign varchar(16)7  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(UID_SubMethodOrderProduct) OR21    UPDATE(UID_SubMethodOrderUnsubscribe) OR22    UPDATE(UID_SubMethodOrderProlongate)23    BEGIN24      SELECT25        @QER_ITShop_OnWorkflowAssign = dbo.QBM_FGIConfigparmValue('QER\ITShop\OnWorkflowAssign')26      IF @QER_ITShop_OnWorkflowAssign IN('RESET',27      'ABORT')28      BEGIN29        DECLARE @DBQueueElements_01 QBM_YDBQueueRaw30        INSERT INTO @DBQueueElements_01(Object,31        SubObject,32        GenProcID)33        SELECT34          x.uid,35          NULL,36          @GenProcID37        FROM(38        SELECT pwo.UID_PersonWantsOrg AS uid39        FROM PWODecisionMethod m40        JOIN deleted d41          ON m.UID_PWODecisionMethod = d.UID_PWODecisionMethod AND isnull(m.UID_SubMethodOrderProduct, '') <> isnull(d.UID_SubMethodOrderProduct,42        '')43        JOIN QERWorkingMethod wm44          ON wm.UID_PWODecisionSubMethod = d.UID_SubMethodOrderProduct45        JOIN PersonWantsOrg pwo46          ON pwo.UID_QERWorkingMethod = wm.UID_QERWorkingMethod47        UNION48        SELECT pwo.UID_PersonWantsOrg AS uid49        FROM PWODecisionMethod m50        JOIN deleted d51          ON m.UID_PWODecisionMethod = d.UID_PWODecisionMethod AND isnull(m.UID_SubMethodOrderProlongate, '') <> isnull(d.UID_SubMethodOrderProlongate,52        '')53        JOIN QERWorkingMethod wm54          ON wm.UID_PWODecisionSubMethod = d.UID_SubMethodOrderProlongate55        JOIN PersonWantsOrg pwo56          ON pwo.UID_QERWorkingMethod = wm.UID_QERWorkingMethod57        UNION58        SELECT pwo.UID_PersonWantsOrg AS uid59        FROM PWODecisionMethod m60        JOIN deleted d61          ON m.UID_PWODecisionMethod = d.UID_PWODecisionMethod AND isnull(m.UID_SubMethodOrderUnsubscribe, '') <> isnull(d.UID_SubMethodOrderUnsubscribe62        , '')63        JOIN QERWorkingMethod wm64          ON wm.UID_PWODecisionSubMethod = d.UID_SubMethodOrderUnsubscribe65        JOIN PersonWantsOrg pwo66          ON pwo.UID_QERWorkingMethod = wm.UID_QERWorkingMethod) AS x67        IF @QER_ITShop_OnWorkflowAssign = 'RESET'68        BEGIN69          EXEC QBM_PDBQueueInsert_Bulk 'QER-K-ITSHOPOrder-RESET',70            @DBQueueElements_0171        END72        IF @QER_ITShop_OnWorkflowAssign = 'ABORT'73        BEGIN74          EXEC QBM_PDBQueueInsert_Bulk 'QER-K-ITSHOPOrder-ABORT',75            @DBQueueElements_0176        END77      END78    END79    IF80    UPDATE(UID_OrgType) OR81    UPDATE(Priority) OR82    UPDATE(UID_SubMethodOrderProduct) OR83    UPDATE(UID_SubMethodOrderUnsubscribe) OR84    UPDATE(UID_SubMethodOrderProlongate)85    BEGIN86      DECLARE @DBQueueElements_02 QBM_YDBQueueRaw87      INSERT INTO @DBQueueElements_02(Object,88      SubObject,89      GenProcID)90      SELECT91        rtrim(isnull(ohm.uid_org, '')),92        NULL,93        @GenProcID94      FROM PWODecisionMethod95      JOIN deleted96        ON PWODecisionMethod.UID_PWODecisionMethod = deleted.UID_PWODecisionMethod97      JOIN BaseTreeHasPWODecisionMethod ohm98        ON PWODecisionMethod.uid_PWODecisionmethod = ohm.uid_PWODecisionmethod99      UNION100      SELECT101        rtrim(isnull(ohm.uid_org, '')),102        NULL,103        @GenProcID104      FROM PWODecisionMethod105      JOIN inserted106        ON PWODecisionMethod.UID_PWODecisionMethod = inserted.UID_PWODecisionMethod107      JOIN BaseTreeHasPWODecisionMethod ohm108        ON PWODecisionMethod.uid_PWODecisionmethod = ohm.uid_PWODecisionmethod109      EXEC QBM_PDBQueueInsert_Bulk 'QER-K-ShoppingRack-All',110        @DBQueueElements_02111    END112  END TRY113  BEGIN CATCH114    EXEC QBM_PSessionErrorAdd DEFAULT115    RAISERROR('',116    18,117    1)118      WITH NOWAIT119  END CATCH120  ende:121  RETURN122END
Open raw exported source
SQL ยท Raw22 lines
1create   trigger QER_TUPWODecisionMethod on PWODecisionMethod for Update not for Replication as begin  declare @QER_ITShop_OnWorkflowAssign varchar2(16) 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 3varchar(38) select @GenProcID = dbo.QBM_FGISessionContext('')   if update(UID_SubMethodOrderProduct) or update(UID_SubMethodOrderUnsubscribe) or update4(UID_SubMethodOrderProlongate) begin select @QER_ITShop_OnWorkflowAssign = dbo.QBM_FGIConfigparmValue('QER\ITShop\OnWorkflowAssign') if @QER_ITShop_OnWorkflowAssign5 in ('RESET', 'ABORT') begin declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01(Object, SubObject, GenProcID) select x.uid, null6, @GenProcID from ( select pwo.UID_PersonWantsOrg as uid from PWODecisionMethod m join deleted d on m.UID_PWODecisionMethod = d.UID_PWODecisionMethod and7 isnull(m.UID_SubMethodOrderProduct, '') <> isnull(d.UID_SubMethodOrderProduct, '') join QERWorkingMethod wm on wm.UID_PWODecisionSubMethod = d.UID_SubMethodOrderProduct8  join PersonWantsOrg pwo on pwo.UID_QERWorkingMethod = wm.UID_QERWorkingMethod union select pwo.UID_PersonWantsOrg as uid from PWODecisionMethod m join9 deleted d on m.UID_PWODecisionMethod = d.UID_PWODecisionMethod and isnull(m.UID_SubMethodOrderProlongate, '') <> isnull(d.UID_SubMethodOrderProlongate10, '') join QERWorkingMethod wm on wm.UID_PWODecisionSubMethod = d.UID_SubMethodOrderProlongate  join PersonWantsOrg pwo on pwo.UID_QERWorkingMethod = wm.UID_QERWorkingMethod11 union select pwo.UID_PersonWantsOrg as uid from PWODecisionMethod m join deleted d on m.UID_PWODecisionMethod = d.UID_PWODecisionMethod and isnull(m.UID_SubMethodOrderUnsubscribe12, '') <> isnull(d.UID_SubMethodOrderUnsubscribe, '') join QERWorkingMethod wm on wm.UID_PWODecisionSubMethod = d.UID_SubMethodOrderUnsubscribe  join PersonWantsOrg13 pwo on pwo.UID_QERWorkingMethod = wm.UID_QERWorkingMethod ) as x if @QER_ITShop_OnWorkflowAssign = 'RESET' begin exec QBM_PDBQueueInsert_Bulk 'QER-K-ITSHOPOrder-RESET'14, @DBQueueElements_01 end if @QER_ITShop_OnWorkflowAssign = 'ABORT' begin exec QBM_PDBQueueInsert_Bulk 'QER-K-ITSHOPOrder-ABORT', @DBQueueElements_01 end15 end end  if update(UID_OrgType) or update(Priority) or update(UID_SubMethodOrderProduct) or update(UID_SubMethodOrderUnsubscribe) or update(UID_SubMethodOrderProlongate16) begin declare @DBQueueElements_02 QBM_YDBQueueRaw insert into @DBQueueElements_02(Object, SubObject, GenProcID)  select rtrim(isnull(ohm.uid_org, '')17), null, @GenProcID from PWODecisionMethod join deleted on PWODecisionMethod.UID_PWODecisionMethod = deleted.UID_PWODecisionMethod join BaseTreeHasPWODecisionMethod18 ohm on PWODecisionMethod.uid_PWODecisionmethod = ohm.uid_PWODecisionmethod union select rtrim(isnull(ohm.uid_org, '')), null, @GenProcID from PWODecisionMethod19 join inserted on PWODecisionMethod.UID_PWODecisionMethod = inserted.UID_PWODecisionMethod join BaseTreeHasPWODecisionMethod ohm on PWODecisionMethod.uid_PWODecisionmethod20 = ohm.uid_PWODecisionmethod  exec QBM_PDBQueueInsert_Bulk 'QER-K-ShoppingRack-All', @DBQueueElements_02 end   END TRY BEGIN CATCH exec QBM_PSessionErrorAdd21 default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end 22