Back to OIM Explorer

dbo.QBM_ZJobPerformanceFill

Stored ProcedureSQL_STORED_PROCEDURESandbox DB

Stored Procedure.

Source: sandbox-db sys.sql_modules

Source size: 1.718 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_FCVStringToGUID source text reference
  • references source dbo.QBM_FGISessionContext source text reference
  • references source dbo.QBM_PSessionContextSet source text reference
  • references source dbo.QBM_PSessionErrorAdd source text reference

References

Referenced By

  • No direct source references extracted.

Complete Source

SQL78 lines
1CREATE PROCEDURE QBM_ZJobPerformanceFill(2  @SlotNumber int = NULL,3  @dummy1 varchar(38) = '',4  @dummy2 varchar(38) = '',5  @dummy3 varchar(38) = ''6)7AS8BEGIN9  DECLARE @GenProcID_R varchar(38) = dbo.QBM_FGISessionContext('')10  DECLARE @XUser_R nvarchar(64) = dbo.QBM_FGISessionContext('XUser')11  DECLARE @GenProcID varchar(38) = dbo.QBM_FGISessionContext('')12  DECLARE @XUser nvarchar(64) = dbo.QBM_FGISessionContext('XUser')13  BEGIN TRY14    IF isnull(@XUser,15    '') = ''16    BEGIN17      SELECT @XUser =18      LEFT(Object_name(@@procid),19      64)20      EXEC QBM_PSessionContextSet 'GenProcID',21        @GenProcID22      EXEC QBM_PSessionContextSet 'XUser',23        @XUser24    END25    DELETE JobPerformance26    FROM JobPerformance p27    LEFT28    OUTER29    JOIN QBMServer s30      ON p.queue = s.queuename31    LEFT32    OUTER33    JOIN jobcomponent c34      ON p.ComponentClass = c.ComponentClass35    LEFT36    OUTER37    JOIN JobTask t38      ON c.uid_JobComponent = t.uid_JobComponent AND p.TaskName = t.taskname39    WHERE40      s.uid_QBMServer IS NULL OR t.uid_jobtask IS NULL OR c.uid_jobcomponent IS NULL41    DELETE JobPerformance42    FROM JobPerformance p43    JOIN(44    SELECT45      Queue,46      ComponentClass,47      TaskName48    FROM JobPerformance49    GROUP BY Queue,50    ComponentClass,51    TaskName52    HAVING count(*) > 1) AS x53      ON p.Queue = x.Queue AND p.ComponentClass = x.ComponentClass AND p.TaskName = x.TaskName54    DELETE JobPerformance55    FROM JobPerformance p56    WHERE57      p.UID_JobPerformance <> dbo.QBM_FCVStringToGUID('',58    UPPER(CONCAT(p.Queue, p.ComponentClass, p.TaskName)))59    DELETE JobPerformance60    FROM JobPerformance p61    WHERE62      isnull(p.CountPerMinute,63    0) <= 164  END TRY65  BEGIN CATCH66    EXEC QBM_PSessionErrorAdd DEFAULT67    RAISERROR('',68    18,69    1)70      WITH NOWAIT71  END CATCH72  ende:73  EXEC QBM_PSessionContextSet 'GenProcID',74    @GenProcID_R75  EXEC QBM_PSessionContextSet 'XUser',76    @XUser_R77  RETURN78END
Open raw exported source
SQL ยท Raw13 lines
1    create   procedure QBM_ZJobPerformanceFill ( @SlotNumber int = null  , @dummy1 varchar(38) = '' , @dummy2 varchar(38) = '' , @dummy3 varchar2(38) = '' ) as begin declare @GenProcID_R varchar(38) = dbo.QBM_FGISessionContext('') declare @XUser_R nvarchar(64) = dbo.QBM_FGISessionContext('XUser'3) declare @GenProcID varchar(38) = dbo.QBM_FGISessionContext('') declare @XUser nvarchar(64) = dbo.QBM_FGISessionContext('XUser') BEGIN TRY  if isnull(@XUser4, '') = '' begin select @XUser = left(Object_name(@@procid), 64) exec QBM_PSessionContextSet 'GenProcID', @GenProcID exec QBM_PSessionContextSet 'XUser'5, @XUser end  delete JobPerformance from JobPerformance p left outer join QBMServer s on p.queue = s.queuename left outer join jobcomponent c on p.ComponentClass6 = c.ComponentClass left outer join JobTask t on c.uid_JobComponent = t.uid_JobComponent and p.TaskName = t.taskname where s.uid_QBMServer is null or t.uid_jobtask7 is null or c.uid_jobcomponent is null  delete JobPerformance from JobPerformance p join (select Queue, ComponentClass, TaskName from JobPerformance group8 by Queue, ComponentClass, TaskName having count(*) > 1 ) as x on p.Queue = x.Queue and p.ComponentClass = x.ComponentClass and p.TaskName = x.TaskName9  delete JobPerformance from JobPerformance p where p.UID_JobPerformance <> dbo.QBM_FCVStringToGUID('', UPPER(concat( p.Queue, p.ComponentClass, p.TaskName10 )))  delete JobPerformance from JobPerformance p where isnull(p.CountPerMinute,0) <= 1   END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR11 ('', 18, 1) WITH NOWAIT END CATCH  ende: exec QBM_PSessionContextSet 'GenProcID', @GenProcID_R exec QBM_PSessionContextSet 'XUser', @XUser_R return end12 13