dbo.QER_ZDynGroupSingleBasic
Stored ProcedureSQL_STORED_PROCEDURESandbox DB
Interpretation
- Database routine. Review parameters, called procedures, DBQueue inserts, and QBM_PJobCreate helper calls before assuming side effects.
- DBQueue relation detected. Follow the task procedure and referenced-by list for async processing.
Relations
- Single DBQueue insert -> QER-K-DynamicGroupTest / QER_ZDynamicGroupTest at line 14
- References QBM_PDBQueueInsert_Single
Typed Edges
- queues DBQueue task QER_ZDynamicGroupTest at line 14 Single DBQueue insert -> QER-K-DynamicGroupTest / QER_ZDynamicGroupTest at line 14
- references source dbo.QBM_FGIJobCreatedExists source text reference
- references source dbo.QER_FCVDynGuidToProcName source text reference
- references source dbo.QBM_PDBQueueInsert_Single source text reference
- references source dbo.QBM_PJournal source text reference
- references source dbo.QBM_PSessionContextSet source text reference
- references source dbo.QBM_PSessionErrorAdd source text reference
- queues DBQueue task QER-K-DynamicGroupTest -> QER_ZDynamicGroupTest QBM_PDBQueueInsert_Single 'QER-K-DynamicGroupTest', @uid_dynamicGroup , '', @GenprocID end end select @ElementIndex += 1 end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end
References
- dbo.QBM_FGIJobCreatedExists
- dbo.QER_FCVDynGuidToProcName
- dbo.QBM_PDBQueueInsert_Single
- dbo.QBM_PJournal
- dbo.QBM_PSessionContextSet
- dbo.QBM_PSessionErrorAdd
Referenced By
- No direct source references extracted.
Complete Source
1CREATE PROCEDURE QER_ZDynGroupSingleBasic(2 @SlotNumber int3)4AS5BEGIN6 DECLARE @uid_dynamicGroup varchar(38)7 DECLARE @ProcNameRechneDetail nvarchar(64)8 DECLARE @erg int = 09 DECLARE @GenProcID varchar(38)10 DECLARE @GroupsToInspect QBM_YCursorBuffer11 DECLARE @ElementCount int12 DECLARE @ElementIndex int13 DECLARE @DebugSwitch int = 014 DECLARE @DebugLevel char(1) = 'W'15 DECLARE @DebugMessage nvarchar(1000)16 DECLARE @DebugCounter int17 BEGIN TRY18 INSERT INTO @GroupsToInspect(UID1,19 UID2)20 SELECT21 cu.UID_SubParameter AS UID_DynamicGroup,22 max(cu.GenProcID)23 FROM QBMDBQueueCurrent cu24 WITH(readpast)25 WHERE26 cu.SlotNumber = @SlotNumber AND dbo.QBM_FGIJobCreatedExists(cu.UID_SubParameter) = 0 AND NOT EXISTS(27 SELECT TOP 1 128 FROM DialogDBQueue q29 WITH(nolock)30 WHERE31 q.UID_Task = 'QER-K-DynamicGroupTest' AND q.Object = cu.UID_SubParameter AND q.Generation >= 0) AND NOT EXISTS(32 SELECT TOP 1 133 FROM QBMDBQueueCurrent cu234 WITH(nolock)35 WHERE36 cu2.UID_Task = 'QER-K-DynamicGroupTest' AND cu2.UID_Parameter = cu.UID_SubParameter AND cu2.SlotNumber <> 0)37 GROUP BY cu.UID_SubParameter38 SELECT @ElementCount = @@ROWCOUNT39 SELECT @ElementIndex = 140 IF @DebugSwitch > 041 BEGIN42 SELECT @DebugCounter = COUNT(*)43 FROM @GroupsToInspect44 SELECT @DebugMessage = 'dyngroups ' + STR(@DebugCounter)45 EXEC QBM_PJournal @debugmessage,46 @@procid,47 'D',48 @DebugLevel49 END50 WHILE @ElementIndex <= @ElementCount51 BEGIN52 SELECT53 TOP 1 @uid_dynamicGroup = bu.uid1,54 @GenProcID = bu.UID255 FROM @GroupsToInspect bu56 WHERE57 bu.ElementIndex = @ElementIndex58 IF @DebugSwitch > 059 BEGIN60 SELECT @DebugCounter = COUNT(*)61 FROM QBMDBQueueCurrent62 WITH(readpast)63 WHERE64 SlotNumber = @SlotNumber65 SELECT @DebugMessage = 'Basic ' + @uid_dynamicGroup + ' personen ' + STR(@DebugCounter)66 EXEC QBM_PJournal @debugmessage,67 @@procid,68 'D',69 @DebugLevel70 END71 SELECT72 @ProcNameRechneDetail = dbo.QER_FCVDynGuidToProcName(@uid_DynamicGroup,73 'Detail')74 IF EXISTS(75 SELECT TOP 1 176 FROM sys.procedures77 WHERE78 name = @ProcNameRechneDetail AND type = 'P')79 BEGIN80 EXEC QBM_PSessionContextSet 'GENPROCID',81 @GenProcID82 EXEC @erg = @ProcNameRechneDetail @SlotNumber83 IF @erg > 084 BEGIN85 EXEC QBM_PDBQueueInsert_Single 'QER-K-DynamicGroupTest',86 @uid_dynamicGroup,87 '',88 @GenprocID89 END90 END91 SELECT @ElementIndex += 192 END93 END TRY94 BEGIN CATCH95 EXEC QBM_PSessionErrorAdd DEFAULT96 RAISERROR('',97 18,98 1)99 WITH NOWAIT100 END CATCH101 ende:102 RETURN103END
Open raw exported source
1 create procedure QER_ZDynGroupSingleBasic (@SlotNumber int ) as begin declare @uid_dynamicGroup varchar(38) declare @ProcNameRechneDetail2 nvarchar(64) declare @erg int = 0 declare @GenProcID varchar(38) declare @GroupsToInspect QBM_YCursorBuffer declare @ElementCount int declare @ElementIndex3 int declare @DebugSwitch int = 0 declare @DebugLevel char(1) = 'W' declare @DebugMessage nvarchar(1000) declare @DebugCounter int BEGIN TRY insert into4 @GroupsToInspect(UID1, UID2) select cu.UID_SubParameter as UID_DynamicGroup , max(cu.GenProcID) from QBMDBQueueCurrent cu with (readpast) where cu.SlotNumber5 = @SlotNumber and dbo.QBM_FGIJobCreatedExists(cu.UID_SubParameter) = 0 and not exists (Select top 1 1 from DialogDBQueue q with (nolock) where q.UID_Task6 = 'QER-K-DynamicGroupTest' and q.Object = cu.UID_SubParameter and q.Generation >= 0 ) and not exists (Select top 1 1 from QBMDBQueueCurrent cu2 with7 (nolock) where cu2.UID_Task = 'QER-K-DynamicGroupTest' and cu2.UID_Parameter = cu.UID_SubParameter and cu2.SlotNumber <> 0 ) group by cu.UID_SubParameter8 select @ElementCount = @@ROWCOUNT select @ElementIndex = 1 if @DebugSwitch > 0 begin select @DebugCounter = COUNT(*) from @GroupsToInspect select @DebugMessage9 = 'dyngroups ' + STR(@DebugCounter) exec QBM_PJournal @debugmessage, @@procid, 'D', @DebugLevel end while @ElementIndex <= @ElementCount begin select 10top 1 @uid_dynamicGroup = bu.uid1 , @GenProcID = bu.UID2 from @GroupsToInspect bu where bu.ElementIndex = @ElementIndex if @DebugSwitch > 0 begin select11 @DebugCounter = COUNT(*) from QBMDBQueueCurrent with (readpast) where SlotNumber = @SlotNumber select @DebugMessage = 'Basic ' + @uid_dynamicGroup + ' personen '12 + STR(@DebugCounter) exec QBM_PJournal @debugmessage, @@procid, 'D', @DebugLevel end select @ProcNameRechneDetail = dbo.QER_FCVDynGuidToProcName(@uid_DynamicGroup13, 'Detail') if exists (select top 1 1 from sys.procedures where name = @ProcNameRechneDetail and type = 'P' ) begin exec QBM_PSessionContextSet 'GENPROCID'14, @GenProcID exec @erg = @ProcNameRechneDetail @SlotNumber if @erg > 0 begin exec QBM_PDBQueueInsert_Single 'QER-K-DynamicGroupTest', @uid_dynamicGroup15, '', @GenprocID end end select @ElementIndex += 1 end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH16 ende: return end 17