Back to OIM Explorer

dbo.QBM_TIDialogTable

Database TriggerSQL_TRIGGERSandbox DB

Database Trigger on DialogTable. Bulk DBQueue insert -> QBM-K-CommonPrepropTable / QBM_ZPrePropTable at line 19; Single DBQueue insert -> QBM-K-TableRevisionFill / QBM_ZTableRevisionFill at line 19; Bulk DBQueue insert -> QBM-K-MissingDisplayRightFill / QBM_ZMissingDisplayRightFill at line 19; Single DBQueue insert -> QBM-K-TableRevisionFill / QBM_ZTableRevisionFill at line 20

Source: sandbox-db sys.sql_modules

Source size: 2.793 characters

Interpretation

  • Database trigger. Treat parent table and enqueue/object-layer calls as the main relation points.
  • DBQueue relation detected. Follow the task procedure and referenced-by list for async processing.

Relations

  • Bulk DBQueue insert -> QBM-K-CommonPrepropTable / QBM_ZPrePropTable at line 19
  • Single DBQueue insert -> QBM-K-TableRevisionFill / QBM_ZTableRevisionFill at line 19
  • Bulk DBQueue insert -> QBM-K-MissingDisplayRightFill / QBM_ZMissingDisplayRightFill at line 19
  • Single DBQueue insert -> QBM-K-TableRevisionFill / QBM_ZTableRevisionFill at line 20
  • Bulk DBQueue insert -> QBM-K-MissingDisplayRightFill / QBM_ZMissingDisplayRightFill at line 20
  • Bulk DBQueue insert -> QBM-K-MissingDisplayRightFill / QBM_ZMissingDisplayRightFill at line 24
  • References QBM_PDBQueueInsert_Single
  • References QBM_PDBQueueInsert_Bulk
  • Trigger parent table: DialogTable

Typed Edges

  • queues DBQueue task QBM_ZPrePropTable at line 19 Bulk DBQueue insert -> QBM-K-CommonPrepropTable / QBM_ZPrePropTable at line 19
  • queues DBQueue task QBM_ZTableRevisionFill at line 19 Single DBQueue insert -> QBM-K-TableRevisionFill / QBM_ZTableRevisionFill at line 19
  • queues DBQueue task QBM_ZMissingDisplayRightFill at line 19 Bulk DBQueue insert -> QBM-K-MissingDisplayRightFill / QBM_ZMissingDisplayRightFill at line 19
  • queues DBQueue task QBM_ZTableRevisionFill at line 20 Single DBQueue insert -> QBM-K-TableRevisionFill / QBM_ZTableRevisionFill at line 20
  • queues DBQueue task QBM_ZMissingDisplayRightFill at line 20 Bulk DBQueue insert -> QBM-K-MissingDisplayRightFill / QBM_ZMissingDisplayRightFill at line 20
  • queues DBQueue task QBM_ZMissingDisplayRightFill at line 24 Bulk DBQueue insert -> QBM-K-MissingDisplayRightFill / QBM_ZMissingDisplayRightFill at line 24
  • trigger on table DialogTable Trigger parent table: DialogTable
  • references source dbo.QBM_FGISessionContext source text reference
  • references source dbo.QBM_FGITableName source text reference
  • references source dbo.QBM_PDBQueueInsert_Bulk source text reference
  • references source dbo.QBM_PDBQueueInsert_Single source text reference
  • references source dbo.QBM_PGUIDReplaceCustomizerFill source text reference
  • references source dbo.QBM_PPrePropCheckSyntax source text reference
  • references source dbo.QBM_PSessionErrorAdd source text reference
  • references source dbo.QBM_PSQLCheckExecutable source text reference

Complete Source

SQL132 lines
1CREATE trigger QBM_TIDialogTable2  ON DialogTable FOR3INSERT NOT FOR Replication4AS5BEGIN6  DECLARE @SQLToCheck QBM_YParameterList7  DECLARE @DebugSwitch int = 08  DECLARE @ConditionsToCheck QBM_YParameterList9  BEGIN TRY10    IF EXISTS(11      SELECT TOP 1 112      FROM inserted)13    GOTO start14    RETURN start:15    IF @DebugSwitch > 016    BEGIN17      print '### im Insert trigger angekommen'18    END19    DECLARE @GenProcID varchar(38)20    SELECT @GenProcID = dbo.QBM_FGISessionContext('')21    INSERT INTO @ConditionsToCheck(ContentFull)22    SELECT i.PreProcessorCondition23    FROM inserted i24    EXEC QBM_PPrePropCheckSyntax @ConditionsToCheck25    DELETE @SQLToCheck26    INSERT INTO @SQLToCheck(Parameter1,27    ContentFull)28    SELECT29      c.XObjectKey,30      'select top 1 1 as columnvalue from ' + b.TableName + '31		 where (32		 ' + c.ViewWhereClause + '33		 )'34    FROM inserted c35    JOIN DialogTable b36      ON b.UID_DialogTable = c.UID_DialogTableBase37    WHERE38      c.ViewWhereClause > ' '39    EXEC QBM_PSQLCheckExecutable @SQLToCheck,40      @RaiseError = 141    DELETE @SQLToCheck42    INSERT INTO @SQLToCheck(Parameter1,43    ContentFull)44    SELECT45      i.XObjectKey,46      CONCAT('select top 1 1 as columnvalue 47									from (',48      ' select ',49      i.ExtensionForProxyTable,50      '51											from ',52      i.tablename,53      '54											where 1 = 055										) as x')56    FROM inserted i57    WHERE58      i.ExtensionForProxyTable > ' '59    EXEC QBM_PSQLCheckExecutable @SQLToCheck,60      @RaiseError = 161    IF @DebugSwitch > 062    BEGIN63      print '### vor dem 26 Test'64    END65    IF EXISTS(66      SELECT67        substring(TableName, 1, 26),68    count(*)69    FROM dialogtable70    GROUP BY substring(TableName, 1, 26)71    HAVING count(*) > 1)72    BEGIN73      RAISERROR('#LDS#The first 26 characters of a table name have to be unique.|',74      18,75      2)76    END77    IF @DebugSwitch > 078    BEGIN79      print '### nach dem 26 test'80    END81    DECLARE @DBQueueElements_01 QBM_YDBQueueRaw82    INSERT INTO @DBQueueElements_01(object,83    subobject,84    genprocid)85    SELECT86      dbo.QBM_FGITableName(x.uid),87      NULL,88      @GenProcID89    FROM(90    SELECT i.UID_DialogTable AS UID91    FROM inserted i) AS x92    EXEC QBM_PDBQueueInsert_Bulk 'QBM-K-CommonPrepropTable',93      @DBQueueElements_0194    EXEC QBM_PGUIDReplaceCustomizerFill95    EXEC QBM_PDBQueueInsert_Single 'QBM-K-TableRevisionFill',96    NULL,97    NULL,98      @GenProcID99    DECLARE @DBQueueElements_36836 QBM_YDBQueueRaw100    INSERT INTO @DBQueueElements_36836(Object,101    SubObject,102    GenProcID)103    SELECT104      x.uid,105      NULL,106      @GenProcID107    FROM(108    SELECT ra.UID_DialogTableParent AS uid109    FROM inserted t110    JOIN QBM_VQBMRelationALL ra111      ON t.UID_DialogTable = ra.UID_DialogTableChild112    UNION113    SELECT ra.UID_DialogTableChild114    FROM inserted t115    JOIN QBM_VQBMRelationALL ra116      ON t.UID_DialogTable = ra.UID_DialogTableParent117    UNION118    SELECT t.UID_DialogTable119    FROM inserted t) AS x120    EXEC QBM_PDBQueueInsert_Bulk 'QBM-K-MissingDisplayRightFill',121      @DBQueueElements_36836122  END TRY123  BEGIN CATCH124    EXEC QBM_PSessionErrorAdd DEFAULT125    RAISERROR('',126    18,127    1)128      WITH NOWAIT129  END CATCH130  ende:131  RETURN132END
Open raw exported source
SQL ยท Raw26 lines
1   create   trigger QBM_TIDialogTable on DialogTable  for Insert not for Replication as begin  declare @SQLToCheck QBM_YParameterList declare @DebugSwitch2 int = 0 declare @ConditionsToCheck QBM_YParameterList BEGIN TRY if exists (select top 1 1 from inserted) goto start return start: if @DebugSwitch > 0 3begin print '### im Insert trigger angekommen' end declare @GenProcID varchar(38) select @GenProcID = dbo.QBM_FGISessionContext('')  insert into @ConditionsToCheck4 (ContentFull) select i.PreProcessorCondition from inserted i exec QBM_PPrePropCheckSyntax @ConditionsToCheck   delete  @SQLToCheck  insert into @SQLToCheck5(Parameter1, ContentFull) select c.XObjectKey, 'select top 1 1 as columnvalue from ' + b.TableName + '6		 where (7		 ' + c.ViewWhereClause + '8		 )'9 from inserted c  join DialogTable b on b.UID_DialogTable = c.UID_DialogTableBase where c.ViewWhereClause > ' ' exec QBM_PSQLCheckExecutable @SQLToCheck10, @RaiseError = 1  delete  @SQLToCheck  insert into @SQLToCheck(Parameter1, ContentFull) select i.XObjectKey, concat('select top 1 1 as columnvalue 11									from ('12 , ' select ', i.ExtensionForProxyTable, '13											from ' , i.tablename , '14											where 1 = 015										) as x' ) from inserted i  where i.ExtensionForProxyTable16 > ' ' exec QBM_PSQLCheckExecutable @SQLToCheck, @RaiseError = 1 if @DebugSwitch > 0 begin print '### vor dem 26 Test' end  if exists ( select substring17(TableName,1,26), count(*) from dialogtable group by substring(TableName,1,26) having count(*) > 1 ) begin  raiserror( '#LDS#The first 26 characters of a table name have to be unique.|'18, 18, 2) end if @DebugSwitch > 0 begin print '### nach dem 26 test' end declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object19, subobject, genprocid) select dbo.QBM_FGITableName(x.uid), null, @GenProcID from (select i.UID_DialogTable as UID from inserted i ) as x exec QBM_PDBQueueInsert_Bulk20 'QBM-K-CommonPrepropTable', @DBQueueElements_01 exec QBM_PGUIDReplaceCustomizerFill    exec QBM_PDBQueueInsert_Single 'QBM-K-TableRevisionFill', null,21 null, @GenProcID  declare @DBQueueElements_36836 QBM_YDBQueueRaw insert into @DBQueueElements_36836(Object, SubObject, GenProcID) select x.uid, null, 22@GenProcID from ( select ra.UID_DialogTableParent as uid from inserted t join QBM_VQBMRelationALL ra on t.UID_DialogTable = ra.UID_DialogTableChild union23 select ra.UID_DialogTableChild from inserted t join QBM_VQBMRelationALL ra on t.UID_DialogTable = ra.UID_DialogTableParent union select t.UID_DialogTable24 from inserted t ) as x exec QBM_PDBQueueInsert_Bulk 'QBM-K-MissingDisplayRightFill', @DBQueueElements_36836  END TRY BEGIN CATCH exec QBM_PSessionErrorAdd25 default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end 26