Back to OIM Explorer

dbo.QBM_PQBMRelationExpand

Stored ProcedureSQL_STORED_PROCEDURESandbox DB

Stored Procedure.

Source: sandbox-db sys.sql_modules

Source size: 1.012 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_PQBMRelationExpand_One source text reference
  • references source dbo.QBM_PSessionErrorAdd source text reference

Complete Source

SQL40 lines
1CREATE PROCEDURE QBM_PQBMRelationExpand2AS3BEGIN4  DECLARE @UID_QBMRelation varchar(38)5  DECLARE @ElementBuffer QBM_YCursorBuffer6  DECLARE @ElementCount int7  DECLARE @ElementIndex int8  SET XACT_ABORT OFF9  BEGIN TRY10    INSERT INTO @ElementBuffer(UID1)11    SELECT v.UID_QBMRelation12    FROM QBM_VQBMRelation v13    JOIN DialogTable tp14      ON v.UID_DialogTableParent = tp.UID_DialogTable15    JOIN DialogTable tc16      ON v.UID_DialogTableChild = tc.UID_DialogTable17    WHERE18      v.UID_QBMRelationBase IS NULL AND(tp.TableType IN('B', 'V') OR tc.TableType IN('B', 'V'))19    SELECT @ElementCount = @@ROWCOUNT20    SELECT @ElementIndex = 121    WHILE @ElementIndex <= @ElementCount22    BEGIN23      SELECT TOP 1 @UID_QBMRelation = bu.UID124      FROM @ElementBuffer bu25      WHERE26        bu.ElementIndex = @ElementIndex27      EXEC QBM_PQBMRelationExpand_One @UID_QBMRelation28      SELECT @ElementIndex += 129    END30  END TRY31  BEGIN CATCH32    EXEC QBM_PSessionErrorAdd DEFAULT33    DECLARE @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow()34    RAISERROR(@Rethrow,35    18,36    1)37      WITH NOWAIT38  END CATCH39  endLabel:40END
Open raw exported source
SQL ยท Raw8 lines
1  create   procedure QBM_PQBMRelationExpand as begin declare @UID_QBMRelation varchar(38) declare @ElementBuffer QBM_YCursorBuffer declare @ElementCount2 int declare @ElementIndex int SET XACT_ABORT OFF BEGIN TRY insert into @ElementBuffer (UID1) select v.UID_QBMRelation from QBM_VQBMRelation v join DialogTable3 tp on v.UID_DialogTableParent = tp.UID_DialogTable join DialogTable tc on v.UID_DialogTableChild = tc.UID_DialogTable where v.UID_QBMRelationBase is null4 and ( tp.TableType in ('B', 'V') or tc.TableType in ('B', 'V') ) select @ElementCount = @@ROWCOUNT select @ElementIndex = 1 while @ElementIndex <= @ElementCount5 begin select top 1 @UID_QBMRelation = bu.UID1 from @ElementBuffer bu where bu.ElementIndex = @ElementIndex exec QBM_PQBMRelationExpand_One @UID_QBMRelation6 select @ElementIndex += 1 end  END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow()7 RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH endLabel: end 8