Back to OIM Explorer

dbo.QBM_PDBQueuePondTimeOut

Stored ProcedureSQL_STORED_PROCEDURESandbox DB

Stored Procedure.

Source: sandbox-db sys.sql_modules

Source size: 939 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_FCVStringToInt source text reference
  • references source dbo.QBM_FGIConfigparmValue source text reference
  • references source dbo.QBM_PDBQueuePondEnd source text reference
  • references source dbo.QBM_PSessionErrorAdd source text reference

Complete Source

SQL43 lines
1CREATE PROCEDURE QBM_PDBQueuePondTimeOut2AS3BEGIN4  DECLARE @GroupsToClose QBM_YCursorBuffer5  DECLARE @ElementCount int6  DECLARE @ElementIndex int7  DECLARE @TimeOutMinutes int = dbo.QBM_FCVStringToInt(dbo.QBM_FGIConfigparmValue('QBM\DBQueue\BufferTimeout'),8  120)9  DECLARE @PondGroup varchar(38)10  SET XACT_ABORT OFF11  BEGIN TRY12    INSERT INTO @GroupsToClose(UID1)13    SELECT p.PondGroup14    FROM QBMDBQueuePond p15      WITH(readpast)16    WHERE17      p.GenProcID <> 'DELETE'18    GROUP BY p.PondGroup19    HAVING max(p.InsertDate) < dateadd(mi,20    (-1 * @TimeOutMinutes),21    getutcdate())22    SELECT @ElementCount = @@ROWCOUNT23    SELECT @ElementIndex = 124    WHILE @ElementIndex <= @ElementCount25    BEGIN26      SELECT TOP 1 @PondGroup = bu.UID127      FROM @GroupsToClose bu28      WHERE29        bu.ElementIndex = @ElementIndex30      EXEC QBM_PDBQueuePondEnd @PondGroup31      SELECT @ElementIndex += 132    END33  END TRY34  BEGIN CATCH35    EXEC QBM_PSessionErrorAdd DEFAULT36    RAISERROR('',37    18,38    1)39      WITH NOWAIT40  END CATCH41  endLabel:42  RETURN43END
Open raw exported source
SQL ยท Raw8 lines
1  create   procedure QBM_PDBQueuePondTimeOut as begin declare @GroupsToClose QBM_YCursorBuffer declare @ElementCount int declare @ElementIndex int2 declare @TimeOutMinutes int = dbo.QBM_FCVStringToInt(dbo.QBM_FGIConfigparmValue('QBM\DBQueue\BufferTimeout'), 120) declare @PondGroup varchar(38) SET 3XACT_ABORT OFF BEGIN TRY insert into @GroupsToClose (UID1) select p.PondGroup from QBMDBQueuePond p with (readpast) where  p.GenProcID <> 'DELETE' group4 by p.PondGroup having max(p.InsertDate) < dateadd(mi, (-1 * @TimeOutMinutes), getutcdate()) select @ElementCount = @@ROWCOUNT select @ElementIndex = 15 while @ElementIndex <= @ElementCount begin select top 1 @PondGroup = bu.UID1 from @GroupsToClose bu where bu.ElementIndex = @ElementIndex exec QBM_PDBQueuePondEnd6 @PondGroup select @ElementIndex += 1 end  END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH endLabel: 7return end 8