Back to OIM Explorer

dbo.QBM_PViewBuildP

Stored ProcedureSQL_STORED_PROCEDURESandbox DB

Stored Procedure.

Source: sandbox-db sys.sql_modules

Source size: 1.457 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_PViewBuildP_intern source text reference

Complete Source

SQL65 lines
1CREATE PROCEDURE QBM_PViewBuildP(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 @ElementBuffer QBM_YCursorBuffer12  DECLARE @ElementCount int13  DECLARE @ElementIndex int14  SET XACT_ABORT OFF15  BEGIN TRY16    IF isnull(@GenProcID,17    '') = ''18    BEGIN19      SELECT @GenProcID = @GenProcID_R20    END21    INSERT INTO @ElementBuffer(UID1)22    SELECT x.UID_DialogTable23    FROM(24    SELECT25      t.UID_DialogTable AS UID_DialogTable,26      def.SortOrder27    FROM dialogtable t28    JOIN QBMModuleDef def29      ON30    LEFT(t.uid_dialogtable, 3) = def.ModuleName31    WHERE32      t.tabletype = 'P' AND(t.UID_DialogTable LIKE @UID_TablePattern)33    UNION34    SELECT35      @UID_TablePattern,36      037    WHERE38      charindex('%', @UID_TablePattern) = 0 AND @UID_TablePattern > ' ') AS x39    ORDER BY x.SortOrder,40    x.UID_DialogTable41    SELECT @ElementCount = @@ROWCOUNT42    SELECT @ElementIndex = 143    WHILE @ElementIndex <= @ElementCount44    BEGIN45      SELECT TOP 1 @uid_Dialogtable = bu.UID146      FROM @ElementBuffer bu47      WHERE48        bu.ElementIndex = @ElementIndex49      EXEC QBM_PViewBuildP_intern @uid_Dialogtable,50        @GenProcID,51        @AutoCorrectColumns = @AutoCorrectColumns52      SELECT @ElementIndex += 153    END54  END TRY55  BEGIN CATCH56    EXEC QBM_PSessionErrorAdd DEFAULT57    DECLARE @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow()58    RAISERROR(@Rethrow,59    18,60    1)61      WITH NOWAIT62  END CATCH63  ende:64  RETURN65END
Open raw exported source
SQL ยท Raw11 lines
1   create   procedure QBM_PViewBuildP ( @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 @ElementBuffer QBM_YCursorBuffer3 declare @ElementCount int declare @ElementIndex int SET XACT_ABORT OFF BEGIN TRY if isnull(@GenProcID, '') = '' begin select @GenProcID = @GenProcID_R4 end  insert into @ElementBuffer (UID1) select x.UID_DialogTable from ( select t.UID_DialogTable as UID_DialogTable, def.SortOrder from dialogtable t join5 QBMModuleDef def on LEFT(t.uid_dialogtable, 3) = def.ModuleName where t.tabletype = 'P' and ( t.UID_DialogTable like @UID_TablePattern ) union  select6 @UID_TablePattern, 0 where charindex('%', @UID_TablePattern ) = 0 and @UID_TablePattern > ' ' ) as x order by x.SortOrder, x.UID_DialogTable select @ElementCount7 = @@ROWCOUNT select @ElementIndex = 1 while @ElementIndex <= @ElementCount begin select top 1 @uid_Dialogtable = bu.UID1 from @ElementBuffer bu where 8bu.ElementIndex = @ElementIndex exec QBM_PViewBuildP_intern @uid_Dialogtable, @GenProcID, @AutoCorrectColumns = @AutoCorrectColumns select @ElementIndex9 += 1 end  END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow() RAISERROR (@Rethrow,10 18, 1) WITH NOWAIT END CATCH  ende: return end 11