Back to OIM Explorer

dbo.QBM_PJobPerformanceUpdate

Stored ProcedureSQL_STORED_PROCEDURESandbox DB

Stored Procedure.

Source: sandbox-db sys.sql_modules

Source size: 1.271 characters

Interpretation

  • Database routine. Review parameters, called procedures, DBQueue inserts, and QBM_PJobCreate helper calls before assuming side effects.

Relations

  • No extracted relations.

Typed Edges

  • references source dbo.QBM_FCVStringToList source text reference
  • references source dbo.QBM_FCVStringToListSplitted source text reference
  • references source dbo.QBM_FCVStringToGUID source text reference
  • references source dbo.QBM_FCVStringToInt source text reference
  • references source dbo.QBM_FGISessionErrorRethrow source text reference
  • references source dbo.QBM_PSessionErrorAdd source text reference

Complete Source

SQL42 lines
1CREATE PROCEDURE QBM_PJobPerformanceUpdate(2  @Queue nvarchar(255),3  @PerfValues nvarchar(max)4)5AS6BEGIN7  SET XACT_ABORT OFF8  BEGIN TRY9    merge INTO JobPerformance AS t using(10    SELECT11      dbo.QBM_FCVStringToGUID('', UPPER(CONCAT(@Queue, x.ComponentClass, x.TaskName))) AS UID_JobPerformance,12      x.ComponentClass AS ComponentClass,13      x.TaskName AS TaskName,14      x.Countperminute AS Countperminute15    FROM(16    SELECT17    LEFT(sp.parametername, charindex('|', sp.parametername) -1) AS ComponentClass, substring(sp.parametername,18    charindex('|', sp.parametername) +1, 255) AS TaskName, dbo.QBM_FCVStringToInt(sp.parametervalue, 0) AS CountPerMinute19    FROM dbo.QBM_FCVStringToListSplitted(@PerfValues, nchar(7), 0, 0, N '=') sp) AS x) AS s20      ON t.UID_JobPerformance = s.UID_JobPerformance WHEN matched AND t.CountPerMinute <> s.CountPerMinute THEN21    UPDATE22    SET t.CountPerMinute = s.CountPerMinute WHEN NOT matched BY target THEN23    INSERT(UID_JobPerformance,24    Queue,25    ComponentClass,26    TaskName,27    CountPerMinute)28    VALUES(s.UID_JobPerformance,29    @queue,30    s.ComponentClass,31    s.TaskName,32    s.CountPerMinute);33  END TRY34  BEGIN CATCH35    EXEC QBM_PSessionErrorAdd DEFAULT36    DECLARE @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow()37    RAISERROR(@Rethrow,38    18,39    1)40      WITH NOWAIT41  END CATCH42END
Open raw exported source
SQL ยท Raw10 lines
1    create   procedure QBM_PJobPerformanceUpdate (@Queue nvarchar(255) ,  @PerfValues nvarchar(max)  )  as begin SET XACT_ABORT OFF BEGIN TRY   2merge into JobPerformance as t using ( select dbo.QBM_FCVStringToGUID('', UPPER(concat( @Queue, x.ComponentClass, x.TaskName ))) as UID_JobPerformance 3, x.ComponentClass as ComponentClass, x.TaskName as TaskName, x.Countperminute as Countperminute from ( select left(sp.parametername, charindex('|', sp.parametername4) -1 ) as ComponentClass , substring(sp.parametername, charindex('|', sp.parametername) +1 , 255 ) as TaskName , dbo.QBM_FCVStringToInt(sp.parametervalue5, 0) as CountPerMinute from dbo.QBM_FCVStringToListSplitted(@PerfValues, nchar(7), 0, 0 , N'=') sp ) as x ) as s on t.UID_JobPerformance = s.UID_JobPerformance6 when matched and t.CountPerMinute <> s.CountPerMinute then update set t.CountPerMinute = s.CountPerMinute when not matched by target then insert(UID_JobPerformance7, Queue, ComponentClass , TaskName , CountPerMinute) values (s.UID_JobPerformance, @queue, s.ComponentClass , s.TaskName , s.CountPerMinute) ; END TRY 8BEGIN CATCH exec QBM_PSessionErrorAdd default declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT9 END CATCH end 10