Back to OIM Explorer

dbo.QBM_PDialogProcessGetShrinkDef

Stored ProcedureSQL_STORED_PROCEDURESandbox DB

Stored Procedure.

Source: sandbox-db sys.sql_modules

Source size: 1.321 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_FCVStringToInt source text reference
  • references source dbo.QBM_FGIConfigparmValue source text reference
  • references source dbo.QBM_FGISessionErrorRethrow source text reference
  • references source dbo.QBM_PSessionErrorAdd source text reference

Complete Source

SQL67 lines
1CREATE PROCEDURE QBM_PDialogProcessGetShrinkDef(2  @AreaToCheck nvarchar(256),3  @ReadyForDeleteOrExport int OUTPUT,4  @LimitDate datetime OUTPUT5)6AS7BEGIN8  DECLARE @AnzahlTage int9  DECLARE @ExportPolicy int10  SET XACT_ABORT OFF11  BEGIN TRY12    SELECT @ReadyForDeleteOrExport = 013    SELECT @LimitDate = '2200-01-01'14    SELECT15      @ExportPolicy = CASE dbo.QBM_FGIConfigparmValue('Common\ProcessState\ExportPolicy')16      WHEN '' THEN17      018      WHEN 'NONE' THEN19      120      WHEN 'HDB' THEN21      222      WHEN 'FILE' THEN23      224    ELSE 025    END26    IF dbo.QBM_FCVStringToInt(dbo.QBM_FGIConfigparmValue('Common\ProcessState\' + @AreaToCheck + '\IsToExport'),27    0) = 128    BEGIN29      SELECT @ReadyForDeleteOrExport = @ExportPolicy30    END31    ELSE32    BEGIN33      IF @ExportPolicy > 034      BEGIN35        SELECT @ReadyForDeleteOrExport = 136      END37      ELSE38      BEGIN39        SELECT @ReadyForDeleteOrExport = 040      END41    END42    IF @ReadyForDeleteOrExport = 043    BEGIN44      GOTO ende45    END46    SELECT47      TOP 1 @AnzahlTage = dbo.QBM_FCVStringToInt(dbo.QBM_FGIConfigparmValue('Common\ProcessState\' + @AreaToCheck + '\LifeTime'),48      0)49    IF @AnzahlTage < 150    BEGIN51      SELECT @AnzahlTage = 152    END53    SELECT @AnzahlTage = @AnzahlTage *(-1)54    SELECT55      @LimitDate = dateadd(dd,56      @AnzahlTage,57      GetUTCDate()) ende:58  END TRY59  BEGIN CATCH60    EXEC QBM_PSessionErrorAdd DEFAULT61    DECLARE @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow()62    RAISERROR(@Rethrow,63    18,64    1)65      WITH NOWAIT66  END CATCH67END
Open raw exported source
SQL ยท Raw10 lines
1  create   procedure QBM_PDialogProcessGetShrinkDef (@AreaToCheck nvarchar(256)  , @ReadyForDeleteOrExport int output , @LimitDate datetime output2  ) as begin declare @AnzahlTage int  declare @ExportPolicy int SET XACT_ABORT OFF BEGIN TRY select @ReadyForDeleteOrExport = 0 select @LimitDate = '2200-01-01'3 select @ExportPolicy = case dbo.QBM_FGIConfigparmValue('Common\ProcessState\ExportPolicy') when '' then 0 when 'NONE' then 1 when 'HDB' then 2 when 'FILE'4 then 2 else 0 end  if dbo.QBM_FCVStringToInt(dbo.QBM_FGIConfigparmValue('Common\ProcessState\'+ @AreaToCheck + '\IsToExport'), 0) = 1 begin select @ReadyForDeleteOrExport5 = @ExportPolicy end else begin if @ExportPolicy > 0 begin select @ReadyForDeleteOrExport = 1 end else begin select @ReadyForDeleteOrExport = 0 end end6 if @ReadyForDeleteOrExport = 0  begin goto ende end select top 1 @AnzahlTage = dbo.QBM_FCVStringToInt(dbo.QBM_FGIConfigparmValue( 'Common\ProcessState\'7+ @AreaToCheck + '\LifeTime'), 0)  if @AnzahlTage < 1 begin select @AnzahlTage = 1 end select @AnzahlTage = @AnzahlTage * (-1) select @LimitDate = dateadd8(dd, @AnzahlTage, GetUTCDate())  ende: END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow9() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH end 10