Back to OIM Explorer

dbo.QBM_PViewBuildPrepareVPUR

Stored ProcedureSQL_STORED_PROCEDURESandbox DB

Stored Procedure.

Source: sandbox-db sys.sql_modules

Source size: 1.032 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_FCVGUIDToModuleOwner 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 source text reference
  • references source dbo.QBM_PViewDrop source text reference

Complete Source

SQL49 lines
1CREATE PROCEDURE QBM_PViewBuildPrepareVPUR(2  @TablePattern varchar(30),3  @ModuleOwner varchar(3)4)5AS6BEGIN7  DECLARE @ElementBuffer QBM_YCursorBuffer8  DECLARE @ElementCount int9  DECLARE @ElementIndex int10  DECLARE @TableName varchar(30)11  DECLARE @Debugswitch int = 012  SET XACT_ABORT OFF13  BEGIN TRY14    INSERT INTO @ElementBuffer(Ident1)15    SELECT t.TableName16    FROM DialogTable t17    WHERE18      dbo.QBM_FCVGUIDToModuleOwner(t.UID_DialogTable) = @ModuleOwner AND t.TableType IN('V',19    'P',20    'U',21    'R') AND t.TableName LIKE @TablePattern22    SELECT @ElementCount = @@rowcount23    SELECT @ElementIndex = 124    WHILE @ElementIndex <= @ElementCount25    BEGIN26      SELECT TOP 1 @TableName = bu.Ident127      FROM @ElementBuffer bu28      WHERE29        bu.ElementIndex = @ElementIndex30      IF @Debugswitch > 031      BEGIN32        print @tablename33      END34      EXEC QBM_PViewDrop @tablename,35        @Force = 136      SELECT @ElementIndex += 137    END38  END TRY39  BEGIN CATCH40    EXEC QBM_PSessionErrorAdd DEFAULT41    DECLARE @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow()42    RAISERROR(@Rethrow,43    18,44    1)45      WITH NOWAIT46  END CATCH47  ende:48  RETURN49END
Open raw exported source
SQL ยท Raw8 lines
1   create   procedure QBM_PViewBuildPrepareVPUR (@TablePattern varchar(30) , @ModuleOwner varchar(3) ) as begin declare @ElementBuffer QBM_YCursorBuffer2 declare @ElementCount int declare @ElementIndex int declare @TableName varchar(30) declare @Debugswitch int = 0 SET XACT_ABORT OFF BEGIN TRY insert into3 @ElementBuffer(Ident1) select t.TableName from DialogTable t where dbo.QBM_FCVGUIDToModuleOwner(t.UID_DialogTable) = @ModuleOwner and t.TableType in (4'V', 'P', 'U', 'R') and t.TableName like @TablePattern select @ElementCount = @@rowcount select @ElementIndex = 1 while @ElementIndex <= @ElementCount 5begin select top 1 @TableName = bu.Ident1 from @ElementBuffer bu where bu.ElementIndex = @ElementIndex if @Debugswitch > 0 begin print @tablename end exec6 QBM_PViewDrop @tablename, @Force = 1 select @ElementIndex += 1 end  END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default declare @Rethrow varchar(10007) = dbo.QBM_FGISessionErrorRethrow() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH  ende: return end 8