Back to OIM Explorer

dbo.ATT_PAttestationResetOneLevel

Stored ProcedureSQL_STORED_PROCEDURESandbox DB

Stored Procedure.

Source: sandbox-db sys.sql_modules

Source size: 1.233 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_FGISessionErrorRethrow source text reference
  • references source dbo.QBM_PSessionErrorAdd source text reference

Complete Source

SQL48 lines
1CREATE PROCEDURE ATT_PAttestationResetOneLevel(2  @uid_AttestationCase varchar(38),3  @NewLevel int,4  @GenProcID varchar(38)5)6AS7BEGIN8  DECLARE @WhereclauseForMail nvarchar(1000)9  SET XACT_ABORT OFF10  BEGIN TRY11    IF EXISTS(12      SELECT TOP 1 113      FROM AttestationHelper h14      WHERE15        uid_AttestationCase = @uid_AttestationCase AND levelnumber = @NewLevel AND(h.decision > ' ' OR h.UID_PersonInsteadOf > ' ' OR h.uid_PersonAdditional16    > ' '))17    BEGIN18      UPDATE Attestationhelper19      SET decision = '',20      uid_PersonInsteadOf = NULL,21      uid_PersonAdditional = NULL22      FROM AttestationHelper h23      WHERE24        uid_AttestationCase = @uid_AttestationCase AND levelnumber = @NewLevel AND(h.decision > ' ' OR h.UID_PersonInsteadOf > ' ' OR h.uid_PersonAdditional25      > ' ')26    END27    IF EXISTS(28      SELECT TOP 1 129      FROM AttestationHelper h30      WHERE31        uid_AttestationCase = @uid_AttestationCase AND levelnumber = @NewLevel AND(h.IsFromDelegation = 1))32    BEGIN33      DELETE Attestationhelper34      WHERE35        isFromDelegation = 1 AND uid_AttestationCase = @uid_AttestationCase AND levelnumber = @NewLevel36    END37  END TRY38  BEGIN CATCH39    EXEC QBM_PSessionErrorAdd DEFAULT40    DECLARE @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow()41    RAISERROR(@Rethrow,42    18,43    1)44      WITH NOWAIT45  END CATCH46  ende:47  RETURN48END
Open raw exported source
SQL ยท Raw9 lines
1   create   procedure ATT_PAttestationResetOneLevel (@uid_AttestationCase varchar(38) , @NewLevel int , @GenProcID varchar(38)  ) as begin declare2 @WhereclauseForMail nvarchar(1000) SET XACT_ABORT OFF BEGIN TRY if exists (select top 1 1 from AttestationHelper h where uid_AttestationCase = @uid_AttestationCase3 and levelnumber = @NewLevel and ( h.decision > ' ' or h.UID_PersonInsteadOf > ' ' or h.uid_PersonAdditional > ' ' ) ) begin update Attestationhelper set4 decision = '' , uid_PersonInsteadOf = null , uid_PersonAdditional = null from AttestationHelper h where uid_AttestationCase = @uid_AttestationCase and5 levelnumber = @NewLevel and ( h.decision > ' ' or h.UID_PersonInsteadOf > ' ' or h.uid_PersonAdditional > ' ' ) end if exists (select top 1 1 from AttestationHelper6 h where uid_AttestationCase = @uid_AttestationCase and levelnumber = @NewLevel and ( h.IsFromDelegation = 1 ) ) begin delete Attestationhelper where isFromDelegation7 = 1 and uid_AttestationCase = @uid_AttestationCase and levelnumber = @NewLevel end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default declare @Rethrow8 varchar(1000) = dbo.QBM_FGISessionErrorRethrow() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH  ende: return end 9