Back to OIM Explorer

dbo.ATT_ZScheduleStart

Stored ProcedureSQL_STORED_PROCEDURESandbox DB

Stored Procedure. HOCallMethod -> PrepareAttestations.PrepareAttestations at line 12; References QBM_PJobCreate*; References QBM_PJobCreate_HOCallMethod*

Source: sandbox-db sys.sql_modules

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

  • HOCallMethod -> PrepareAttestations.PrepareAttestations at line 12
  • References QBM_PJobCreate*
  • References QBM_PJobCreate_HOCallMethod*

Typed Edges

  • calls object method PrepareAttestations.PrepareAttestations HOCallMethod -> PrepareAttestations.PrepareAttestations at line 12
  • references source dbo.QBM_PJobCreate source text reference
  • references source dbo.QBM_PJobCreate_HOCallMethod source text reference
  • references source dbo.QBM_PSessionErrorAdd source text reference

References

Referenced By

  • No direct source references extracted.

Complete Source

SQL101 lines
1CREATE PROCEDURE ATT_ZScheduleStart(2  @SlotNumber int3)4AS5BEGIN6  DECLARE @GenProcID varchar(38)7  DECLARE @PoliciesToHandle QBM_YCursorbuffer8  DECLARE @ObjectKeyPolicyOrGroup varchar(138)9  DECLARE @Tablename varchar(30)10  DECLARE @ElementCount int11  DECLARE @ElementIndex int12  DECLARE @WhereClause nvarchar(max)13  DECLARE @ObjectKeysAffected QBM_YParameterList14  DECLARE @DBQueueCurrent QBM_YDBQueueCurrent15  BEGIN TRY16    INSERT INTO @DBQueueCurrent(UID_DialogDBQueue,17    UID_Parameter,18    UID_SubParameter,19    GenProcID)20    SELECT21      UID_DialogDBQueue,22      UID_Parameter,23      UID_SubParameter,24      GenProcID25    FROM QBMDBQueueCurrent cu26      WITH(readpast)27    WHERE28      cu.SlotNumber = @SlotNumber29    IF @@rowcount = 030    BEGIN31      GOTO EndLabel32    END33    INSERT INTO @PoliciesToHandle(ObjectKey1,34    UID1,35    Ident1)36    SELECT37      ap.XObjectKey,38      cu.GenProcID,39      'AttestationPolicy' AS TableName40    FROM AttestationPolicy ap41    JOIN @DBQueueCurrent cu42      ON cu.UID_Parameter = ap.UID_DialogSchedule43    WHERE44      ap.IsInActive = 045    UNION all46    SELECT47      g.XObjectKey,48      cu.GenProcID,49      'AttestationPolicyGroup' AS TableName50    FROM AttestationPolicyGroup g51    JOIN @DBQueueCurrent cu52      ON cu.UID_Parameter = g.UID_DialogSchedule53    JOIN AttestationPolicy p54      ON g.UID_AttestationPolicyGroup = p.UID_AttestationPolicyGroup55    WHERE56      g.IsInActive = 057    SELECT @ElementCount = @@ROWCOUNT58    SELECT @ElementIndex = 159    IF @ElementCount = 060    BEGIN61      GOTO EndLabel62    END63    WHILE @ElementIndex <= @ElementCount64    BEGIN65      SELECT66        TOP 1 @ObjectKeyPolicyOrGroup = bu.ObjectKey1,67        @GenProcID = bu.UID1,68        @Tablename = bu.Ident1,69        @WhereClause = CONCAT('XObjectKey in (''',70        bu.ObjectKey1,71        ''')')72      FROM @PoliciesToHandle bu73      WHERE74        bu.ElementIndex = @ElementIndex75      DELETE @ObjectKeysAffected76      INSERT INTO @ObjectKeysAffected(Parameter1)77      SELECT @ObjectKeyPolicyOrGroup78      EXEC QBM_PJobCreate_HOCallMethod @objecttype = @Tablename,79        @WhereClause = @WhereClause,80        @save = 1,81        @MethodName = 'PrepareAttestations',82        @GenProcID = @GenprocID,83        @isToFreezeOnError = 1,84        @Retries = 3,85        @BasisObjectKey = @ObjectKeyPolicyOrGroup,86        @checkForExisting = 1,87        @ObjectKeysAffected = @ObjectKeysAffected,88        @SingleTransaction = 089      SELECT @ElementIndex += 190    END91  END TRY92  BEGIN CATCH93    EXEC QBM_PSessionErrorAdd DEFAULT94    RAISERROR('',95    18,96    1)97      WITH NOWAIT98  END CATCH99  endLabel:100  RETURN101END
Open raw exported source
SQL ยท Raw16 lines
1  create   procedure ATT_ZScheduleStart ( @SlotNumber int ) AS begin declare @GenProcID varchar(38) declare @PoliciesToHandle QBM_YCursorbuffer 2  declare @ObjectKeyPolicyOrGroup varchar(138) declare @Tablename varchar(30) declare @ElementCount int declare @ElementIndex int declare @WhereClause 3nvarchar(max) declare @ObjectKeysAffected QBM_YParameterList declare @DBQueueCurrent QBM_YDBQueueCurrent BEGIN TRY insert into @DBQueueCurrent(UID_DialogDBQueue4, UID_Parameter, UID_SubParameter, GenProcID) select UID_DialogDBQueue, UID_Parameter, UID_SubParameter, GenProcID from QBMDBQueueCurrent cu with (readpast5) where cu.SlotNumber = @SlotNumber if @@rowcount = 0 begin goto EndLabel end insert into @PoliciesToHandle(ObjectKey1, UID1, Ident1) select ap.XObjectKey6, cu.GenProcID, 'AttestationPolicy' as TableName from AttestationPolicy ap join @DBQueueCurrent cu on cu.UID_Parameter = ap.UID_DialogSchedule where ap.IsInActive7 = 0  union all select g.XObjectKey, cu.GenProcID, 'AttestationPolicyGroup' as TableName from AttestationPolicyGroup g join @DBQueueCurrent cu on cu.UID_Parameter8 = g.UID_DialogSchedule join AttestationPolicy p on g.UID_AttestationPolicyGroup = p.UID_AttestationPolicyGroup where g.IsInActive = 0 select @ElementCount9 = @@ROWCOUNT select @ElementIndex = 1 if @ElementCount = 0 begin goto EndLabel end while @ElementIndex <= @ElementCount begin select top 1 @ObjectKeyPolicyOrGroup10 = bu.ObjectKey1 , @GenProcID = bu.UID1 , @Tablename = bu.Ident1 , @WhereClause = concat('XObjectKey in (''' , bu.ObjectKey1 , ''')' ) from @PoliciesToHandle11 bu where bu.ElementIndex = @ElementIndex delete  @ObjectKeysAffected  insert into @ObjectKeysAffected(Parameter1) select @ObjectKeyPolicyOrGroup exec 12QBM_PJobCreate_HOCallMethod @objecttype = @Tablename  , @WhereClause = @WhereClause , @save = 1 , @MethodName = 'PrepareAttestations' , @GenProcID = @GenprocID13 , @isToFreezeOnError = 1 , @Retries = 3 , @BasisObjectKey = @ObjectKeyPolicyOrGroup , @checkForExisting = 1 , @ObjectKeysAffected = @ObjectKeysAffected14  , @SingleTransaction = 0 select @ElementIndex += 1 end  END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH15  endLabel: return end 16