Back to OIM Explorer

dbo.ATT_ZAttestationMakeDecisionEX

Stored ProcedureSQL_STORED_PROCEDURESandbox DB

Stored Procedure. HOFireEvent -> AttestationCase.@EventName at line 11; References QBM_PJobCreate*; References QBM_PJobCreate_HOFireEvent*

Source: sandbox-db sys.sql_modules

Source size: 2.281 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 -> AttestationCase.@EventName at line 11
  • References QBM_PJobCreate*
  • References QBM_PJobCreate_HOFireEvent*

Typed Edges

  • references source dbo.QBM_FCVIntToString 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

SQL88 lines
1CREATE PROCEDURE ATT_ZAttestationMakeDecisionEX(2  @SlotNumber int3)4AS5BEGIN6  DECLARE @UID_AttestationCase varchar(38)7  DECLARE @GenProcID varchar(38)8  DECLARE @cond nvarchar(max)9  DECLARE @EventName nvarchar(max)10  DECLARE @BasisObjectKey varchar(138)11  DECLARE @SubLevelNumberString varchar(32)12  DECLARE @UID_AttestationHelper varchar(38)13  DECLARE @WaitingForEx_30965 varchar(32) = 'waiting for EX'14  DECLARE @ElementBuffer QBM_YCursorBuffer15  DECLARE @ElementCount int16  DECLARE @ElementIndex int17  BEGIN TRY18    INSERT INTO @ElementBuffer(UID1,19    UID2,20    ContentFull,21    ObjectKey1,22    Ident1,23    UID3)24    SELECT25      ac.UID_AttestationCase,26      p.GenprocID,27      isnull(ds.WhereClause,28      N ''),29      ac.XObjectKey,30      dbo.QBM_FCVIntToString(ds.SubLevelNumber),31      ah.UID_AttestationHelper32    FROM QBMDBQueueCurrent p33      WITH(readpast)34    JOIN AttestationCase ac35      ON p.uid_parameter = ac.UID_AttestationCase36    JOIN AttestationHelper ah37      ON ac.UID_AttestationCase = ah.UID_AttestationCase AND ac.decisionlevel = ah.levelnumber38    JOIN QERWorkingStep ds39      ON ah.UID_QERWorkingStep = ds.UID_QERWorkingStep40    WHERE41      ah.UID_PWODecisionRule = 'ATT-PWODecisionRule-EX' AND isnull(ac.isclosed,42    0) = 0 AND p.SlotNumber = @SlotNumber AND isnull(ah.ReasonHead,43    '') = '' AND isnull(ah.Decision,44    '') = ''45    SELECT @ElementCount = @@ROWCOUNT46    SELECT @ElementIndex = 147    WHILE @ElementIndex <= @ElementCount48    BEGIN49      SELECT50        TOP 1 @UID_AttestationCase = bu.UID1,51        @GenProcID = bu.UID2,52        @EventName = bu.ContentFull,53        @BasisObjectKey = bu.ObjectKey1,54        @SubLevelNumberString = bu.Ident1,55        @UID_AttestationHelper = bu.UID356      FROM @ElementBuffer bu57      WHERE58        bu.ElementIndex = @ElementIndex59      SELECT @cond = N 'UID_AttestationCase = ''' + rtrim(@UID_AttestationCase) + N ''''60      EXEC QBM_PJobCreate_HOFireEvent_B 'AttestationCase',61        @cond,62        @EventName,63        @GenProcID,64        @AdditionalObjectKeysAffected = DEFAULT,65        @checkForExisting = 0,66        @BasisObjectKey = @BasisObjectKey,67        @p2 = '_ParamName1',68        @v2 = 'SubLevelNumber',69        @p3 = '_ParamValue1',70        @v3 = @SubLevelNumberString71      UPDATE AttestationHelper72      SET ReasonHead = @WaitingForEx_3096573      WHERE74        UID_AttestationHelper = @UID_AttestationHelper AND isnull(ReasonHead,75      '') = ''76      SELECT @ElementIndex += 177    END78  END TRY79  BEGIN CATCH80    EXEC QBM_PSessionErrorAdd DEFAULT81    RAISERROR('',82    18,83    1)84      WITH NOWAIT85  END CATCH86  endLabel:87  RETURN88END
Open raw exported source
SQL ยท Raw16 lines
1     create   procedure ATT_ZAttestationMakeDecisionEX (@SlotNumber int) as begin  declare @UID_AttestationCase varchar(38) declare @GenProcID varchar2(38) declare @cond nvarchar(max) declare @EventName nvarchar(max) declare @BasisObjectKey varchar(138) declare @SubLevelNumberString varchar(32) declare3 @UID_AttestationHelper varchar(38) declare @WaitingForEx_30965 varchar(32) = 'waiting for EX' declare @ElementBuffer QBM_YCursorBuffer declare @ElementCount4 int declare @ElementIndex int BEGIN TRY insert into @ElementBuffer (UID1, UID2, ContentFull, ObjectKey1, Ident1, UID3) select ac.UID_AttestationCase ,5 p.GenprocID, isnull(ds.WhereClause, N'') , ac.XObjectKey , dbo.QBM_FCVIntToString(ds.SubLevelNumber) , ah.UID_AttestationHelper from QBMDBQueueCurrent6 p with (readpast) join AttestationCase ac on p.uid_parameter = ac.UID_AttestationCase join AttestationHelper ah on ac.UID_AttestationCase = ah.UID_AttestationCase7 and ac.decisionlevel = ah.levelnumber join QERWorkingStep ds on ah.UID_QERWorkingStep = ds.UID_QERWorkingStep  where ah.UID_PWODecisionRule = 'ATT-PWODecisionRule-EX'8 and isnull(ac.isclosed,0) = 0 and p.SlotNumber = @SlotNumber  and isnull(ah.ReasonHead, '') = '' and isnull(ah.Decision, '') = '' select @ElementCount9 = @@ROWCOUNT select @ElementIndex = 1 while @ElementIndex <= @ElementCount begin select top 1 @UID_AttestationCase = bu.UID1 , @GenProcID = bu.UID2 , 10@EventName = bu.ContentFull , @BasisObjectKey = bu.ObjectKey1 , @SubLevelNumberString = bu.Ident1 , @UID_AttestationHelper = bu.UID3 from @ElementBuffer11 bu where bu.ElementIndex = @ElementIndex select @cond = N'UID_AttestationCase = ''' + rtrim(@UID_AttestationCase) + N''''  exec QBM_PJobCreate_HOFireEvent_B12 'AttestationCase', @cond, @EventName, @GenProcID , @AdditionalObjectKeysAffected = DEFAULT , @checkForExisting = 0 , @BasisObjectKey = @BasisObjectKey13 , @p2 = '_ParamName1', @v2 = 'SubLevelNumber' , @p3 = '_ParamValue1' , @v3 = @SubLevelNumberString  update AttestationHelper set ReasonHead = @WaitingForEx_3096514 where UID_AttestationHelper = @UID_AttestationHelper and isnull(ReasonHead, '') = '' select @ElementIndex += 1 end  END TRY BEGIN CATCH exec QBM_PSessionErrorAdd15 default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH endLabel: return end 16