Back to OIM Explorer

dbo.QBM_ZPrePropJobChain

Stored ProcedureSQL_STORED_PROCEDURESandbox DB

Stored Procedure. Bulk DBQueue insert -> QBM-K-CommonPrepropJob / QBM_ZPrePropJob at line 14; References QBM_PDBQueueInsert_Bulk

Source: sandbox-db sys.sql_modules

Source size: 2.375 characters

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 -> QBM-K-CommonPrepropJob / QBM_ZPrePropJob at line 14
  • References QBM_PDBQueueInsert_Bulk

Typed Edges

  • queues DBQueue task QBM_ZPrePropJob at line 14 Bulk DBQueue insert -> QBM-K-CommonPrepropJob / QBM_ZPrePropJob at line 14
  • references source dbo.QBM_FGIPrepropConditionDeactiv source text reference
  • references source dbo.QBM_FGISessionContext source text reference
  • references source dbo.QBM_PDBQueueInsert_Bulk source text reference
  • references source dbo.QBM_PDBQueueInsert_WaitForComp source text reference
  • references source dbo.QBM_PSessionContextSet source text reference
  • references source dbo.QBM_PSessionErrorAdd source text reference
  • references source dbo.QBM_ZPrePropJob source text reference
  • queues DBQueue task QBM-K-CommonPrepropJob -> QBM_ZPrePropJob QBM_PDBQueueInsert_Bulk 'QBM-K-CommonPrepropJob', @DBQueueElements_01 end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH endLabel: exec QBM_PSessionContextSet 'GenProcID', @GenProcID_R ret…

Complete Source

SQL110 lines
1CREATE PROCEDURE QBM_ZPrePropJobChain(2  @SlotNumber int3)4AS5BEGIN6  DECLARE @GenProcID varchar(38)7  DECLARE @CountItems int8  DECLARE @GenProcID_R varchar(38) = dbo.QBM_FGISessionContext('')9  DECLARE @DBQueueCurrent QBM_YDBQueueCurrent10  BEGIN TRY11    INSERT INTO @DBQueueCurrent(UID_DialogDBQueue,12    UID_Parameter,13    UID_SubParameter,14    GenProcID)15    SELECT16      UID_DialogDBQueue,17      UID_Parameter,18      UID_SubParameter,19      GenProcID20    FROM QBMDBQueueCurrent cu21      WITH(readpast)22    WHERE23      cu.SlotNumber = @SlotNumber24    IF @@rowcount = 025    BEGIN26      GOTO EndLabel27    END28    SELECT @GenProcID = max(GenProcID)29    FROM @DBQueueCurrent30    WHERE31      GenProcID > ' '32    IF isnull(@Genprocid,33    '') = ''34    BEGIN35      SELECT @GenProcID = newid()36    END37    DECLARE @PrePropHelper QBM_YPrepropHelper38    INSERT INTO @PrePropHelper(uid_parameter,39    isDeactivatedPrior,40    IsDeactivated,41    GenProcID,42    PreProcessorCondition,43    IsDeactivatedOld)44    SELECT45      x.uid_parameter,46      isnull(t.isDeactivatedByPreProcessor,47      0),48      isnull(t.isDeactivatedByPreProcessor,49      0),50      x.GenProcID,51      isnull(o.PreProcessorCondition,52      N ''),53      o.isDeactivatedByPreProcessor54    FROM @DBQueueCurrent x55    JOIN JobChain o56      ON x.uid_parameter = o.uid_JobChain57    JOIN dialogtable t58      ON o.UID_DialogTable = t.UID_DialogTable59    UPDATE @PrePropHelper60    SET IsDeactivated = dbo.QBM_FGIPrepropConditionDeactiv(h.PreProcessorCondition)61    FROM @PrePropHelper h62    WHERE63      h.PreProcessorCondition > ' ' AND h.IsDeactivated = 064    EXEC QBM_PSessionContextSet 'GenProcID',65      @GenProcID66    UPDATE JobChain67    SET IsDeactivatedByPreProcessor = x.isDeactivated,68    xdateupdated = GetUTCDate(),69    xuserupdated = 'DBScheduler'70    FROM JobChain r71    JOIN @PrePropHelper x72      ON r.UID_JobChain = x.uid_parameter73    WHERE74      r.IsDeactivatedByPreProcessor <> x.IsDeactivated75    SELECT @CountItems = @@rowcount76    IF @CountItems > 077    BEGIN78      EXEC QBM_PDBQueueInsert_WaitForComp 'Jobchain',79        @GenProcID80      DECLARE @DBQueueElements_01 QBM_YDBQueueRaw81      INSERT INTO @DBQueueElements_01(object,82      subobject,83      genprocid)84      SELECT85        x.uid,86        NULL,87        @GenProcID88      FROM(89      SELECT90        DISTINCT j.UID_Job AS UID,91        x.GenProcID92      FROM Job j93      JOIN @PrePropHelper x94        ON j.UID_JobChain = x.uid_parameter AND x.IsDeactivated <> x.IsDeactivatedOld) AS x95      EXEC QBM_PDBQueueInsert_Bulk 'QBM-K-CommonPrepropJob',96        @DBQueueElements_0197    END98  END TRY99  BEGIN CATCH100    EXEC QBM_PSessionErrorAdd DEFAULT101    RAISERROR('',102    18,103    1)104      WITH NOWAIT105  END CATCH106  endLabel:107  EXEC QBM_PSessionContextSet 'GenProcID',108    @GenProcID_R109  RETURN110END
Open raw exported source
SQL · Raw16 lines
1   create   procedure QBM_ZPrePropJobChain (@SlotNumber int) as begin   declare @GenProcID varchar(38) declare @CountItems int  declare @GenProcID_R2 varchar(38) = dbo.QBM_FGISessionContext('') declare @DBQueueCurrent QBM_YDBQueueCurrent BEGIN TRY insert into @DBQueueCurrent(UID_DialogDBQueue, UID_Parameter3, UID_SubParameter, GenProcID) select UID_DialogDBQueue, UID_Parameter, UID_SubParameter, GenProcID from QBMDBQueueCurrent cu with (readpast) where cu.SlotNumber4 = @SlotNumber if @@rowcount = 0 begin goto EndLabel end select @GenProcID = max(GenProcID) from @DBQueueCurrent where GenProcID > ' ' if isnull(@Genprocid5, '') = '' begin select @GenProcID = newid() end declare @PrePropHelper QBM_YPrepropHelper insert into @PrePropHelper (uid_parameter , isDeactivatedPrior6 , IsDeactivated , GenProcID , PreProcessorCondition, IsDeactivatedOld) select x.uid_parameter, isnull(t.isDeactivatedByPreProcessor,0), isnull(t.isDeactivatedByPreProcessor7,0), x.GenProcID, isnull(o.PreProcessorCondition,N''), o.isDeactivatedByPreProcessor from @DBQueueCurrent x join JobChain o on x.uid_parameter = o.uid_JobChain8 join dialogtable t on o.UID_DialogTable = t.UID_DialogTable  update @PrePropHelper set IsDeactivated = dbo.QBM_FGIPrepropConditionDeactiv(h.PreProcessorCondition9) from @PrePropHelper h where h.PreProcessorCondition > ' ' and h.IsDeactivated = 0  exec QBM_PSessionContextSet 'GenProcID', @GenProcID update JobChain10 set IsDeactivatedByPreProcessor = x.isDeactivated, xdateupdated = GetUTCDate(), xuserupdated = 'DBScheduler'  from JobChain r join @PrePropHelper x on11 r.UID_JobChain = x.uid_parameter where r.IsDeactivatedByPreProcessor <> x.IsDeactivated select @CountItems = @@rowcount if @CountItems > 0 begin   exec12 QBM_PDBQueueInsert_WaitForComp 'Jobchain', @GenProcID    declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject13, genprocid) select x.uid, null, @GenProcID from (select distinct j.UID_Job as UID, x.GenProcID from Job j join @PrePropHelper x on j.UID_JobChain = x.uid_parameter14 and x.IsDeactivated <> x.IsDeactivatedOld ) as x exec QBM_PDBQueueInsert_Bulk 'QBM-K-CommonPrepropJob', @DBQueueElements_01 end  END TRY BEGIN CATCH exec15 QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH  endLabel: exec QBM_PSessionContextSet 'GenProcID', @GenProcID_R return end 16