dbo.QER_PITShopHelperFillAll
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 10
- References QBM_PDBQueueInsert_Bulk
Typed Edges
- queues DBQueue task at line 10 Bulk DBQueue insert -> at line 10
- references source dbo.QBM_FCVStringToList source text reference
- references source dbo.QBM_FCVStringToBit source text reference
- references source dbo.QBM_FGIConfigparmValue source text reference
- references source dbo.QER_FGIGenProcIDForPWO source text reference
- references source dbo.QER_FGIPWOTaskToUse source text reference
- references source dbo.QBM_PDBQueueInsert_Bulk source text reference
- references source dbo.QBM_PSessionErrorAdd source text reference
- references source dbo.QER_PITShopHelperFill source text reference
Complete Source
1CREATE PROCEDURE QER_PITShopHelperFillAll(2 @DecisionRules nvarchar(2000),3 @GenProcID varchar(38) = NULL4)5AS6BEGIN7 DECLARE @CfgUseGenProcID BIT = dbo.QBM_FCVStringToBit(dbo.QBM_FGIConfigparmValue('Common\ProcessState\UseGenProcIDFromPWO'))8 DECLARE @PWOTaskToUse varchar(38) = dbo.QER_FGIPWOTaskToUse()9 SET XACT_ABORT OFF10 BEGIN TRY11 IF isnull(@GenProcID,12 '') = ''13 BEGIN14 SELECT @GenProcID = NEWID()15 END16 IF dbo.QBM_FGIConfigparmValue('QER\ITShop') = ''17 BEGIN18 GOTO endLabel19 END20 IF @PWOTaskToUse > ' '21 BEGIN22 DECLARE @DBQueueElements_01 QBM_YDBQueueRaw23 INSERT INTO @DBQueueElements_01(object,24 subobject,25 genprocid)26 SELECT27 x.uid,28 NULL,29 x.GenProcID30 FROM(31 SELECT32 DISTINCT pwo.UID_PersonWantsOrg AS uid,33 dbo.QER_FGIGenProcIDForPWO(pwo.GenProcID, @GenProcID, @CfgUseGenProcID) AS GenProcID34 FROM pwodecisionrule r35 JOIN dbo.QBM_FCVStringToList(@DecisionRules, '|', 1, 0) pa36 ON r.UID_PWODecisionRule = pa.ParameterValue AND r.UsageArea = 'I' AND r.UID_Task IS NULL37 JOIN QERWorkingStep ps38 ON ps.UID_PWODecisionRule = r.UID_PWODecisionRule39 JOIN PersonWantsOrg pwo40 ON ps.UID_QERWorkingMethod = pwo.UID_QERWorkingMethod41 WHERE42 pwo.OrderState IN('OrderProduct', 'OrderProlongate', 'OrderUnsubscribe') OR EXISTS(43 SELECT TOP 1 144 FROM PWOHelperPWO h45 WHERE46 h.UID_PersonWantsOrg = pwo.UID_PersonWantsOrg)) AS x47 WHERE48 NOT EXISTS(49 SELECT TOP 1 150 FROM DialogDBQueue q51 WITH(nolock)52 WHERE53 q.UID_Task = @PWOTaskToUse AND q.Object = x.uid AND q.Generation >= 0)54 EXEC QBM_PDBQueueInsert_Bulk @PWOTaskToUse,55 @DBQueueElements_0156 END57 END TRY58 BEGIN CATCH59 EXEC QBM_PSessionErrorAdd DEFAULT60 RAISERROR('',61 18,62 1)63 WITH NOWAIT64 END CATCH65 endLabel:66 RETURN67END
Open raw exported source
1 create procedure QER_PITShopHelperFillAll (@DecisionRules nvarchar(2000) , @GenProcID varchar(38) = null ) as begin declare @CfgUseGenProcID2 bit = dbo.QBM_FCVStringToBit(dbo.QBM_FGIConfigparmValue('Common\ProcessState\UseGenProcIDFromPWO')) declare @PWOTaskToUse varchar(38) = dbo.QER_FGIPWOTaskToUse3() SET XACT_ABORT OFF BEGIN TRY if isnull(@GenProcID, '') = '' begin select @GenProcID = NEWID() end if dbo.QBM_FGIConfigparmValue('QER\ITShop') = '' begin4 goto endLabel end if @PWOTaskToUse > ' ' begin declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject, genprocid5) select x.uid, null, x.GenProcID from ( select distinct pwo.UID_PersonWantsOrg as uid , dbo.QER_FGIGenProcIDForPWO(pwo.GenProcID, @GenProcID, @CfgUseGenProcID6) as GenProcID from pwodecisionrule r join dbo.QBM_FCVStringToList(@DecisionRules, '|', 1, 0 ) pa on r.UID_PWODecisionRule = pa.ParameterValue and r.UsageArea7 ='I' and r.UID_Task is null join QERWorkingStep ps on ps.UID_PWODecisionRule = r.UID_PWODecisionRule join PersonWantsOrg pwo on ps.UID_QERWorkingMethod8 = pwo.UID_QERWorkingMethod where pwo.OrderState in ( 'OrderProduct', 'OrderProlongate', 'OrderUnsubscribe' ) or exists ( select top 1 1 from PWOHelperPWO9 h where h.UID_PersonWantsOrg = pwo.UID_PersonWantsOrg ) ) as x where not exists (select top 1 1 from DialogDBQueue q with (nolock) where q.UID_Task =10 @PWOTaskToUse and q.Object = x.uid and q.Generation >= 0 ) exec QBM_PDBQueueInsert_Bulk @PWOTaskToUse, @DBQueueElements_01 end END TRY BEGIN CATCH exec11 QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH endLabel: return end 12