Back to OIM Explorer

dbo.POL_TUQERPolicy

Database TriggerSQL_TRIGGERSandbox DB

Database Trigger on QERPolicy. Bulk DBQueue insert -> POL-K-QERPolicyMakeProc / POL_ZQERPolicyMakeProc at line 11; Bulk DBQueue insert -> POL-K-QERPolicyFill / POL_ZQERPolicyFill at line 11; Bulk DBQueue insert -> POL-K-QERPolicyFill / POL_ZQERPolicyFill at line 13; References QBM_PJobCreate*

Source: sandbox-db sys.sql_modules

Source size: 2.143 characters

Interpretation

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

Relations

  • Bulk DBQueue insert -> POL-K-QERPolicyMakeProc / POL_ZQERPolicyMakeProc at line 11
  • Bulk DBQueue insert -> POL-K-QERPolicyFill / POL_ZQERPolicyFill at line 11
  • Bulk DBQueue insert -> POL-K-QERPolicyFill / POL_ZQERPolicyFill at line 13
  • References QBM_PJobCreate*
  • References QBM_PDBQueueInsert_Bulk
  • Trigger parent table: QERPolicy

Typed Edges

  • queues DBQueue task POL_ZQERPolicyMakeProc at line 11 Bulk DBQueue insert -> POL-K-QERPolicyMakeProc / POL_ZQERPolicyMakeProc at line 11
  • queues DBQueue task POL_ZQERPolicyFill at line 11 Bulk DBQueue insert -> POL-K-QERPolicyFill / POL_ZQERPolicyFill at line 11
  • queues DBQueue task POL_ZQERPolicyFill at line 13 Bulk DBQueue insert -> POL-K-QERPolicyFill / POL_ZQERPolicyFill at line 13
  • trigger on table QERPolicy Trigger parent table: QERPolicy
  • references source dbo.QBM_FGISessionContext source text reference
  • references source dbo.QBM_PDBQueueInsert_Bulk source text reference
  • references source dbo.QBM_PJobCreate source text reference
  • references source dbo.QBM_PJobCreate_HODelete source text reference
  • references source dbo.QBM_PJobCreate_HODelete_L source text reference
  • references source dbo.QBM_PSessionErrorAdd source text reference
  • references source dbo.QBM_PSQLCheckExecutable source text reference

Complete Source

SQL106 lines
1CREATE trigger POL_TUQERPolicy2  ON QERPolicy FOR3UPDATE NOT FOR Replication4AS5BEGIN6  DECLARE @SQLToCheck QBM_YParameterList7  DECLARE @XObjectKeys QBM_YParameterList8  BEGIN TRY9    IF EXISTS(10      SELECT TOP 1 111      FROM inserted)12    GOTO start13    IF EXISTS(14      SELECT TOP 1 115      FROM deleted)16    GOTO start17    RETURN start:18    DECLARE @GenProcID varchar(38)19    SELECT @GenProcID = dbo.QBM_FGISessionContext('')20    DECLARE @UID_QERPolicy varchar(38)21    DECLARE @WhereClause nvarchar(1024)22    IF23    UPDATE(WhereClause)24    BEGIN25      INSERT INTO @SQLToCheck(Parameter1,26      ContentFull)27      SELECT28        c.XObjectKey,29        'select top 1 1 as columnvalue from ' + t.TableName + '30		 where (31		 ' + c.WhereClause + '32		 )'33      FROM inserted c34      JOIN DialogTable t35        ON c.UID_DialogTable = t.UID_DialogTable36      WHERE37        c.WhereClause > ' '38      EXEC QBM_PSQLCheckExecutable @SQLToCheck,39        @RaiseError = 140    END41    IF(42      UPDATE(WhereClause) OR43    UPDATE(IsInactive) OR44    UPDATE(IsNoWhereClause))45    BEGIN46      DECLARE @DBQueueElements_01 QBM_YDBQueueRaw47      INSERT INTO @DBQueueElements_01(object,48      subobject,49      genprocid)50      SELECT51        x.uid,52        NULL,53        @GenProcID54      FROM(55      SELECT t.UID_QERPolicy AS uid56      FROM QERPolicy t57      JOIN deleted d58        ON t.UID_QERPolicy = d.UID_QERPolicy) AS x59      EXEC QBM_PDBQueueInsert_Bulk 'POL-K-QERPolicyMakeProc',60        @DBQueueElements_0161      DECLARE @DBQueueElements_02 QBM_YDBQueueRaw62      INSERT INTO @DBQueueElements_02(object,63      subobject,64      genprocid)65      SELECT66        x.uid,67        NULL,68        @GenProcID69      FROM(70      SELECT t.UID_QERPolicy AS uid71      FROM QERPolicy t72      JOIN deleted d73        ON t.UID_QERPolicy = d.UID_QERPolicy74      WHERE75        isnull(t.IsInactive, 0) = 0) AS x76      EXEC QBM_PDBQueueInsert_Bulk 'POL-K-QERPolicyFill',77        @DBQueueElements_0278    END79    IF80    UPDATE(IsInActive)81    BEGIN82      INSERT INTO @XObjectKeys(Parameter1)83      SELECT pho.XObjectKey84      FROM deleted d85      JOIN QERPolicy r86        ON d.uid_QERPolicy = r.uid_QERPolicy87      JOIN QERPolicyHasObject pho88        ON pho.UID_QERPolicy = r.UID_QERPolicy89      WHERE90        (isnull(d.IsInActive, 0) = 0 AND isnull(r.IsInActive, 0) = 1)91      EXEC QBM_PJobCreate_HODelete_L 'QERPolicyHasObject',92        @XObjectKeys,93        @GenProcID,94        @AdditionalObjectKeysAffected = DEFAULT95    END96  END TRY97  BEGIN CATCH98    EXEC QBM_PSessionErrorAdd DEFAULT99    RAISERROR('',100    18,101    1)102      WITH NOWAIT103  END CATCH104  ende:105  RETURN106END
Open raw exported source
SQL ยท Raw18 lines
1create   trigger POL_TUQERPolicy on QERPolicy  for Update not for Replication as begin  declare @SQLToCheck QBM_YParameterList declare @XObjectKeys2 QBM_YParameterList BEGIN TRY if exists (select top 1 1 from inserted) goto start if exists (select top 1 1 from deleted) goto start return start: declare3 @GenProcID varchar(38) select @GenProcID = dbo.QBM_FGISessionContext('') declare @UID_QERPolicy varchar(38) declare @WhereClause nvarchar(1024) if update4(WhereClause) begin insert into @SQLToCheck(Parameter1, ContentFull) select c.XObjectKey, 'select top 1 1 as columnvalue from ' + t.TableName + '5		 where (6		 '7 + c.WhereClause + '8		 )' from inserted c  join DialogTable t on c.UID_DialogTable = t.UID_DialogTable where c.WhereClause > ' ' exec QBM_PSQLCheckExecutable9 @SQLToCheck, @RaiseError = 1 end  if (update(WhereClause) or update(IsInactive) or update(IsNoWhereClause) ) begin declare @DBQueueElements_01 QBM_YDBQueueRaw10 insert into @DBQueueElements_01 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select t.UID_QERPolicy as uid from QERPolicy t join11 deleted d on t.UID_QERPolicy = d.UID_QERPolicy ) as x exec QBM_PDBQueueInsert_Bulk 'POL-K-QERPolicyMakeProc', @DBQueueElements_01  declare @DBQueueElements_0212 QBM_YDBQueueRaw insert into @DBQueueElements_02 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select t.UID_QERPolicy as uid from13 QERPolicy t join deleted d on t.UID_QERPolicy = d.UID_QERPolicy where isnull(t.IsInactive, 0) = 0 ) as x exec QBM_PDBQueueInsert_Bulk 'POL-K-QERPolicyFill'14, @DBQueueElements_02 end   if update(IsInActive) begin insert into @XObjectKeys (Parameter1) select pho.XObjectKey from deleted d join QERPolicy r on 15d.uid_QERPolicy = r.uid_QERPolicy join QERPolicyHasObject pho on pho.UID_QERPolicy = r.UID_QERPolicy where (isnull(d.IsInActive, 0) = 0 and isnull(r.IsInActive16, 0) = 1) exec QBM_PJobCreate_HODelete_L 'QERPolicyHasObject', @XObjectKeys, @GenProcID , @AdditionalObjectKeysAffected = DEFAULT end END TRY BEGIN CATCH17 exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end 18