dbo.CPL_ZAllForPersonInBaseTree
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-ShoppingRackPWODecisionMaker / QER_ZITShopDecisionMakerFill at line 12
- References QBM_PDBQueueInsert_Single
Typed Edges
- queues DBQueue task QER_ZITShopDecisionMakerFill at line 12 Single DBQueue insert -> QER-K-ShoppingRackPWODecisionMaker / QER_ZITShopDecisionMakerFill at line 12
- references source dbo.QER_FGIOrgRootName source text reference
- references source dbo.QBM_PDBQueueInsert_Single source text reference
- references source dbo.QBM_PSessionErrorAdd source text reference
- references source dbo.QER_PITShopHelperFill source text reference
- references source dbo.QER_PITShopHelperFill_Recalc source text reference
- references source dbo.QER_PITShopHelperFillAll source text reference
- queues DBQueue task QER-K-ShoppingRackPWODecisionMaker -> QER_ZITShopDecisionMakerFill QBM_PDBQueueInsert_Single 'QER-K-ShoppingRackPWODecisionMaker' , '', '', @GenprocID end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH endLabel: end
References
- dbo.QER_FGIOrgRootName
- dbo.QBM_PDBQueueInsert_Single
- dbo.QBM_PSessionErrorAdd
- dbo.QER_PITShopHelperFill
- dbo.QER_PITShopHelperFill_Recalc
- dbo.QER_PITShopHelperFillAll
Referenced By
- No direct source references extracted.
Complete Source
1CREATE PROCEDURE CPL_ZAllForPersonInBaseTree(2 @SlotNumber int3)4AS5BEGIN6 DECLARE @GenprocID varchar(38) = newid()7 DECLARE @Parameter nvarchar(1000)8 DECLARE @Ident_OrgRoot nvarchar(64)9 DECLARE @ElementBuffer QBM_YCursorBuffer10 DECLARE @ElementCount int11 DECLARE @ElementIndex int12 DECLARE @DBQueueCurrent QBM_YDBQueueCurrent13 BEGIN TRY14 INSERT INTO @DBQueueCurrent(UID_DialogDBQueue,15 UID_Parameter,16 UID_SubParameter,17 GenProcID)18 SELECT19 UID_DialogDBQueue,20 UID_Parameter,21 UID_SubParameter,22 GenProcID23 FROM QBMDBQueueCurrent cu24 WITH(readpast)25 WHERE26 cu.SlotNumber = @SlotNumber27 IF @@rowcount = 028 BEGIN29 GOTO EndLabel30 END31 INSERT INTO @ElementBuffer(LongIdent1,32 UID1)33 SELECT34 DISTINCT dbo.QER_FGIOrgRootName(b.UID_OrgRoot),35 p.GenProcID36 FROM @DBQueueCurrent p37 JOIN BaseTree b38 ON p.UID_SubParameter = b.UID_Org39 SELECT @ElementCount = @@ROWCOUNT40 SELECT @ElementIndex = 141 WHILE @ElementIndex <= @ElementCount42 BEGIN43 SELECT44 TOP 1 @Ident_OrgRoot = bu.LongIdent1,45 @GenprocID = bu.UID146 FROM @ElementBuffer bu47 WHERE48 bu.ElementIndex = @ElementIndex49 IF @Ident_OrgRoot = 'AERole'50 BEGIN51 SELECT @Parameter = '|' + 'CPL-PWODecisionRule-OC|' + 'CPL-PWODecisionRule-OH|'52 EXEC QER_PITShopHelperFillAll @Parameter,53 @GenprocID54 END55 SELECT @ElementIndex += 156 END57 IF EXISTS(58 SELECT TOP 1 159 FROM QBMModuleDef60 WHERE61 ModuleName = 'ATT')62 BEGIN63 DECLARE @RecalcParameter_01 QBM_YCursorBuffer64 INSERT INTO @RecalcParameter_01(ObjectKey1,65 UID1,66 Ident1)67 SELECT68 bt.XObjectKey,69 'CPL-PWODecisionRule-AR',70 'A'71 FROM(72 SELECT73 cu.UID_Parameter AS UID_Person,74 cu.UID_SubParameter AS UID_Org75 FROM @DBQueueCurrent cu) i76 JOIN BaseTree bt77 ON i.UID_Org = bt.UID_Org78 EXEC QER_PITShopHelperFill_Recalc @RecalcParameter_01,79 @GenprocID80 END81 IF EXISTS(82 SELECT TOP 1 183 FROM @DBQueueCurrent p84 JOIN compliancerule cr85 ON p.UID_SubParameter = cr.uid_orgruler AND cr.IsInActive = 0 AND cr.IsWorkingCopy = 0)86 BEGIN87 EXEC QBM_PDBQueueInsert_Single 'QER-K-ShoppingRackPWODecisionMaker',88 '',89 '',90 @GenprocID91 END92 END TRY93 BEGIN CATCH94 EXEC QBM_PSessionErrorAdd DEFAULT95 RAISERROR('',96 18,97 1)98 WITH NOWAIT99 END CATCH100 endLabel:101END
Open raw exported source
1 create procedure CPL_ZAllForPersonInBaseTree (@SlotNumber int) as begin declare @GenprocID varchar(38) = newid() declare @Parameter nvarchar2(1000) declare @Ident_OrgRoot nvarchar(64) declare @ElementBuffer QBM_YCursorBuffer declare @ElementCount int declare @ElementIndex int declare @DBQueueCurrent3 QBM_YDBQueueCurrent BEGIN TRY insert into @DBQueueCurrent(UID_DialogDBQueue, UID_Parameter, UID_SubParameter, GenProcID) select UID_DialogDBQueue, UID_Parameter4, UID_SubParameter, GenProcID from QBMDBQueueCurrent cu with (readpast) where cu.SlotNumber = @SlotNumber if @@rowcount = 0 begin goto EndLabel end insert5 into @ElementBuffer (LongIdent1, UID1) select distinct dbo.QER_FGIOrgRootName(b.UID_OrgRoot), p.GenProcID from @DBQueueCurrent p join BaseTree b on p.UID_SubParameter6 = b.UID_Org select @ElementCount = @@ROWCOUNT select @ElementIndex = 1 while @ElementIndex <= @ElementCount begin select top 1 @Ident_OrgRoot = bu.LongIdent17 , @GenprocID = bu.UID1 from @ElementBuffer bu where bu.ElementIndex = @ElementIndex if @Ident_OrgRoot = 'AERole' begin select @Parameter = '|' +'CPL-PWODecisionRule-OC|'8 +'CPL-PWODecisionRule-OH|' exec QER_PITShopHelperFillAll @Parameter, @GenprocID end select @ElementIndex += 1 end if exists (select top 1 1 from QBMModuleDef9 where ModuleName = 'ATT') begin declare @RecalcParameter_01 QBM_YCursorBuffer insert into @RecalcParameter_01 (ObjectKey1, UID1, Ident1) select bt.XObjectKey10, 'CPL-PWODecisionRule-AR', 'A' from (select cu.UID_Parameter as UID_Person , cu.UID_SubParameter as UID_Org from @DBQueueCurrent cu ) i join BaseTree 11bt on i.UID_Org = bt.UID_Org exec QER_PITShopHelperFill_Recalc @RecalcParameter_01, @GenprocID end if exists (select top 1 1 from @DBQueueCurrent p join12 compliancerule cr on p.UID_SubParameter = cr.uid_orgruler and cr.IsInActive = 0 and cr.IsWorkingCopy = 0 ) begin exec QBM_PDBQueueInsert_Single 'QER-K-ShoppingRackPWODecisionMaker'13, '', '', @GenprocID end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH endLabel: end 14