dbo.RPS_ZAllForOneRPSReport
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 -> RPS-K-OrgHasRPSReport / RPS_ZOrgHasRPSReport at line 6
- Bulk DBQueue insert -> RPS-K-PersonHasRPSReport / RPS_ZPersonHasRPSReport at line 6
- Bulk DBQueue insert -> RPS-K-PersonHasRPSReport / RPS_ZPersonHasRPSReport at line 10
- References QBM_PDBQueueInsert_Bulk
Typed Edges
- queues DBQueue task RPS_ZOrgHasRPSReport at line 6 Bulk DBQueue insert -> RPS-K-OrgHasRPSReport / RPS_ZOrgHasRPSReport at line 6
- queues DBQueue task RPS_ZPersonHasRPSReport at line 6 Bulk DBQueue insert -> RPS-K-PersonHasRPSReport / RPS_ZPersonHasRPSReport at line 6
- queues DBQueue task RPS_ZPersonHasRPSReport at line 10 Bulk DBQueue insert -> RPS-K-PersonHasRPSReport / RPS_ZPersonHasRPSReport at line 10
- references source dbo.QBM_PDBQueueInsert_Bulk source text reference
- references source dbo.QBM_PJournal source text reference
- references source dbo.QBM_PSessionErrorAdd source text reference
- queues DBQueue task RPS-K-OrgHasRPSReport -> RPS_ZOrgHasRPSReport QBM_PDBQueueInsert_Bulk 'RPS-K-OrgHasRPSReport', @DBQueueElements_01 declare @DBQueueElements_02 QBM_YDBQueueRaw insert into @DBQueueElements_02 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select uid_person as uid …
- queues DBQueue task RPS-K-PersonHasRPSReport -> RPS_ZPersonHasRPSReport QBM_PDBQueueInsert_Bulk 'RPS-K-PersonHasRPSReport', @DBQueueElements_02 END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end
References
Referenced By
- No direct source references extracted.
Complete Source
1CREATE PROCEDURE RPS_ZAllForOneRPSReport(2 @SlotNumber int,3 @uid_RPSReport varchar(38),4 @dummy varchar(38),5 @GenProcID varchar(38)6)7AS8BEGIN9 DECLARE @MsgTxt nvarchar(1024)10 DECLARE @DebugLevel char(1) = 'W'11 BEGIN TRY12 IF NOT EXISTS(13 SELECT TOP 1 114 FROM RPSReport15 WHERE16 uid_RPSReport = isnull(@uid_RPSReport, ''))17 BEGIN18 SELECT19 @MsgTxt = N 'RPSReport ' + rtrim(@uid_RPSReport) + ' not exists, Job ALLFORONERPSReport was killed'20 EXEC QBM_PJournal @MsgTxt,21 @@procid,22 'D',23 @DebugLevel24 GOTO ende25 END26 DECLARE @DBQueueElements_01 QBM_YDBQueueRaw27 INSERT INTO @DBQueueElements_01(object,28 subobject,29 genprocid)30 SELECT31 x.uid,32 NULL,33 @GenProcID34 FROM(35 SELECT co.UID_Org AS uid36 FROM BaseTreeHasRPSReport bhr37 JOIN BaseTreeCollection co38 ON bhr.UID_Org = co.UID_ParentOrg39 WHERE40 bhr.UID_RPSReport = @uid_RPSReport AND bhr.XOrigin > 0) AS x41 EXEC QBM_PDBQueueInsert_Bulk 'RPS-K-OrgHasRPSReport',42 @DBQueueElements_0143 DECLARE @DBQueueElements_02 QBM_YDBQueueRaw44 INSERT INTO @DBQueueElements_02(object,45 subobject,46 genprocid)47 SELECT48 x.uid,49 NULL,50 @GenProcID51 FROM(52 SELECT uid_person AS uid53 FROM PersonHasRPSReport54 WHERE55 uid_RPSReport = @uid_RPSReport AND XOrigin > 056 UNION57 SELECT pio.UID_Person58 FROM BaseTreeHasRPSReport bhr59 JOIN PersonInBaseTree pio60 ON bhr.UID_Org = pio.UID_Org AND bhr.XOrigin > 061 WHERE62 bhr.UID_RPSReport = @uid_RPSReport63 UNION64 SELECT pio.UID_Person65 FROM BaseTreeHasRPSReport bhr66 JOIN HelperPersonOrg pio67 ON bhr.UID_Org = pio.UID_Org AND bhr.XOrigin > 068 WHERE69 bhr.UID_RPSReport = @uid_RPSReport) AS x70 EXEC QBM_PDBQueueInsert_Bulk 'RPS-K-PersonHasRPSReport',71 @DBQueueElements_0272 END TRY73 BEGIN CATCH74 EXEC QBM_PSessionErrorAdd DEFAULT75 RAISERROR('',76 18,77 1)78 WITH NOWAIT79 END CATCH80 ende:81 RETURN82END
Open raw exported source
1 create procedure RPS_ZAllForOneRPSReport (@SlotNumber int , @uid_RPSReport varchar(38) , @dummy varchar(38) , @GenProcID varchar(38) ) as2 begin declare @MsgTxt nvarchar(1024) declare @DebugLevel char(1) = 'W' BEGIN TRY if not exists (select top 1 1 from RPSReport where uid_RPSReport = isnull3(@uid_RPSReport,'')) begin select @MsgTxt = N'RPSReport ' + rtrim(@uid_RPSReport) + ' not exists, Job ALLFORONERPSReport was killed' exec QBM_PJournal 4@MsgTxt, @@procid, 'D', @DebugLevel goto ende end declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject, genprocid5) select x.uid, null, @GenProcID from ( select co.UID_Org as uid from BaseTreeHasRPSReport bhr join BaseTreeCollection co on bhr.UID_Org = co.UID_ParentOrg6 where bhr.UID_RPSReport = @uid_RPSReport and bhr.XOrigin > 0 ) as x exec QBM_PDBQueueInsert_Bulk 'RPS-K-OrgHasRPSReport', @DBQueueElements_01 declare7 @DBQueueElements_02 QBM_YDBQueueRaw insert into @DBQueueElements_02 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select uid_person8 as uid from PersonHasRPSReport where uid_RPSReport = @uid_RPSReport and XOrigin > 0 union select pio.UID_Person from BaseTreeHasRPSReport bhr join PersonInBaseTree9 pio on bhr.UID_Org = pio.UID_Org and bhr.XOrigin > 0 where bhr.UID_RPSReport = @uid_RPSReport union select pio.UID_Person from BaseTreeHasRPSReport bhr10 join HelperPersonOrg pio on bhr.UID_Org = pio.UID_Org and bhr.XOrigin > 0 where bhr.UID_RPSReport = @uid_RPSReport ) as x exec QBM_PDBQueueInsert_Bulk11 'RPS-K-PersonHasRPSReport', @DBQueueElements_02 END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende:12 return end 13