dbo.QER_ZAllChildrenOfOrg
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 -> at line 8
- References QBM_PDBQueueInsert_Bulk
Typed Edges
- queues DBQueue task at line 8 Bulk DBQueue insert -> at line 8
- 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
1CREATE PROCEDURE QER_ZAllChildrenOfOrg(2 @SlotNumber int3)4AS5BEGIN6 DECLARE @taskname varchar(38)7 DECLARE @ElementBuffer QBM_YCursorBuffer8 DECLARE @ElementCount int9 DECLARE @ElementIndex int10 DECLARE @DBQueueCurrent QBM_YDBQueueCurrent11 BEGIN TRY12 INSERT INTO @DBQueueCurrent(UID_DialogDBQueue,13 UID_Parameter,14 UID_SubParameter,15 GenProcID)16 SELECT17 UID_DialogDBQueue,18 UID_Parameter,19 UID_SubParameter,20 GenProcID21 FROM QBMDBQueueCurrent cu22 WITH(readpast)23 WHERE24 cu.SlotNumber = @SlotNumber25 IF @@rowcount = 026 BEGIN27 GOTO EndLabel28 END29 DECLARE @DBQueueElements_01 QBM_YDBQueueRaw30 INSERT INTO @DBQueueElements_01(object,31 subobject,32 genprocid)33 SELECT34 x.object,35 NULL,36 x.GenProcID37 FROM(38 SELECT39 DISTINCT oc.uid_org AS object,40 p.genprocid41 FROM @DBQueueCurrent p42 JOIN BaseTreeCollection oc43 ON oc.uid_parentOrg = p.uid_parameter) AS x44 INSERT INTO @ElementBuffer(UID1)45 SELECT46 DISTINCT uid_subparameter47 FROM @DBQueueCurrent p48 SELECT @ElementCount = @@ROWCOUNT49 SELECT @ElementIndex = 150 WHILE @ElementIndex <= @ElementCount51 BEGIN52 SELECT TOP 1 @taskname = bu.UID153 FROM @ElementBuffer bu54 WHERE55 bu.ElementIndex = @ElementIndex56 EXEC QBM_PDBQueueInsert_Bulk @taskname,57 @DBQueueElements_0158 SELECT @ElementIndex += 159 END60 END TRY61 BEGIN CATCH62 EXEC QBM_PSessionErrorAdd DEFAULT63 RAISERROR('',64 18,65 1)66 WITH NOWAIT67 END CATCH68 endLabel:69END
Open raw exported source
1 create procedure QER_ZAllChildrenOfOrg (@SlotNumber int) as begin declare @taskname varchar(38) declare @ElementBuffer QBM_YCursorBuffer2 declare @ElementCount int declare @ElementIndex int declare @DBQueueCurrent QBM_YDBQueueCurrent BEGIN TRY insert into @DBQueueCurrent(UID_DialogDBQueue3, UID_Parameter, UID_SubParameter, GenProcID) select UID_DialogDBQueue, UID_Parameter, UID_SubParameter, GenProcID from QBMDBQueueCurrent cu with (readpast4) where cu.SlotNumber = @SlotNumber if @@rowcount = 0 begin goto EndLabel end declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_015 (object, subobject, genprocid) select x.object, null, x.GenProcID from ( select distinct oc.uid_org as object , p.genprocid from @DBQueueCurrent p join6 BaseTreeCollection oc on oc.uid_parentOrg = p.uid_parameter ) as x insert into @ElementBuffer (UID1) select distinct uid_subparameter from @DBQueueCurrent7 p select @ElementCount = @@ROWCOUNT select @ElementIndex = 1 while @ElementIndex <= @ElementCount begin select top 1 @taskname = bu.UID1 from @ElementBuffer8 bu where bu.ElementIndex = @ElementIndex exec QBM_PDBQueueInsert_Bulk @taskname, @DBQueueElements_01 select @ElementIndex += 1 end END TRY BEGIN CATCH9 exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH endLabel: end 10