Back to OIM Explorer

dbo.QBM_ZPrePropCustomizer

Stored ProcedureSQL_STORED_PROCEDURESandbox DB

Stored Procedure.

Source: sandbox-db sys.sql_modules

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

SQL83 lines
1CREATE PROCEDURE QBM_ZPrePropCustomizer(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    IsDeactivated,40    IsDeactivatedOld,41    GenProcID,42    PreProcessorCondition)43    SELECT44      x.uid_parameter,45      0,46      isnull(t.isDeactivatedByPreProcessor,47      0),48      x.GenProcID,49      isnull(t.PreProcessorCondition,50      '')51    FROM @DBQueueCurrent x52    JOIN DialogCustomizer t53      ON x.uid_parameter = t.UID_Customizer54    UPDATE @PrePropHelper55    SET IsDeactivated = dbo.QBM_FGIPrepropConditionDeactiv(h.PreProcessorCondition)56    FROM @PrePropHelper h57    WHERE58      h.PreProcessorCondition > ' '59    EXEC QBM_PSessionContextSet 'GenProcID',60      @GenProcID61    UPDATE DialogCustomizer62    SET IsDeactivatedByPreProcessor = x.isDeactivated,63    xdateupdated = GetUTCDate(),64    xuserupdated = 'DBScheduler'65    FROM DialogCustomizer cu66    JOIN @PrePropHelper x67      ON cu.UID_Customizer = x.uid_parameter68    WHERE69      cu.IsDeactivatedByPreProcessor <> x.IsDeactivated70    SELECT @CountItems = @@rowcount71  END TRY72  BEGIN CATCH73    EXEC QBM_PSessionErrorAdd DEFAULT74    RAISERROR('',75    18,76    1)77      WITH NOWAIT78  END CATCH79  endLabel:80  EXEC QBM_PSessionContextSet 'GenProcID',81    @GenProcID_R82  RETURN83END
Open raw exported source
SQL ยท Raw12 lines
1   create   procedure QBM_ZPrePropCustomizer (@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 , IsDeactivated , 6IsDeactivatedOld, GenProcID , PreProcessorCondition) select x.uid_parameter, 0 , isnull(t.isDeactivatedByPreProcessor,0) , x.GenProcID, isnull(t.PreProcessorCondition7,'') from @DBQueueCurrent x join DialogCustomizer t on x.uid_parameter = t.UID_Customizer    update @PrePropHelper set IsDeactivated = dbo.QBM_FGIPrepropConditionDeactiv8(h.PreProcessorCondition) from @PrePropHelper h where h.PreProcessorCondition > ' '   exec QBM_PSessionContextSet 'GenProcID', @GenProcID update DialogCustomizer9 set IsDeactivatedByPreProcessor = x.isDeactivated, xdateupdated = GetUTCDate(), xuserupdated = 'DBScheduler'  from DialogCustomizer cu join @PrePropHelper10 x on cu.UID_Customizer = x.uid_parameter where cu.IsDeactivatedByPreProcessor <> x.IsDeactivated select @CountItems = @@rowcount END TRY BEGIN CATCH exec11 QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH endLabel: exec QBM_PSessionContextSet 'GenProcID', @GenProcID_R return end 12