Back to OIM Explorer

dbo.QBM_ZPrePropJob

Stored ProcedureSQL_STORED_PROCEDURESandbox DB

Stored Procedure.

Source: sandbox-db sys.sql_modules

Source size: 1.853 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_FGIPrepropConditionDeactiv 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

Complete Source

SQL88 lines
1CREATE PROCEDURE QBM_ZPrePropJob(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 Job o56      ON x.uid_parameter = o.uid_Job57    JOIN Jobchain t58      ON o.uid_JobChain = t.UID_Jobchain59    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 Job67    SET IsDeactivatedByPreProcessor = x.isDeactivated,68    xdateupdated = GetUTCDate(),69    xuserupdated = 'DBScheduler'70    FROM Job r71    JOIN @PrePropHelper x72      ON r.UID_Job = x.uid_parameter73    WHERE74      r.IsDeactivatedByPreProcessor <> x.IsDeactivated75    SELECT @CountItems = @@rowcount76  END TRY77  BEGIN CATCH78    EXEC QBM_PSessionErrorAdd DEFAULT79    RAISERROR('',80    18,81    1)82      WITH NOWAIT83  END CATCH84  endLabel:85  EXEC QBM_PSessionContextSet 'GenProcID',86    @GenProcID_R87  RETURN88END
Open raw exported source
SQL ยท Raw13 lines
1   create   procedure QBM_ZPrePropJob (@SlotNumber int) as begin   declare @GenProcID varchar(38) declare @CountItems int  declare @GenProcID_R 2varchar(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 Job o on x.uid_parameter = o.uid_Job join8 Jobchain t on o.uid_JobChain = t.UID_Jobchain  update @PrePropHelper set IsDeactivated = dbo.QBM_FGIPrepropConditionDeactiv(h.PreProcessorCondition) from9 @PrePropHelper h where h.PreProcessorCondition > ' ' and h.IsDeactivated = 0  exec QBM_PSessionContextSet 'GenProcID', @GenProcID update Job set IsDeactivatedByPreProcessor10 = x.isDeactivated, xdateupdated = GetUTCDate(), xuserupdated = 'DBScheduler'  from Job r join @PrePropHelper x on r.UID_Job = x.uid_parameter where r.IsDeactivatedByPreProcessor11 <> x.IsDeactivated select @CountItems = @@rowcount END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH  12endLabel: exec QBM_PSessionContextSet 'GenProcID', @GenProcID_R return end 13