dbo.QBM_ZDashBoardContentCalculate
Stored ProcedureSQL_STORED_PROCEDURESandbox DB
Interpretation
- Database routine. Review parameters, called procedures, DBQueue inserts, and QBM_PJobCreate helper calls before assuming side effects.
- Object-layer bridge detected through QBM_PJobCreate helper usage.
- DBQueue relation detected. Follow the task procedure and referenced-by list for async processing.
Relations
- Single DBQueue insert -> at line 9
- References QBM_PJobCreate*
- References QBM_PDBQueueInsert_Single
Typed Edges
- queues DBQueue task at line 9 Single DBQueue insert -> at line 9
- references source dbo.QBM_FCVIntToString source text reference
- references source dbo.QBM_FGIDashBoardCodeName source text reference
- references source dbo.QBM_FGISessionContext source text reference
- references source dbo.QBM_PDBQueueInsert_Single source text reference
- references source dbo.QBM_PJobCreate source text reference
- references source dbo.QBM_PJobCreate_SQLDel source text reference
- references source dbo.QBM_PSessionContextSet source text reference
- references source dbo.QBM_PSessionErrorAdd source text reference
References
- dbo.QBM_FCVIntToString
- dbo.QBM_FGIDashBoardCodeName
- dbo.QBM_FGISessionContext
- dbo.QBM_PDBQueueInsert_Single
- dbo.QBM_PJobCreate
- dbo.QBM_PJobCreate_SQLDel
- dbo.QBM_PSessionContextSet
- dbo.QBM_PSessionErrorAdd
Referenced By
- No direct source references extracted.
Complete Source
1CREATE PROCEDURE QBM_ZDashBoardContentCalculate(2 @SlotNumber int,3 @UID_DialogDashboardDef varchar(38),4 @dummy1 varchar(38),5 @GenProcID varchar(38)6)7AS8BEGIN9 DECLARE @isInactive BIT10 DECLARE @HistoryLength int11 DECLARE @procname nvarchar(64)12 DECLARE @datenow datetime13 DECLARE @IsAdHoc BIT14 DECLARE @IsManual BIT15 DECLARE @SQLCmd nvarchar(max)16 DECLARE @GenProcID_R varchar(38) = dbo.QBM_FGISessionContext('')17 DECLARE @UID_Task varchar(38) = 'QBM-K-CommonDashboardDef'18 SET XACT_ABORT OFF19 BEGIN TRY20 IF @GenProcID IS NULL21 BEGIN22 SELECT @GenProcID = NEWID()23 END24 SELECT @Datenow = getUTCDate() drop TABLE25 IF EXISTS #DialogDashBoardContent26 CREATE TABLE #DialogDashBoardContent(27 ElementName nvarchar(255) collate database_default,28 ElementValue float,29 ElementValue100 float,30 ElementOrder int identity,31 ElementObjectKey varchar(138) collate database_default,32 ElementValueZ float,33 ElementObjectKey2 varchar(138) collate database_default34 )35 SELECT36 TOP 1 @isInactive = isInactive,37 @HistoryLength = isnull(HistoryLength,38 039 ),40 @IsAdHoc = IsAdHoc,41 @IsManual = IsManual42 FROM DialogDashboardDef43 WHERE44 UID_DialogDashboardDef = @UID_DialogDashboardDef45 IF @IsAdHoc = 1 OR @IsManual = 146 BEGIN47 GOTO ende48 END49 SELECT50 @procname = dbo.QBM_FGIDashBoardCodeName('proc',51 @UID_DialogDashBoardDef52 )53IF NOT EXISTS(54 SELECT TOP 1 155 FROM sys.procedures56 WHERE57 name = @procname58) AND @isInactive = 059BEGIN60 EXEC QBM_PDBQueueInsert_Single @UID_Task,61 @UID_DialogDashBoardDef,62 '',63 @GenProcID64 GOTO ende65END66EXEC QBM_PSessionContextSet 'GenProcID',67 @GenProcID68UPDATE dialogDashBoardContent69SET HistoryNumber = isnull(HistoryNumber,70071) + 172WHERE73 UID_DialogDashboardDef = @UID_DialogDashboardDef74BEGIN TRY75 IF @IsInactive = 076 BEGIN77 EXEC @procname78 END79END TRY80BEGIN CATCH81 EXEC QBM_PSessionErrorAdd DEFAULT82 RAISERROR('',83 18,84 185)86 WITH NOWAIT87END CATCH88EXEC QBM_PSessionContextSet 'GenProcID',89 @GenProcID90INSERT INTO DialogDashBoardContent(UID_DialogDashBoardContent,91UID_DialogDashboardDef,92ElementName,93ElementValue,94ElementValue100,95ElementDate,96HistoryNumber,97ElementOrder,98ElementObjectKey,99ElementValueZ,100ElementObjectKey2101)102SELECT newid(103),104@UID_DialogDashboardDef,105w.ElementName,106w.ElementValue,107w.ElementValue100,108@datenow,1090,110w.ElementOrder,111w.ElementObjectKey,112w.ElementValueZ,113w.ElementObjectKey2114FROM #DialogDashBoardContent w115SELECT116 @SQLCmd = 'UID_DialogDashBoardDef = ''' + @UID_DialogDashboardDef + '''117 and HistoryNumber > ' + dbo.QBM_FCVIntToString(@HistoryLength118 )119EXEC dbo.QBM_PJobCreate_SQLDel 'DialogDashBoardContent',120 @SQLCmd,121 @GenProcID,122DEFAULT,123 @Retries = 5124END TRY125BEGIN CATCH126 EXEC QBM_PSessionErrorAdd DEFAULT127 RAISERROR('',128 18,129 1130)131 WITH NOWAIT132END CATCH133ende: truncate TABLE #DialogDashBoardContent134EXEC QBM_PSessionContextSet 'GenProcID',135 @GenProcID_R136RETURN137END
Open raw exported source
1 create procedure QBM_ZDashBoardContentCalculate ( @SlotNumber int , @UID_DialogDashboardDef varchar(38), @dummy1 varchar(38), @GenProcID varchar2(38) ) as begin declare @isInactive bit declare @HistoryLength int declare @procname nvarchar(64) declare @datenow datetime declare @IsAdHoc bit declare3 @IsManual bit declare @SQLCmd nvarchar(max) declare @GenProcID_R varchar(38) = dbo.QBM_FGISessionContext('') declare @UID_Task varchar(38) = 'QBM-K-CommonDashboardDef'4 SET XACT_ABORT OFF BEGIN TRY if @GenProcID is null begin select @GenProcID = NEWID() end select @Datenow = getUTCDate() drop table if exists #DialogDashBoardContent5 create table #DialogDashBoardContent ( ElementName nvarchar(255) collate database_default, ElementValue float , ElementValue100 float , ElementOrder6 int identity, ElementObjectKey varchar(138) collate database_default , ElementValueZ float , ElementObjectKey2 varchar(138) collate database_default )7 select top 1 @isInactive = isInactive , @HistoryLength = isnull(HistoryLength, 0) , @IsAdHoc = IsAdHoc , @IsManual = IsManual from DialogDashboardDef 8where UID_DialogDashboardDef = @UID_DialogDashboardDef if @IsAdHoc = 1 or @IsManual = 1 begin goto ende end select @procname = dbo.QBM_FGIDashBoardCodeName9( 'proc', @UID_DialogDashBoardDef) if not exists (select top 1 1 from sys.procedures where name = @procname ) and @isInactive = 0 begin exec QBM_PDBQueueInsert_Single10 @UID_Task, @UID_DialogDashBoardDef, '', @GenProcID goto ende end exec QBM_PSessionContextSet 'GenProcID', @GenProcID update dialogDashBoardContent set11 HistoryNumber = isnull(HistoryNumber, 0) + 1 where UID_DialogDashboardDef = @UID_DialogDashboardDef BEGIN TRY if @IsInactive = 0 begin exec @procname 12end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH exec QBM_PSessionContextSet 'GenProcID', @GenProcID13 insert into DialogDashBoardContent ( UID_DialogDashBoardContent, UID_DialogDashboardDef, ElementName, ElementValue, ElementValue100, ElementDate, HistoryNumber14 , ElementOrder, ElementObjectKey , ElementValueZ , ElementObjectKey2 ) select newid(), @UID_DialogDashboardDef, w.ElementName, w.ElementValue, w.ElementValue10015, @datenow, 0, w.ElementOrder, w.ElementObjectKey , w.ElementValueZ , w.ElementObjectKey2 from #DialogDashBoardContent w select @SQLCmd = 'UID_DialogDashBoardDef = '''16 + @UID_DialogDashboardDef + '''17 and HistoryNumber > ' + dbo.QBM_FCVIntToString(@HistoryLength) exec dbo.QBM_PJobCreate_SQLDel 'DialogDashBoardContent'18, @SQLCmd, @GenProcID , DEFAULT , @Retries = 5 END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende:19 truncate table #DialogDashBoardContent exec QBM_PSessionContextSet 'GenProcID', @GenProcID_R return end 20