Back to OIM Explorer

dbo.QER_ZRiskIndexCalculate

Stored ProcedureSQL_STORED_PROCEDURESandbox DB

Stored Procedure.

Source: sandbox-db sys.sql_modules

Source size: 2.301 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_FGIDBQueueSlotResetType source text reference
  • references source dbo.QBM_FGISessionContext source text reference
  • references source dbo.QER_FGIRiskIndexProcname source text reference
  • references source dbo.QBM_PDBQueueCurrentResetNGen source text reference
  • references source dbo.QBM_PJournal source text reference
  • references source dbo.QBM_PSessionContextSet source text reference
  • references source dbo.QBM_PSessionErrorAdd source text reference

Complete Source

SQL107 lines
1CREATE PROCEDURE QER_ZRiskIndexCalculate(2  @SlotNumber int,3  @UID_DialogColumn varchar(38),4  @SubObject varchar(38),5  @GenProcID varchar(38)6)7AS8BEGIN9  DECLARE @procname nvarchar(64)10  DECLARE @Erg int11  DECLARE @DebugSwitch int = 012  DECLARE @Debuglevel varchar(1) = 'W'13  DECLARE @Debugmessage nvarchar(1000)14  DECLARE @SlotResetType int = dbo.QBM_FGIDBQueueSlotResetType('Waiting')15  DECLARE @GenProcID_R varchar(38) = dbo.QBM_FGISessionContext('')16  DECLARE @UID_MeineTask varchar(38) = 'QER-K-QERRiskIndexCalculate'17  BEGIN TRY18    IF EXISTS(19      SELECT TOP 1 120      FROM QERRiskIndexColumnDepend dep21      JOIN(22      SELECT q.Object AS UID_DialogColumnPred23      FROM DialogDBQueue q24      WITH(readpast)25    WHERE26      q.UID_Task = @UID_MeineTask AND q.Generation >= 027    UNION28    SELECT cu.UID_Parameter29    FROM QBMDBQueueCurrent cu30      WITH(readpast)31    WHERE32      cu.SlotNumber <> 0 AND cu.UID_Task = @UID_MeineTask) AS act33      ON act.UID_DialogColumnPred = dep.UID_DialogColumnSource34    WHERE35      dep.UID_DialogColumnTarget = @UID_DialogColumn)36    BEGIN37      IF @DebugSwitch > 038      BEGIN39        SELECT40          @Debugmessage = CONCAT(@UID_DialogColumn,41          ' mich selber wieder einstellen für den nächsten Versuch')42        EXEC QBM_PJournal @Debugmessage,43          @@procid,44        'D',45          @Debuglevel46      END47      IF NOT EXISTS(48        SELECT TOP 1 149        FROM QBMDBQueueCurrent cu50        WITH(readpast)51      WHERE52        cu.UID_Task = @UID_MeineTask AND cu.UID_Parameter = @UID_DialogColumn AND cu.SlotNumber < 0)53      BEGIN54        EXEC QBM_PDBQueueCurrentResetNGen @SlotNumber,55        'waiting for predecessors',56        057        IF @DebugSwitch > 058        BEGIN59          SELECT60            @Debugmessage = CONCAT(@UID_DialogColumn,61            ' wirklich wieder eingestellt')62          EXEC QBM_PJournal @Debugmessage,63            @@procid,64          'D',65            @Debuglevel66        END67      END68      GOTO endLabel69    END70    SELECT @erg = 071    SELECT @procname = dbo.QER_FGIRiskIndexProcname(@UID_DialogColumn)72    IF NOT EXISTS(73      SELECT TOP 1 174      FROM sys.procedures75      WHERE76        name = @procname AND type = 'P')77    BEGIN78      IF @DebugSwitch > 079      BEGIN80        print 'prozedur ' + @procname + 'existiert nicht'81      END82      GOTO endLabel83    END84    EXEC QBM_PSessionContextSet 'GenProcID',85      @GenProcID86    EXEC @erg = @procname87    IF @DebugSwitch > 088    BEGIN89      print 'geändert ' + str(@erg)90    END91    IF @Erg = 092    BEGIN93      GOTO endlabel94    END95  END TRY96  BEGIN CATCH97    EXEC QBM_PSessionErrorAdd DEFAULT98    RAISERROR('',99    18,100    1)101      WITH NOWAIT102  END CATCH103  endLabel:104  EXEC QBM_PSessionContextSet 'GenProcID',105    @GenProcID_R106  RETURN107END
Open raw exported source
SQL · Raw16 lines
1     create   procedure QER_ZRiskIndexCalculate (@SlotNumber int , @UID_DialogColumn varchar(38) , @SubObject varchar(38) , @GenProcID varchar(382) ) as begin declare @procname nvarchar(64) declare @Erg int declare @DebugSwitch int = 0 declare @Debuglevel varchar(1) = 'W' declare @Debugmessage nvarchar3(1000) declare @SlotResetType int = dbo.QBM_FGIDBQueueSlotResetType('Waiting')  declare @GenProcID_R varchar(38) = dbo.QBM_FGISessionContext('') declare4 @UID_MeineTask varchar(38) = 'QER-K-QERRiskIndexCalculate'  BEGIN TRY if exists (select top 1 1 from QERRiskIndexColumnDepend dep join (  select q.Object5 as UID_DialogColumnPred from DialogDBQueue q with (readpast) where q.UID_Task = @UID_MeineTask and q.Generation >= 0 union select cu.UID_Parameter from6 QBMDBQueueCurrent cu with (readpast) where cu.SlotNumber <> 0 and cu.UID_Task = @UID_MeineTask ) as act on act.UID_DialogColumnPred = dep.UID_DialogColumnSource7 where dep.UID_DialogColumnTarget = @UID_DialogColumn ) begin if @DebugSwitch > 0 begin select @Debugmessage = concat( @UID_DialogColumn, ' mich selber wieder einstellen für den nächsten Versuch'8 ) exec QBM_PJournal @Debugmessage, @@procid, 'D', @Debuglevel end          if not exists (select top 1 1 from QBMDBQueueCurrent cu with (readpast) where9 cu.UID_Task = @UID_MeineTask and cu.UID_Parameter = @UID_DialogColumn and cu.SlotNumber < 0 ) begin exec QBM_PDBQueueCurrentResetNGen @SlotNumber, 'waiting for predecessors'10, 0  if @DebugSwitch > 0 begin select @Debugmessage = concat( @UID_DialogColumn, ' wirklich wieder eingestellt' ) exec QBM_PJournal @Debugmessage, @@procid11, 'D', @Debuglevel end end goto endLabel end  select @erg = 0   select @procname = dbo.QER_FGIRiskIndexProcname(@UID_DialogColumn)   if not exists (select12 top 1 1 from sys.procedures where name = @procname and type = 'P' ) begin if @DebugSwitch > 0 begin print 'prozedur ' + @procname + 'existiert nicht' 13end goto endLabel end  exec QBM_PSessionContextSet 'GenProcID', @GenProcID exec @erg = @procname  if @DebugSwitch > 0 begin print 'geändert ' + str(@erg14) end if @Erg = 0 begin goto endlabel end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH  endLabel: 15exec QBM_PSessionContextSet 'GenProcID', @GenProcID_R return end 16