Back to OIM Explorer

dbo.QBM_PMigrationNotReadyForComp

Stored ProcedureSQL_STORED_PROCEDURESandbox DB

Stored Procedure. Single DBQueue insert -> at line 7; References QBM_PDBQueueInsert_Single

Source: sandbox-db sys.sql_modules

Source size: 1.563 characters

Interpretation

  • Database routine. Review parameters, called procedures, DBQueue inserts, and QBM_PJobCreate helper calls before assuming side effects.
  • DBQueue relation detected. Follow the task procedure and referenced-by list for async processing.

Relations

  • Single DBQueue insert -> at line 7
  • References QBM_PDBQueueInsert_Single

Typed Edges

  • queues DBQueue task at line 7 Single DBQueue insert -> at line 7
  • references source dbo.QBM_FGICutOffTaskExists source text reference
  • references source dbo.QBM_FGISessionContext source text reference
  • references source dbo.QBM_FGISessionErrorRethrow source text reference
  • references source dbo.QBM_PDBQueueInsert_Single source text reference
  • references source dbo.QBM_PSessionContextSet source text reference
  • references source dbo.QBM_PSessionErrorAdd source text reference
  • references source dbo.QBM_PWaitForSeconds source text reference

Complete Source

SQL74 lines
1CREATE PROCEDURE QBM_PMigrationNotReadyForComp(2  @UID_Task varchar(38) = 'QBM-K-CommonWaitForCompiler',3  @WithTaskInsert BIT = 14)5AS6BEGIN7  DECLARE @notReady int = 18  DECLARE @exists int9  DECLARE @CutOffTaskLevel int10  DECLARE @GenProcID varchar(38) = newid()11  DECLARE @DebugSwitch int = 012  DECLARE @GenProcID_R varchar(38) = dbo.QBM_FGISessionContext('')13  DECLARE @XUser_R nvarchar(64) = dbo.QBM_FGISessionContext('XUser')14  SET XACT_ABORT OFF15  BEGIN TRY16    IF isnull(@UID_Task,17    '###') NOT IN('QBM-K-CommonWaitForCompiler',18    'QBM-K-BaseMigrationReady')19    BEGIN20      RAISERROR('#LDS#Invalid @UID_Task used.|',21      18,22      1)23        WITH nowait24    END25    SELECT @exists = dbo.QBM_FGICutOffTaskExists(@UID_Task)26    IF @exists = 127    BEGIN28      EXEC QBM_PWaitForSeconds 0.7529      SELECT @exists = dbo.QBM_FGICutOffTaskExists(@UID_Task)30      IF @exists = 131      BEGIN32        EXEC QBM_PWaitForSeconds 0.7533        SELECT @exists = dbo.QBM_FGICutOffTaskExists(@UID_Task)34      END35    END36    IF @exists = 0 AND @WithTaskInsert = 137    BEGIN38      IF EXISTS(39        SELECT TOP 1 140        FROM DialogDatabase d41        WITH(readpast)42      WHERE43        d.UID_CutOffTask IS NULL AND d.IsMainDatabase = 1)44      BEGIN45        EXEC QBM_PDBQueueInsert_Single @uid_task,46        '',47        '',48          @GenProcID49        GOTO endLabel50      END51    END52    SELECT @notReady = CASE @exists53    WHEN 0 THEN54    155    WHEN -1 THEN56    157    ELSE 058    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  endLabel:69  EXEC QBM_PSessionContextSet 'GenProcID',70    @GenProcID_R71  EXEC QBM_PSessionContextSet 'XUser',72    @XUser_R73  RETURN(@notReady)74END
Open raw exported source
SQL ยท Raw11 lines
1        create   procedure QBM_PMigrationNotReadyForComp  ( @UID_Task varchar(38) = 'QBM-K-CommonWaitForCompiler' , @WithTaskInsert bit = 1 ) as2 begin declare @notReady int = 1 declare @exists int   declare @CutOffTaskLevel int declare @GenProcID varchar(38) = newid() declare @DebugSwitch int =3 0 declare @GenProcID_R varchar(38) = dbo.QBM_FGISessionContext('') declare @XUser_R nvarchar(64) = dbo.QBM_FGISessionContext('XUser') SET XACT_ABORT OFF4 BEGIN TRY if isnull(@UID_Task, '###') not in ('QBM-K-CommonWaitForCompiler', 'QBM-K-BaseMigrationReady') begin raiserror ('#LDS#Invalid @UID_Task used.|'5, 18, 1) with nowait end select @exists = dbo.QBM_FGICutOffTaskExists(@UID_Task) if @exists = 1  begin exec QBM_PWaitForSeconds 0.75 select @exists = dbo.QBM_FGICutOffTaskExists6(@UID_Task) if @exists = 1 begin exec QBM_PWaitForSeconds 0.75 select @exists = dbo.QBM_FGICutOffTaskExists(@UID_Task) end end if @exists = 0   and @WithTaskInsert7 = 1 begin if exists (select top 1 1 from DialogDatabase d with (readpast) where d.UID_CutOffTask is null and d.IsMainDatabase = 1 ) begin exec QBM_PDBQueueInsert_Single8 @uid_task, '', '', @GenProcID goto endLabel end end select @notReady = case @exists when 0 then 1  when -1 then 1  else  0  end END TRY BEGIN CATCH exec9 QBM_PSessionErrorAdd default declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH endLabel:10 exec QBM_PSessionContextSet 'GenProcID', @GenProcID_R exec QBM_PSessionContextSet 'XUser', @XUser_R return (@notReady) end 11