Back to OIM Explorer

dbo.ATT_PAttestationCaseDeleteOld

Stored ProcedureSQL_STORED_PROCEDURESandbox DB

Stored Procedure. Single DBQueue insert -> ATT-K-AttestationRunDeleteOld / ATT_ZAttestationRunDeleteOld at line 14; References QBM_PDBQueueInsert_Single

Source: sandbox-db sys.sql_modules

Source size: 1.814 characters

Interpretation

  • Database routine. Review parameters, called procedures, DBQueue inserts, and QBM_PJobCreate helper calls before assuming side effects.
  • DBQueue relation detected. Follow the task procedure and referenced-by list for async processing.

Relations

  • Single DBQueue insert -> ATT-K-AttestationRunDeleteOld / ATT_ZAttestationRunDeleteOld at line 14
  • References QBM_PDBQueueInsert_Single

Typed Edges

  • queues DBQueue task ATT_ZAttestationRunDeleteOld at line 14 Single DBQueue insert -> ATT-K-AttestationRunDeleteOld / ATT_ZAttestationRunDeleteOld at line 14
  • references source dbo.QBM_FGIConfigparmValue source text reference
  • references source dbo.QBM_FGISessionContext source text reference
  • references source dbo.QBM_FGISessionErrorRethrow source text reference
  • references source dbo.ATT_P47650F5671BCBA8B679125E_ source text reference
  • references source dbo.QBM_PDBQueueInsert_Single source text reference
  • references source dbo.QBM_PSessionErrorAdd source text reference
  • queues DBQueue task ATT-K-AttestationRunDeleteOld -> ATT_ZAttestationRunDeleteOld QBM_PDBQueueInsert_Single 'ATT-K-AttestationRunDeleteOld' , '', '', @GenProcID END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT …

Complete Source

SQL87 lines
1CREATE PROCEDURE ATT_PAttestationCaseDeleteOld(2  @UID_AttestationPolicy varchar(38),3  @CaseWhereClause nvarchar(max) = NULL4)5AS6BEGIN7  DECLARE @LimitOfOldCases int8  DECLARE @IsInActive BIT9  DECLARE @lauf int10  DECLARE @GenProcID varchar(38)11  DECLARE @SQLCmd nvarchar(max)12  DECLARE @GivenObjects QBM_YParameterList13  SET XACT_ABORT OFF14  BEGIN TRY15    SELECT @GenProcID = dbo.QBM_FGISessionContext('')16    SELECT17      TOP 1 @LimitOfOldCases = LimitOfOldCases,18      @IsInActive = IsInActive19    FROM AttestationPolicy20    WHERE21      UID_AttestationPolicy = @UID_AttestationPolicy22    IF isnull(@LimitOfOldCases,23    0) < 1 AND @IsInActive = 024    BEGIN25      GOTO ende26    END27    IF '' = dbo.QBM_FGIConfigparmValue(N 'Common\ProcessState\PropertyLog') AND @IsInActive = 028    BEGIN29      GOTO ende30    END31    IF(32      SELECT count(*)33    FROM DialogColumn34    WHERE35      UID_DialogTable = 'ATT-T-AttestationHistory' AND istowatchDelete = 1) < 3 AND @IsInActive = 036    BEGIN37      GOTO ende38    END39    IF(40      SELECT count(*)41    FROM DialogColumn42    WHERE43      UID_DialogTable = 'ATT-T-AttestationCase' AND istowatchDelete = 1) < 3 AND @IsInActive = 044    BEGIN45      GOTO ende46    END47    IF @CaseWhereClause > ' '48    BEGIN49      SELECT50        @SQLCmd = CONCAT('	select ObjectKeyBase51		from AttestationCase52		where UID_AttestationPolicy = ''',53        @UID_AttestationPolicy,54        '''55		and ',56        @CaseWhereClause,57        '58')59      INSERT INTO @GivenObjects(Parameter1)60      EXEC sp_executeSQl @SQLCmd61    END62    SELECT @lauf = 163    WHILE @lauf > 064    BEGIN65      EXEC @lauf = ATT_P47650F5671BCBA8B679125E_ @UID_AttestationPolicy,66        @CaseWhereClause,67        @LimitOfOldCases,68        @GivenObjects69    END70    ende:71    EXEC QBM_PDBQueueInsert_Single 'ATT-K-AttestationRunDeleteOld',72    '',73    '',74      @GenProcID75  END TRY76  BEGIN CATCH77    EXEC QBM_PSessionErrorAdd DEFAULT78    DECLARE @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow()79    RAISERROR(@Rethrow,80    18,81    1)82      WITH NOWAIT83  END CATCH84  endLabel:85  SET lock_timeout -186  RETURN87END
Open raw exported source
SQL · Raw17 lines
1create   procedure ATT_PAttestationCaseDeleteOld ( @UID_AttestationPolicy varchar(38) , @CaseWhereClause nvarchar(max) = null  ) as begin declare2 @LimitOfOldCases int declare @IsInActive bit declare @lauf int declare @GenProcID varchar(38) declare @SQLCmd nvarchar(max) declare @GivenObjects QBM_YParameterList3 SET XACT_ABORT OFF BEGIN TRY select @GenProcID = dbo.QBM_FGISessionContext('') select top 1 @LimitOfOldCases = LimitOfOldCases , @IsInActive = IsInActive4 from AttestationPolicy where UID_AttestationPolicy = @UID_AttestationPolicy if isnull(@LimitOfOldCases, 0) < 1 and @IsInActive = 0 begin goto ende end5 if '' = dbo.QBM_FGIConfigparmValue (N'Common\ProcessState\PropertyLog') and @IsInActive = 0 begin goto ende end if (select count(*) from DialogColumn 6where UID_DialogTable = 'ATT-T-AttestationHistory' and istowatchDelete = 1 ) < 3 and @IsInActive = 0 begin goto ende end if (select count(*) from DialogColumn7 where UID_DialogTable = 'ATT-T-AttestationCase' and istowatchDelete = 1 ) < 3 and @IsInActive = 0 begin goto ende end if @CaseWhereClause > ' ' begin 8select @SQLCmd = concat('	select ObjectKeyBase9		from AttestationCase10		where UID_AttestationPolicy = ''', @UID_AttestationPolicy, '''11		and ', @CaseWhereClause12, '13') insert into @GivenObjects(Parameter1) exec sp_executeSQl @SQLCmd  end   select @lauf = 1 while @lauf > 0 begin exec @lauf = ATT_P47650F5671BCBA8B679125E_14 @UID_AttestationPolicy , @CaseWhereClause , @LimitOfOldCases , @GivenObjects      end   ende:  exec QBM_PDBQueueInsert_Single 'ATT-K-AttestationRunDeleteOld'15, '', '', @GenProcID END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow() RAISERROR 16(@Rethrow, 18, 1) WITH NOWAIT END CATCH endLabel:  set lock_timeout -1 return end 17