Back to OIM Explorer

dbo.QBM_PViewBuildR

Stored ProcedureSQL_STORED_PROCEDURESandbox DB

Stored Procedure.

Source: sandbox-db sys.sql_modules

Source size: 1.537 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_FGISessionContext source text reference
  • references source dbo.QBM_FGISessionErrorRethrow source text reference
  • references source dbo.QBM_PSessionErrorAdd source text reference
  • references source dbo.QBM_PViewBuild source text reference
  • references source dbo.QBM_PViewBuildR_intern source text reference

Complete Source

SQL70 lines
1CREATE PROCEDURE QBM_PViewBuildR(2  @UID_TablePattern varchar(38) = '%',3  @dummy1 varchar(38) = '',4  @GenProcID varchar(38) = '',5  @AutoCorrectColumns BIT = 06)7AS8BEGIN9  DECLARE @UID_DialogTable varchar(38)10  DECLARE @GenProcID_R varchar(38) = dbo.QBM_FGISessionContext('')11  DECLARE @DebugSwitch int = 012  DECLARE @ElementBuffer QBM_YCursorBuffer13  DECLARE @ElementCount int14  DECLARE @ElementIndex int15  SET XACT_ABORT OFF16  BEGIN TRY17    IF isnull(@GenProcID,18    '') = ''19    BEGIN20      SELECT @GenProcID = @GenProcID_R21    END22    INSERT INTO @ElementBuffer(UID1)23    SELECT x.UID_DialogTable24    FROM(25    SELECT26      UID_DialogTable AS UID_DialogTable,27      def.SortOrder28    FROM dialogtable t29    JOIN QBMModuleDef def30      ON31    LEFT(t.uid_dialogtable, 3) = def.ModuleName32    WHERE33      t.tabletype = 'R' AND(t.UID_DialogTable LIKE @UID_TablePattern)34    UNION35    SELECT36      @UID_TablePattern,37      038    WHERE39      charindex('%', @UID_TablePattern) = 0 AND @UID_TablePattern > ' ') AS x40    ORDER BY x.SortOrder,41    x.UID_DialogTable42    SELECT @ElementCount = @@ROWCOUNT43    SELECT @ElementIndex = 144    WHILE @ElementIndex <= @ElementCount45    BEGIN46      SELECT TOP 1 @UID_DialogTable = bu.UID147      FROM @ElementBuffer bu48      WHERE49        bu.ElementIndex = @ElementIndex50      IF @Debugswitch > 051      BEGIN52        print @UID_DialogTable53      END54      EXEC QBM_PViewBuildR_intern @UID_DialogTable,55        @GenProcID,56        @AutoCorrectColumns = @AutoCorrectColumns57      SELECT @ElementIndex += 158    END59  END TRY60  BEGIN CATCH61    EXEC QBM_PSessionErrorAdd DEFAULT62    DECLARE @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow()63    RAISERROR(@Rethrow,64    18,65    1)66      WITH NOWAIT67  END CATCH68  ende:69  RETURN70END
Open raw exported source
SQL ยท Raw11 lines
1   create   procedure QBM_PViewBuildR ( @UID_TablePattern varchar(38) = '%' , @dummy1 varchar(38) = '' , @GenProcID varchar(38) = '' , @AutoCorrectColumns2 bit = 0 ) as begin  declare @UID_DialogTable varchar(38)  declare @GenProcID_R varchar(38) = dbo.QBM_FGISessionContext('') declare @DebugSwitch int = 30 declare @ElementBuffer QBM_YCursorBuffer declare @ElementCount int declare @ElementIndex int SET XACT_ABORT OFF BEGIN TRY if isnull(@GenProcID, '') =4 '' begin select @GenProcID = @GenProcID_R end insert into @ElementBuffer (UID1) select x.UID_DialogTable from ( select UID_DialogTable as UID_DialogTable5, def.SortOrder from dialogtable t join QBMModuleDef def on LEFT(t.uid_dialogtable, 3) = def.ModuleName where t.tabletype = 'R' and ( t.UID_DialogTable6 like @UID_TablePattern ) union  select @UID_TablePattern, 0 where charindex('%', @UID_TablePattern ) = 0 and @UID_TablePattern > ' ' ) as x order by x.SortOrder7, x.UID_DialogTable select @ElementCount = @@ROWCOUNT select @ElementIndex = 1 while @ElementIndex <= @ElementCount begin select top 1 @UID_DialogTable8 = bu.UID1 from @ElementBuffer bu where bu.ElementIndex = @ElementIndex if @Debugswitch > 0 begin print @UID_DialogTable end exec QBM_PViewBuildR_intern9 @UID_DialogTable , @GenProcID, @AutoCorrectColumns = @AutoCorrectColumns select @ElementIndex += 1 end  END TRY BEGIN CATCH exec QBM_PSessionErrorAdd 10default declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH ende: return end 11