Back to OIM Explorer

dbo.RPS_ZScheduleStart

Stored ProcedureSQL_STORED_PROCEDURESandbox DB

Stored Procedure. HOFireEvent -> RPSSubscription.GenerateMail at line 8; References QBM_PJobCreate*; References QBM_PJobCreate_HOFireEvent*

Source: sandbox-db sys.sql_modules

Source size: 1.692 characters

Interpretation

  • Database routine. Review parameters, called procedures, DBQueue inserts, and QBM_PJobCreate helper calls before assuming side effects.
  • Object-layer bridge detected through QBM_PJobCreate helper usage.

Relations

  • HOFireEvent -> RPSSubscription.GenerateMail at line 8
  • References QBM_PJobCreate*
  • References QBM_PJobCreate_HOFireEvent*

Typed Edges

  • fires event RPSSubscription.GenerateMail HOFireEvent -> RPSSubscription.GenerateMail at line 8
  • references source dbo.QBM_FCVElementToObjectKey1 source text reference
  • references source dbo.QBM_PJobCreate source text reference
  • references source dbo.QBM_PJobCreate_HOFireEvent source text reference
  • references source dbo.QBM_PJobCreate_HOFireEvent_B source text reference
  • references source dbo.QBM_PSessionErrorAdd source text reference

Complete Source

SQL70 lines
1CREATE PROCEDURE RPS_ZScheduleStart(2  @SlotNumber int3)4AS5BEGIN6  DECLARE @GenProcID varchar(38)7  DECLARE @SQLcmd nvarchar(max)8  DECLARE @BasisObjectKey varchar(138)9  DECLARE @UID_RPSSubscription varchar(38)10  DECLARE @UID_DialogParameterSet varchar(38)11  DECLARE @MyName nvarchar(64) = object_name(@@procid)12  DECLARE @ElementBuffer QBM_YCursorBuffer13  DECLARE @ElementCount int14  DECLARE @ElementIndex int15  BEGIN TRY16    INSERT INTO @ElementBuffer(UID1,17    UID2,18    UID3)19    SELECT20      rs.uid_RPSSubscription,21      ps.UID_DialogParameterSet,22      cu.GenProcID23    FROM RPSSubscription rs24    JOIN DialogParameterset ps25      ON rs.XObjectKey = ps.ObjectkeyUsedBy26    JOIN QBMDBQueueCurrent cu27      WITH(readpast)28      ON cu.UID_Parameter = rs.UID_DialogSchedule29    WHERE30      rs.IsRejected = 0 AND cu.SlotNumber = @SlotNumber31    SELECT @ElementCount = @@ROWCOUNT32    SELECT @ElementIndex = 133    WHILE @ElementIndex <= @ElementCount34    BEGIN35      SELECT36        TOP 1 @UID_RPSSubscription = bu.UID1,37        @UID_DialogParameterSet = bu.UID2,38        @GenProcID = bu.UID339      FROM @ElementBuffer bu40      WHERE41        bu.ElementIndex = @ElementIndex42      SELECT @SQLcmd = N 'UID_RPSSubscription = ''' + rtrim(@UID_RPSSubscription) + N ''''43      SELECT44        @BasisObjectKey = dbo.QBM_FCVElementToObjectKey1('RPSSubscription',45        'UID_RPSSubscription',46        @UID_RPSSubscription)47      EXEC QBM_PJobCreate_HOFireEvent_B 'RPSSubscription',48        @SQLcmd,49      'GenerateMail',50        @GenProcID,51        @AdditionalObjectKeysAffected = DEFAULT,52        @p2 = N '_paramName1',53        @v2 = N 'ParameterSet',54        @p3 = N '_paramValue1',55        @v3 = @UID_DialogParameterSet,56        @checkForExisting = 1,57        @BasisObjectKey = @BasisObjectKey58      SELECT @ElementIndex += 159    END60  END TRY61  BEGIN CATCH62    EXEC QBM_PSessionErrorAdd DEFAULT63    RAISERROR('',64    18,65    1)66      WITH NOWAIT67  END CATCH68  ende:69  RETURN70END
Open raw exported source
SQL ยท Raw12 lines
1  create   procedure RPS_ZScheduleStart ( @SlotNumber int ) AS begin declare @GenProcID varchar(38) declare @SQLcmd nvarchar(max) declare @BasisObjectKey2 varchar(138) declare @UID_RPSSubscription varchar(38) declare @UID_DialogParameterSet varchar(38) declare @MyName nvarchar(64) = object_name(@@procid)3 declare @ElementBuffer QBM_YCursorBuffer declare @ElementCount int declare @ElementIndex int BEGIN TRY   insert into @ElementBuffer (UID1, UID2, UID3)4 select rs.uid_RPSSubscription, ps.UID_DialogParameterSet, cu.GenProcID from RPSSubscription rs join DialogParameterset ps on rs.XObjectKey = ps.ObjectkeyUsedBy5 join QBMDBQueueCurrent cu with (readpast) on cu.UID_Parameter = rs.UID_DialogSchedule where rs.IsRejected = 0 and cu.SlotNumber = @SlotNumber select @ElementCount6 = @@ROWCOUNT select @ElementIndex = 1 while @ElementIndex <= @ElementCount begin select top 1 @UID_RPSSubscription = bu.UID1 , @UID_DialogParameterSet7 = bu.UID2 , @GenProcID = bu.UID3 from @ElementBuffer bu where bu.ElementIndex = @ElementIndex select @SQLcmd = N'UID_RPSSubscription = ''' + rtrim(@UID_RPSSubscription8) + N'''' select @BasisObjectKey = dbo.QBM_FCVElementToObjectKey1('RPSSubscription', 'UID_RPSSubscription', @UID_RPSSubscription)  exec QBM_PJobCreate_HOFireEvent_B9 'RPSSubscription', @SQLcmd , 'GenerateMail', @GenProcID , @AdditionalObjectKeysAffected = DEFAULT , @p2 = N'_paramName1' , @v2 = N'ParameterSet' , @p310 = N'_paramValue1' , @v3 = @UID_DialogParameterSet , @checkForExisting = 1 , @BasisObjectKey = @BasisObjectKey select @ElementIndex += 1 end  END TRY BEGIN11 CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH  ende: return end 12