Back to OIM Explorer

dbo.QBM_PJournal

Stored ProcedureSQL_STORED_PROCEDURESandbox DB

Stored Procedure.

Source: sandbox-db sys.sql_modules

Source size: 1.301 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
  • references source dbo.QBM_PWriteDialogJournal source text reference

References

Referenced By

Complete Source

SQL83 lines
1CREATE PROCEDURE QBM_PJournal(2  @Message nvarchar(max),3  @Procid int,4  @MessageType char(1),5  @LevelFromProcedure char(1),6  @SuppressEntriesCount int = 07)8AS9BEGIN10  DECLARE @MessageIfError nvarchar(max)11  DECLARE @DebugSwitch int = 012  DECLARE @Procname nvarchar(256)13  SET XACT_ABORT OFF14  BEGIN TRY15    IF isnull(@MessageType,16    'X') NOT IN('T',17    'D',18    'I',19    'W',20    'E')21    BEGIN22      GOTO endlabel23    END24    IF isnull(@LevelFromProcedure,25    'X') NOT IN('T',26    'D',27    'I',28    'W',29    'E')30    BEGIN31      GOTO endlabel32    END33    IF TRANSLATE(@LevelFromProcedure,34    'TDIWE',35    '01234') <= TRANSLATE(@MessageType,36    'TDIWE',37    '01234')38    BEGIN39      GOTO doit40    END41    ELSE42    BEGIN43      GOTO endLabel44    END45    doit:46    IF @Message IS NULL AND @DebugSwitch = 147    BEGIN48      SELECT @Procname = OBJECT_NAME(@Procid)49      SELECT50        @MessageIfError = CONCAT('empty message for journal in ',51        @Procname)52      EXEC QBM_PWriteDialogJournal @MessageIfError,53        @procid,54        @procid,55      'E',56        @SuppressEntriesCount = 057      SET XACT_ABORT58        ON59      RAISERROR(@MessageIfError,60      18,61      1)62        WITH nowait63    END64    ELSE65    BEGIN66      EXEC QBM_PWriteDialogJournal @Message,67        @procid,68        @procid,69        @messagetype,70        @SuppressEntriesCount = @SuppressEntriesCount71    END72  END TRY73  BEGIN CATCH74    EXEC QBM_PSessionErrorAdd DEFAULT75    DECLARE @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow()76    RAISERROR(@Rethrow,77    18,78    1)79      WITH NOWAIT80  END CATCH81  endLabel:82  RETURN83END
Open raw exported source
SQL ยท Raw10 lines
1   create   procedure QBM_PJournal ( @Message nvarchar(max) , @Procid int , @MessageType char(1) , @LevelFromProcedure char(1) , @SuppressEntriesCount2 int = 0 ) as begin declare @MessageIfError nvarchar(max) declare @DebugSwitch int = 0 declare @Procname nvarchar(256) SET XACT_ABORT OFF BEGIN TRY if 3isnull(@MessageType, 'X') not in ('T', 'D', 'I', 'W', 'E') begin  goto endlabel end if isnull(@LevelFromProcedure, 'X') not in ('T', 'D', 'I', 'W', 'E'4) begin  goto endlabel end if TRANSLATE(@LevelFromProcedure, 'TDIWE', '01234') <= TRANSLATE(@MessageType, 'TDIWE', '01234') begin  goto doit end else begin5  goto endLabel end doit: if @Message is null and @DebugSwitch = 1 begin select @Procname = OBJECT_NAME(@Procid) select @MessageIfError = CONCAT('empty message for journal in '6, @Procname) exec QBM_PWriteDialogJournal @MessageIfError, @procid, @procid, 'E', @SuppressEntriesCount = 0  set XACT_ABORT ON raiserror(@MessageIfError7, 18, 1) with nowait end else begin exec QBM_PWriteDialogJournal @Message, @procid, @procid, @messagetype, @SuppressEntriesCount = @SuppressEntriesCount8 end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow() RAISERROR (@Rethrow, 18, 19) WITH NOWAIT END CATCH endLabel: return end 10