dbo.QER_ZDynGroupSinglePerson
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
- Bulk DBQueue insert -> QER-K-DynamicGroupTest / QER_ZDynamicGroupTest at line 9
- Bulk DBQueue insert -> QER-K-DynamicGroupSingleBasic / QER_ZDynGroupSingleBasic at line 9
- Bulk DBQueue insert -> QER-K-DynamicGroupSingleBasic / QER_ZDynGroupSingleBasic at line 14
- References QBM_PDBQueueInsert_Bulk
Typed Edges
- queues DBQueue task QER_ZDynamicGroupTest at line 9 Bulk DBQueue insert -> QER-K-DynamicGroupTest / QER_ZDynamicGroupTest at line 9
- queues DBQueue task QER_ZDynGroupSingleBasic at line 9 Bulk DBQueue insert -> QER-K-DynamicGroupSingleBasic / QER_ZDynGroupSingleBasic at line 9
- queues DBQueue task QER_ZDynGroupSingleBasic at line 14 Bulk DBQueue insert -> QER-K-DynamicGroupSingleBasic / QER_ZDynGroupSingleBasic at line 14
- references source dbo.QBM_FGIJobCreatedExists source text reference
- references source dbo.QBM_FGITableCountAll source text reference
- references source dbo.QBM_PDBQueueInsert_Bulk source text reference
- references source dbo.QBM_PSessionErrorAdd source text reference
- queues DBQueue task QER-K-DynamicGroupTest -> QER_ZDynamicGroupTest QBM_PDBQueueInsert_Bulk 'QER-K-DynamicGroupTest', @DBQueueElements_02 end else begin declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01(Object, SubObject , GenProcID) select cu.UID_Parameter, dg.uid_dynamicGroup , …
- queues DBQueue task QER-K-DynamicGroupSingleBasic -> QER_ZDynGroupSingleBasic QBM_PDBQueueInsert_Bulk 'QER-K-DynamicGroupSingleBasic', @DBQueueElements_01 end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH endLabel: return end
References
- dbo.QBM_FGIJobCreatedExists
- dbo.QBM_FGITableCountAll
- dbo.QBM_PDBQueueInsert_Bulk
- dbo.QBM_PSessionErrorAdd
Referenced By
- No direct source references extracted.
Complete Source
1CREATE PROCEDURE QER_ZDynGroupSinglePerson(2 @SlotNumber int3)4AS5BEGIN6 DECLARE @GenProcID varchar(38)7 DECLARE @CountPerson_All float8 DECLARE @CountPerson_ForDyna float9 DECLARE @LimitForFullGroup float = 0.00110 DECLARE @LimitAbsolute float = 10011 DECLARE @DBQueueCurrent QBM_YDBQueueCurrent12 BEGIN TRY13 INSERT INTO @DBQueueCurrent(UID_DialogDBQueue,14 UID_Parameter,15 UID_SubParameter,16 GenProcID)17 SELECT18 UID_DialogDBQueue,19 UID_Parameter,20 UID_SubParameter,21 GenProcID22 FROM QBMDBQueueCurrent cu23 WITH(readpast)24 WHERE25 cu.SlotNumber = @SlotNumber26 IF @@rowcount = 027 BEGIN28 GOTO EndLabel29 END30 SELECT31 @CountPerson_All = convert(float,32 dbo.QBM_FGITableCountAll('Person'))33 IF @CountPerson_All = 0.034 BEGIN35 SELECT @CountPerson_All = 1.036 END37 SELECT @CountPerson_ForDyna = COUNT(*)38 FROM QBMDBQueueCurrent o39 WITH(readpast)40 WHERE41 o.UID_Task = 'QER-K-DynamicGroupSinglePerson' AND o.SlotNumber > 042 SELECT @CountPerson_ForDyna += COUNT(*)43 FROM @DBQueueCurrent o44 IF @CountPerson_ForDyna / @CountPerson_All > @LimitForFullGroup AND @CountPerson_ForDyna > @LimitAbsolute45 BEGIN46 DECLARE @DBQueueElements_02 QBM_YDBQueueRaw47 SELECT TOP 1 @GenProcID = cu.GenProcID48 FROM @DBQueueCurrent cu49 INSERT INTO @DBQueueElements_02(Object,50 SubObject,51 GenProcID)52 SELECT53 d.UID_DynamicGroup,54 NULL,55 @GenProcID56 FROM DynamicGroup d57 WHERE58 d.UID_DialogTableObjectClass = 'QER-T-Person'59 EXEC QBM_PDBQueueInsert_Bulk 'QER-K-DynamicGroupTest',60 @DBQueueElements_0261 END62 ELSE63 BEGIN64 DECLARE @DBQueueElements_01 QBM_YDBQueueRaw65 INSERT INTO @DBQueueElements_01(Object,66 SubObject,67 GenProcID)68 SELECT69 cu.UID_Parameter,70 dg.uid_dynamicGroup,71 cu.GenProcID72 FROM @DBQueueCurrent cu CROSS73 JOIN DynamicGroup dg74 JOIN DialogTable t75 WITH(readpast)76 ON dg.UID_DialogTableObjectClass = t.UID_DialogTable77 WHERE78 t.TableName = 'Person' AND dbo.QBM_FGIJobCreatedExists(dg.XObjectKey) = 0 AND NOT EXISTS(79 SELECT TOP 1 180 FROM DialogDBQueue q81 WITH(nolock)82 WHERE83 q.UID_Task = 'QER-K-DynamicGroupTest' AND q.Object = dg.UID_DynamicGroup AND q.Generation >= 0)84 EXEC QBM_PDBQueueInsert_Bulk 'QER-K-DynamicGroupSingleBasic',85 @DBQueueElements_0186 END87 END TRY88 BEGIN CATCH89 EXEC QBM_PSessionErrorAdd DEFAULT90 RAISERROR('',91 18,92 1)93 WITH NOWAIT94 END CATCH95 endLabel:96 RETURN97END
Open raw exported source
1 create procedure QER_ZDynGroupSinglePerson (@SlotNumber int) as begin declare @GenProcID varchar(38) declare @CountPerson_All float declare2 @CountPerson_ForDyna float declare @LimitForFullGroup float = 0.001 declare @LimitAbsolute float = 100 declare @DBQueueCurrent QBM_YDBQueueCurrent BEGIN3 TRY insert into @DBQueueCurrent(UID_DialogDBQueue, UID_Parameter, UID_SubParameter, GenProcID) select UID_DialogDBQueue, UID_Parameter, UID_SubParameter4, GenProcID from QBMDBQueueCurrent cu with (readpast) where cu.SlotNumber = @SlotNumber if @@rowcount = 0 begin goto EndLabel end select @CountPerson_All5 = convert(float, dbo.QBM_FGITableCountAll('Person')) if @CountPerson_All = 0.0 begin select @CountPerson_All = 1.0 end select @CountPerson_ForDyna = 6COUNT(*) from QBMDBQueueCurrent o with (readpast) where o.UID_Task = 'QER-K-DynamicGroupSinglePerson' and o.SlotNumber > 0 select @CountPerson_ForDyna 7+= COUNT(*) from @DBQueueCurrent o if @CountPerson_ForDyna / @CountPerson_All > @LimitForFullGroup and @CountPerson_ForDyna > @LimitAbsolute begin declare8 @DBQueueElements_02 QBM_YDBQueueRaw select top 1 @GenProcID = cu.GenProcID from @DBQueueCurrent cu insert into @DBQueueElements_02(Object, SubObject, 9GenProcID) select d.UID_DynamicGroup, null, @GenProcID from DynamicGroup d where d.UID_DialogTableObjectClass = 'QER-T-Person' exec QBM_PDBQueueInsert_Bulk10 'QER-K-DynamicGroupTest', @DBQueueElements_02 end else begin declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01(Object, SubObject11, GenProcID) select cu.UID_Parameter, dg.uid_dynamicGroup , cu.GenProcID from @DBQueueCurrent cu cross join DynamicGroup dg join DialogTable t with (readpast12) on dg.UID_DialogTableObjectClass = t.UID_DialogTable where t.TableName = 'Person' and dbo.QBM_FGIJobCreatedExists(dg.XObjectKey) = 0 and not exists13 (Select top 1 1 from DialogDBQueue q with (nolock) where q.UID_Task = 'QER-K-DynamicGroupTest' and q.Object = dg.UID_DynamicGroup and q.Generation >=14 0 ) exec QBM_PDBQueueInsert_Bulk 'QER-K-DynamicGroupSingleBasic', @DBQueueElements_01 end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR15 ('', 18, 1) WITH NOWAIT END CATCH endLabel: return end 16