Back to OIM Explorer

dbo.LDP_ZBaseTreeHasObject

Stored ProcedureSQL_STORED_PROCEDURESandbox DB

Stored Procedure.

Source: sandbox-db sys.sql_modules

Source size: 3.205 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_FGIBitPatternXOrigin source text reference
  • references source dbo.QBM_FGIModuleExists source text reference
  • references source dbo.QER_FCVXOriginToInheritInfo source text reference
  • references source dbo.QER_FGIBitPatternInheritInfo source text reference
  • references source dbo.QBM_PDBQueueCalculateDelta source text reference
  • references source dbo.QBM_PSessionErrorAdd source text reference
  • references source dbo.QER_PBasetreeHasObjectPostProc source text reference

Complete Source

SQL135 lines
1CREATE PROCEDURE LDP_ZBaseTreeHasObject(2  @SlotNumber int3)4AS5BEGIN6  DECLARE @Sourcedata QBM_YDataForDelta,7  @CountDeltaQantity int,8  @CountDeltaOrigin int9  DECLARE @QER_BitPattern_Inherit_0 int = dbo.QER_FGIBitPatternInheritInfo('|Inherit|',10  0)11  DECLARE @DBQueueCurrent QBM_YDBQueueCurrent12  DECLARE @QBM_BitPatternXOrigin_Inherit int = dbo.QBM_FGIBitPatternXOrigin('|Inherit|',13  0)14  BEGIN TRY15    INSERT INTO @DBQueueCurrent(UID_DialogDBQueue,16    UID_Parameter,17    UID_SubParameter,18    GenProcID)19    SELECT20      UID_DialogDBQueue,21      UID_Parameter,22      UID_SubParameter,23      GenProcID24    FROM QBMDBQueueCurrent cu25      WITH(readpast)26    WHERE27      cu.SlotNumber = @SlotNumber28    IF @@rowcount = 029    BEGIN30      GOTO EndLabel31    END32    INSERT INTO @SourceData(IsUpcommingContent,33    XOriginAfter,34    Element,35    AssignedElement,36    XOriginBefore)37    SELECT38      0,39      0,40      uid_Org,41      ObjectKey,42      InheritInfo43    FROM BaseTreeHasObject bho44    JOIN @DBQueueCurrent x45      ON uid_Org = x.uid_parameter46    WHERE47      bho.ObjectKey LIKE '<Key><T>LDAPGroup</T>%'48    INSERT INTO @SourceData(IsUpcommingContent,49    XOriginBefore,50    Element,51    AssignedElement,52    XOriginAfter)53    SELECT54      1,55      0,56      y.UID_Org,57      z.XObjectKey,58      dbo.QER_FCVXOriginToInheritInfo(y.XOrigin)59    FROM BaseTreeHasLDAPGroup y60    JOIN @DBQueueCurrent x61      ON y.UID_Org= x.uid_parameter AND y.XOrigin > 0 AND y.XIsInEffect = 162    JOIN LDAPGroup z63      ON z.uid_LDAPGroup = y.uid_LDAPGroup64    IF dbo.QBM_FGIModuleExists('RMS') = 165    BEGIN66      INSERT INTO @SourceData(IsUpcommingContent,67      XOriginBefore,68      Element,69      AssignedElement,70      XOriginAfter)71      SELECT72        1,73        0,74        y.UID_Org,75        ehe.Entitlement,76        dbo.QER_FCVXOriginToInheritInfo(@QBM_BitPatternXOrigin_Inherit)77      FROM BaseTreeHasESet y78      JOIN @DBQueueCurrent x79        ON y.UID_Org = x.uid_parameter AND y.XOrigin > 0 AND y.XIsInEffect = 180      JOIN ESetHasEntitlement ehe81        ON ehe.UID_ESet = y.UID_ESet AND ehe.XOrigin > 0 AND ehe.XIsInEffect = 182      JOIN BaseTree b83        ON y.UID_Org = b.UID_Org AND NOT(b.UID_OrgRoot IN('QER-V-ITShopOrg', 'QER-V-ITShopSrc') AND b.ITShopInfo IN('BO',84      'PR', 'BG', 'BT'))85      JOIN OrgRootAssign oa86        ON oa.UID_OrgRoot = b.UID_OrgRoot AND oa.IsAssignmentAllowed = 187      WHERE88        (ehe.Entitlement LIKE '<Key><T>LDAPGroup</T>%' AND oa.UID_BaseTreeAssign = 'LDP-AsgnBT-LDAPGroup')89    END90    INSERT INTO @SourceData(IsUpcommingContent,91    XOriginBefore,92    Element,93    AssignedElement,94    XOriginAfter)95    SELECT96      1,97      0,98      t.Element,99      t.XObjectKey,100      @QER_BitPattern_Inherit_0101    FROM(102    SELECT103      DISTINCT ho.Element,104      p.XObjectKey105    FROM @SourceData ho106    JOIN LDAPGroup g107      ON ho.AssignedElement = g.XObjectKey108    JOIN LDAPGroupCollection co109      ON co.UID_LDAPGroupChild = g.uid_LDAPGroup110    JOIN LDAPGroup p111      ON co.UID_LDAPGroupParent = p.UID_LDAPGroup112    WHERE113      ho.IsUpcommingContent = 1 AND co.UID_LDAPGroupChild <> co.UID_LDAPGroupParent) AS t berechnen:114    EXEC QBM_PDBQueueCalculateDelta @SourceData,115      @DeltaQuantity = 0,116      @DeltaDelete = 1,117      @DeltaInsert = 1,118      @DeltaOrigin = 1,119      @CountDeltaQantity = @CountDeltaQantity OUTPUT,120      @CountDeltaOrigin = @CountDeltaOrigin OUTPUT,121      @UseIsInEffect = 0,122      @SlotNumber = @SlotNumber,123      @DBQueueCurrentExtern = @DBQueueCurrent124    EXEC QER_PBasetreeHasObjectPostProc @CountDeltaOrigin,125      @CountDeltaQantity126  END TRY127  BEGIN CATCH128    EXEC QBM_PSessionErrorAdd DEFAULT129    RAISERROR('',130    18,131    1)132      WITH NOWAIT133  END CATCH134  endLabel:135END
Open raw exported source
SQL ยท Raw21 lines
1      create   procedure LDP_ZBaseTreeHasObject (@SlotNumber int) AS begin declare @Sourcedata QBM_YDataForDelta , @CountDeltaQantity int , @CountDeltaOrigin2 int declare @QER_BitPattern_Inherit_0 int = dbo.QER_FGIBitPatternInheritInfo('|Inherit|', 0) declare @DBQueueCurrent QBM_YDBQueueCurrent declare @QBM_BitPatternXOrigin_Inherit3 int = dbo.QBM_FGIBitPatternXOrigin('|Inherit|', 0)  BEGIN TRY insert into @DBQueueCurrent(UID_DialogDBQueue, UID_Parameter, UID_SubParameter, GenProcID4) select UID_DialogDBQueue, UID_Parameter, UID_SubParameter, GenProcID from QBMDBQueueCurrent cu with (readpast) where cu.SlotNumber = @SlotNumber if @@rowcount5 = 0 begin goto EndLabel end insert into @SourceData( IsUpcommingContent, XOriginAfter , Element, AssignedElement, XOriginBefore ) select 0, 0 , uid_Org6, ObjectKey, InheritInfo from BaseTreeHasObject bho join @DBQueueCurrent x on uid_Org = x.uid_parameter where bho.ObjectKey like '<Key><T>LDAPGroup</T>%'7  insert into @SourceData( IsUpcommingContent, XOriginBefore , Element, AssignedElement, XOriginAfter ) select 1, 0 , y.UID_Org, z.XObjectKey, dbo.QER_FCVXOriginToInheritInfo8(y.XOrigin) from BaseTreeHasLDAPGroup y join @DBQueueCurrent x on y.UID_Org= x.uid_parameter and y.XOrigin > 0 and y.XIsInEffect = 1 join LDAPGroup z on9 z.uid_LDAPGroup = y.uid_LDAPGroup if dbo.QBM_FGIModuleExists('RMS') = 1 begin insert into @SourceData( IsUpcommingContent, XOriginBefore , Element, AssignedElement10, XOriginAfter ) select 1, 0 , y.UID_Org, ehe.Entitlement, dbo.QER_FCVXOriginToInheritInfo(@QBM_BitPatternXOrigin_Inherit) from BaseTreeHasESet y join 11@DBQueueCurrent x on y.UID_Org = x.uid_parameter and y.XOrigin > 0 and y.XIsInEffect = 1 join ESetHasEntitlement ehe on ehe.UID_ESet = y.UID_ESet and ehe.XOrigin12 > 0 and ehe.XIsInEffect = 1 join BaseTree b on y.UID_Org = b.UID_Org  and not (b.UID_OrgRoot in ( 'QER-V-ITShopOrg', 'QER-V-ITShopSrc') and b.ITShopInfo13 in ( 'BO', 'PR', 'BG', 'BT') ) join OrgRootAssign oa on oa.UID_OrgRoot = b.UID_OrgRoot and oa.IsAssignmentAllowed = 1 where (ehe.Entitlement like '<Key><T>LDAPGroup</T>%'14 and oa.UID_BaseTreeAssign = 'LDP-AsgnBT-LDAPGroup')        end   insert into @SourceData( IsUpcommingContent, XOriginBefore , Element, AssignedElement15, XOriginAfter ) select 1, 0 , t.Element, t.XObjectKey, @QER_BitPattern_Inherit_0 from ( select distinct ho.Element, p.XObjectKey from @SourceData ho join16 LDAPGroup g on ho.AssignedElement = g.XObjectKey  join LDAPGroupCollection co on co.UID_LDAPGroupChild = g.uid_LDAPGroup join LDAPGroup p on co.UID_LDAPGroupParent17 = p.UID_LDAPGroup where ho.IsUpcommingContent = 1 and co.UID_LDAPGroupChild <> co.UID_LDAPGroupParent  ) as t         berechnen: exec QBM_PDBQueueCalculateDelta18 @SourceData, @DeltaQuantity = 0, @DeltaDelete = 1, @DeltaInsert = 1, @DeltaOrigin = 1, @CountDeltaQantity = @CountDeltaQantity output , @CountDeltaOrigin19 = @CountDeltaOrigin output , @UseIsInEffect = 0 , @SlotNumber = @SlotNumber , @DBQueueCurrentExtern = @DBQueueCurrent exec QER_PBasetreeHasObjectPostProc20 @CountDeltaOrigin, @CountDeltaQantity END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH endLabel: end 21