Back to OIM Explorer

dbo.RPS_ZPrePropRPSReport

Stored ProcedureSQL_STORED_PROCEDURESandbox DB

Stored Procedure.

Source: sandbox-db sys.sql_modules

Source size: 1.704 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

SQL82 lines
1CREATE PROCEDURE RPS_ZPrePropRPSReport(2  @SlotNumber int3)4AS5BEGIN6  DECLARE @GenProcID varchar(38)7  DECLARE @GenProcID_R varchar(38) = dbo.QBM_FGISessionContext('')8  DECLARE @DBQueueCurrent QBM_YDBQueueCurrent9  BEGIN TRY10    INSERT INTO @DBQueueCurrent(UID_DialogDBQueue,11    UID_Parameter,12    UID_SubParameter,13    GenProcID)14    SELECT15      UID_DialogDBQueue,16      UID_Parameter,17      UID_SubParameter,18      GenProcID19    FROM QBMDBQueueCurrent cu20      WITH(readpast)21    WHERE22      cu.SlotNumber = @SlotNumber23    IF @@rowcount = 024    BEGIN25      GOTO EndLabel26    END27    SELECT @GenProcID = max(GenProcID)28    FROM @DBQueueCurrent29    WHERE30      GenProcID > ' '31    IF isnull(@Genprocid,32    '') = ''33    BEGIN34      SELECT @GenProcID = newid()35    END36    DECLARE @PrePropHelper QBM_YPrepropHelper37    INSERT INTO @PrePropHelper(uid_parameter,38    isDeactivatedPrior,39    IsDeactivated,40    GenProcID,41    PreProcessorCondition,42    IsDeactivatedOld)43    SELECT44      x.uid_parameter,45      0,46      0,47      x.GenProcID,48      isnull(c.PreProcessorCondition,49      N ''),50      c.isDeactivatedByPreProcessor51    FROM @DBQueueCurrent x52    JOIN RPSReport c53      ON x.uid_parameter = c.uid_RPSReport54    UPDATE @PrePropHelper55    SET IsDeactivated = dbo.QBM_FGIPrepropConditionDeactiv(h.PreProcessorCondition)56    FROM @PrePropHelper h57    WHERE58      h.PreProcessorCondition > ' ' AND h.IsDeactivated = 059    EXEC QBM_PSessionContextSet 'GenProcID',60      @GenProcID61    UPDATE RPSReport62    SET IsDeactivatedByPreProcessor = x.isDeactivated,63    xdateupdated = GetUTCDate(),64    xuserupdated = 'DBScheduler'65    FROM RPSReport r66    JOIN @PrePropHelper x67      ON r.UID_RPSReport = x.uid_parameter68    WHERE69      r.IsDeactivatedByPreProcessor <> x.IsDeactivated70  END TRY71  BEGIN CATCH72    EXEC QBM_PSessionErrorAdd DEFAULT73    RAISERROR('',74    18,75    1)76      WITH NOWAIT77  END CATCH78  endLabel:79  EXEC QBM_PSessionContextSet 'GenProcID',80    @GenProcID_R81  RETURN82END
Open raw exported source
SQL ยท Raw12 lines
1    create   procedure RPS_ZPrePropRPSReport (@SlotNumber int ) as begin  declare @GenProcID varchar(38) declare @GenProcID_R varchar(38) = dbo.QBM_FGISessionContext2('') declare @DBQueueCurrent QBM_YDBQueueCurrent BEGIN TRY insert into @DBQueueCurrent(UID_DialogDBQueue, UID_Parameter, UID_SubParameter, GenProcID) select3 UID_DialogDBQueue, UID_Parameter, UID_SubParameter, GenProcID from QBMDBQueueCurrent cu with (readpast) where cu.SlotNumber = @SlotNumber if @@rowcount4 = 0 begin goto EndLabel end select @GenProcID = max(GenProcID) from @DBQueueCurrent where GenProcID > ' ' if isnull(@Genprocid, '') = '' begin select 5@GenProcID = newid() end declare @PrePropHelper QBM_YPrepropHelper insert into @PrePropHelper (uid_parameter , isDeactivatedPrior , IsDeactivated , GenProcID6 , PreProcessorCondition, IsDeactivatedOld) select x.uid_parameter, 0, 0, x.GenProcID, isnull(c.PreProcessorCondition,N''), c.isDeactivatedByPreProcessor7 from @DBQueueCurrent x join RPSReport c on x.uid_parameter = c.uid_RPSReport  update @PrePropHelper set IsDeactivated = dbo.QBM_FGIPrepropConditionDeactiv8(h.PreProcessorCondition) from @PrePropHelper h where h.PreProcessorCondition > ' ' and h.IsDeactivated = 0  exec QBM_PSessionContextSet 'GenProcID', @GenProcID9 update RPSReport set IsDeactivatedByPreProcessor = x.isDeactivated, xdateupdated = GetUTCDate(), xuserupdated = 'DBScheduler'  from RPSReport r join @PrePropHelper10 x on r.UID_RPSReport = x.uid_parameter where r.IsDeactivatedByPreProcessor <> x.IsDeactivated END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR11 ('', 18, 1) WITH NOWAIT END CATCH  endLabel: exec QBM_PSessionContextSet 'GenProcID', @GenProcID_R return end 12