Back to OIM Explorer

dbo.ATT_ZAttestationObjectPreProp

Stored ProcedureSQL_STORED_PROCEDURESandbox DB

Stored Procedure.

Source: sandbox-db sys.sql_modules

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

SQL86 lines
1CREATE PROCEDURE ATT_ZAttestationObjectPreProp(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      isnull(t.isDeactivatedByPreProcessor,46      0),47      isnull(t.isDeactivatedByPreProcessor,48      0),49      x.GenProcID,50      isnull(c.PreProcessorCondition,51      N ''),52      c.isDeactivatedByPreProcessor53    FROM @DBQueueCurrent x54    JOIN AttestationObject c55      ON x.uid_parameter = c.uid_AttestationObject56    JOIN dialogtable t57      ON c.UID_DialogTable = t.UID_DialogTable58    UPDATE @PrePropHelper59    SET IsDeactivated = dbo.QBM_FGIPrepropConditionDeactiv(h.PreProcessorCondition)60    FROM @PrePropHelper h61    WHERE62      h.PreProcessorCondition > ' ' AND h.IsDeactivated = 063    EXEC QBM_PSessionContextSet 'GenProcID',64      @GenProcID65    UPDATE AttestationObject66    SET IsDeactivatedByPreProcessor = x.isDeactivated,67    xdateupdated = GetUTCDate(),68    xuserupdated = 'DBScheduler'69    FROM AttestationObject r70    JOIN @PrePropHelper x71      ON r.UID_AttestationObject = x.uid_parameter72    WHERE73      r.IsDeactivatedByPreProcessor <> x.IsDeactivated74  END TRY75  BEGIN CATCH76    EXEC QBM_PSessionErrorAdd DEFAULT77    RAISERROR('',78    18,79    1)80      WITH NOWAIT81  END CATCH82  endLabel:83  EXEC QBM_PSessionContextSet 'GenProcID',84    @GenProcID_R85  RETURN86END
Open raw exported source
SQL ยท Raw14 lines
1    create   procedure ATT_ZAttestationObjectPreProp (@SlotNumber int) as begin  declare @GenProcID varchar(38) declare @GenProcID_R varchar(38)2 = dbo.QBM_FGISessionContext('') declare @DBQueueCurrent QBM_YDBQueueCurrent BEGIN TRY insert into @DBQueueCurrent(UID_DialogDBQueue, UID_Parameter, UID_SubParameter3, GenProcID) select UID_DialogDBQueue, UID_Parameter, UID_SubParameter, GenProcID from QBMDBQueueCurrent cu with (readpast) where cu.SlotNumber = @SlotNumber4 if @@rowcount = 0 begin goto EndLabel end select @GenProcID = max(GenProcID) from @DBQueueCurrent where GenProcID > ' ' if isnull(@Genprocid, '') = ''5 begin select @GenProcID = newid() end declare @PrePropHelper QBM_YPrepropHelper insert into @PrePropHelper (uid_parameter , isDeactivatedPrior , IsDeactivated6 , GenProcID , PreProcessorCondition, IsDeactivatedOld) select x.uid_parameter, isnull(t.isDeactivatedByPreProcessor,0), isnull(t.isDeactivatedByPreProcessor7,0), x.GenProcID, isnull(c.PreProcessorCondition,N''), c.isDeactivatedByPreProcessor from @DBQueueCurrent x join AttestationObject c on x.uid_parameter8 = c.uid_AttestationObject join dialogtable t on c.UID_DialogTable = t.UID_DialogTable  update @PrePropHelper set IsDeactivated = dbo.QBM_FGIPrepropConditionDeactiv9(h.PreProcessorCondition) from @PrePropHelper h where h.PreProcessorCondition > ' ' and h.IsDeactivated = 0      exec QBM_PSessionContextSet 'GenProcID'10, @GenProcID update AttestationObject set IsDeactivatedByPreProcessor = x.isDeactivated, xdateupdated = GetUTCDate(), xuserupdated = 'DBScheduler'  from11 AttestationObject r join @PrePropHelper x on r.UID_AttestationObject = x.uid_parameter where r.IsDeactivatedByPreProcessor <> x.IsDeactivated END TRY 12BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH  endLabel: exec QBM_PSessionContextSet 'GenProcID', @GenProcID_R13 return end 14