Back to OIM Explorer

dbo.RMS_TIWorkDeskHasESet

Database TriggerSQL_TRIGGERSandbox DB

Database Trigger on WorkDeskHasESet. Bulk DBQueue insert -> RMS-K-WorkdeskHasESet / RMS_ZWorkDeskHasESet at line 9; Bulk DBQueue insert -> at line 9; Bulk DBQueue insert -> at line 16; References QBM_PDBQueueInsert_Bulk

Source: sandbox-db sys.sql_modules

Source size: 2.628 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 -> RMS-K-WorkdeskHasESet / RMS_ZWorkDeskHasESet at line 9
  • Bulk DBQueue insert -> at line 9
  • Bulk DBQueue insert -> at line 16
  • References QBM_PDBQueueInsert_Bulk
  • Trigger parent table: WorkDeskHasESet

Typed Edges

  • queues DBQueue task RMS_ZWorkDeskHasESet at line 9 Bulk DBQueue insert -> RMS-K-WorkdeskHasESet / RMS_ZWorkDeskHasESet at line 9
  • queues DBQueue task at line 9 Bulk DBQueue insert -> at line 9
  • queues DBQueue task at line 16 Bulk DBQueue insert -> at line 16
  • trigger on table WorkDeskHasESet Trigger parent table: WorkDeskHasESet
  • references source dbo.QBM_FGIBitPatternXOrigin source text reference
  • references source dbo.QBM_FGISessionContext source text reference
  • references source dbo.QER_FGIITShopFlagCombineValid source text reference
  • references source dbo.QBM_PDBQueueInsert_Bulk source text reference
  • references source dbo.QBM_PSessionErrorAdd source text reference

Complete Source

SQL108 lines
1CREATE trigger RMS_TIWorkDeskHasESet2  ON WorkDeskHasESet FOR3INSERT NOT FOR Replication4AS5BEGIN6  DECLARE @EsetOperation varchar(38)7  DECLARE @EsetTable varchar(30)8  DECLARE @ElementBuffer QBM_YCursorBuffer9  DECLARE @ElementCount int10  DECLARE @ElementIndex int11  DECLARE @QBM_BitPatternXOrigin_Direct int = dbo.QBM_FGIBitPatternXOrigin('|Direct|',12  0)13  DECLARE @QBM_BitPatternXOrigin_Inherit_inv int = dbo.QBM_FGIBitPatternXOrigin('|Inherit|',14  1)15  DECLARE @DBQueueElements_spezial QBM_YDBQueueRaw16  BEGIN TRY17    IF EXISTS(18      SELECT TOP 1 119      FROM inserted)20    GOTO start21    RETURN start:22    DECLARE @GenProcID varchar(38)23    SELECT @GenProcID = dbo.QBM_FGISessionContext('')24    IF EXISTS(25      SELECT TOP 1 126      FROM inserted i27      JOIN ESet elem28        ON i.uid_ESet = elem.uid_ESet29      WHERE30        dbo.QER_FGIITShopFlagCombineValid(i.XObjectKey, NULL, NULL, elem.XObjectKey, elem.IsForITShop, elem.IsITShopOnly) = 0 AND i.XOrigin & @QBM_BitPatternXOrigin_Direct31    > 0)32    BEGIN33      RAISERROR('#LDS#Assignment is not permitted due to the combination of IT Shop flags.|',34      18,35      2)36        WITH nowait37    END38    DECLARE @DBQueueElements_01 QBM_YDBQueueRaw39    INSERT INTO @DBQueueElements_01(object,40    subobject,41    genprocid)42    SELECT43      x.uid,44      NULL,45      @GenProcID46    FROM(47    SELECT48      DISTINCT i.UID_WorkDesk AS uid49    FROM inserted i50    WHERE51      i.XOrigin & @QBM_BitPatternXOrigin_Inherit_inv > 0) AS x52    EXEC QBM_PDBQueueInsert_Bulk 'RMS-K-WorkdeskHasESet',53      @DBQueueElements_0154    INSERT INTO @ElementBuffer(UID1,55    Ident1)56    SELECT57      DISTINCT v.UID_TaskWorkDesk,58      t.TableName59    FROM inserted i60    JOIN ESetHasEntitlement ehe61      ON i.uid_ESet = ehe.uid_ESet AND ehe.XOrigin > 062    JOIN DialogTable t63      ON ehe.Entitlement LIKE '<Key><T>' + t.TableName + '</T>%' AND t.TableName <> 'ESet'64    JOIN BaseTreeAssign v65      ON t.UID_DialogTable = v.UID_DialogTableElement66    WHERE67      v.UID_TaskWorkDesk > ' ' AND i.XIsInEffect = 168    SELECT @ElementCount = @@rowcount69    SELECT @ElementIndex = 170    WHILE @ElementIndex <= @ElementCount71    BEGIN72      SELECT73        TOP 1 @EsetOperation = bu.UID1,74        @EsetTable = bu.Ident175      FROM @ElementBuffer bu76      WHERE77        bu.ElementIndex = @ElementIndex78      DELETE @DBQueueElements_spezial79      INSERT INTO @DBQueueElements_spezial(object,80      subobject,81      genprocid)82      SELECT83        x.uid,84        NULL,85        @GenProcID86      FROM(87      SELECT88        DISTINCT i.uid_WorkDesk AS uid89      FROM inserted i90      JOIN ESetHasEntitlement ehe91        ON i.uid_ESet = ehe.uid_ESet AND ehe.XOrigin > 092      WHERE93        ehe.Entitlement LIKE '<Key><T>' + @EsetTable + '</T>%' AND i.XIsInEffect = 1) AS x94      EXEC QBM_PDBQueueInsert_Bulk @EsetOperation,95        @DBQueueElements_spezial96      SELECT @ElementIndex += 197    END98  END TRY99  BEGIN CATCH100    EXEC QBM_PSessionErrorAdd DEFAULT101    RAISERROR('',102    18,103    1)104      WITH NOWAIT105  END CATCH106  ende:107  RETURN108END
Open raw exported source
SQL ยท Raw18 lines
1  create   trigger RMS_TIWorkDeskHasESet on WorkDeskHasESet  for Insert not for Replication as begin  declare @EsetOperation varchar(38) declare2 @EsetTable varchar(30) declare @ElementBuffer QBM_YCursorBuffer declare @ElementCount int declare @ElementIndex int declare @QBM_BitPatternXOrigin_Direct3 int = dbo.QBM_FGIBitPatternXOrigin('|Direct|', 0) declare @QBM_BitPatternXOrigin_Inherit_inv int = dbo.QBM_FGIBitPatternXOrigin('|Inherit|', 1)  declare4 @DBQueueElements_spezial QBM_YDBQueueRaw BEGIN TRY if exists (select top 1 1 from inserted) goto start return start: declare @GenProcID varchar(38) select5 @GenProcID = dbo.QBM_FGISessionContext('')   if exists (select top 1 1 from inserted i   join ESet elem on i.uid_ESet = elem.uid_ESet where dbo.QER_FGIITShopFlagCombineValid6(i.XObjectKey, null, null, elem.XObjectKey, elem.IsForITShop, elem.IsITShopOnly) = 0 and i.XOrigin & @QBM_BitPatternXOrigin_Direct > 0 ) begin  raiserror7 ('#LDS#Assignment is not permitted due to the combination of IT Shop flags.|', 18, 2) with nowait end declare @DBQueueElements_01 QBM_YDBQueueRaw insert8 into @DBQueueElements_01 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select distinct i.UID_WorkDesk as uid from inserted i   9where i.XOrigin & @QBM_BitPatternXOrigin_Inherit_inv > 0 ) as x exec QBM_PDBQueueInsert_Bulk 'RMS-K-WorkdeskHasESet', @DBQueueElements_01  insert into 10@ElementBuffer(UID1, Ident1) select distinct v.UID_TaskWorkDesk, t.TableName from inserted i join ESetHasEntitlement ehe on i.uid_ESet = ehe.uid_ESet and11 ehe.XOrigin > 0  join DialogTable t on  ehe.Entitlement like '<Key><T>' + t.TableName + '</T>%' and t.TableName <> 'ESet' join BaseTreeAssign v on t.UID_DialogTable12 = v.UID_DialogTableElement where v.UID_TaskWorkDesk > ' ' and i.XIsInEffect = 1 select @ElementCount = @@rowcount select @ElementIndex = 1 while @ElementIndex13 <= @ElementCount begin select top 1 @EsetOperation = bu.UID1 , @EsetTable = bu.Ident1 from @ElementBuffer bu where bu.ElementIndex = @ElementIndex    14delete  @DBQueueElements_spezial insert into @DBQueueElements_spezial (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select distinct15 i.uid_WorkDesk as uid from inserted i join ESetHasEntitlement ehe on i.uid_ESet = ehe.uid_ESet and ehe.XOrigin > 0  where  ehe.Entitlement like '<Key><T>'16 + @EsetTable + '</T>%' and i.XIsInEffect = 1 ) as x exec QBM_PDBQueueInsert_Bulk @EsetOperation, @DBQueueElements_spezial select @ElementIndex += 1 end17  END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end 18