Back to OIM Explorer

dbo.TSB_ZUNSGroupB3InUNSGroupB3_C

Stored ProcedureSQL_STORED_PROCEDURESandbox DB

Stored Procedure.

Source: sandbox-db sys.sql_modules

Source size: 1.948 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_PSessionErrorAdd source text reference
  • references source dbo.TSB_ZUNSGroupB3InUNSGroupB3 source text reference

References

Referenced By

  • No direct source references extracted.

Complete Source

SQL71 lines
1CREATE PROCEDURE TSB_ZUNSGroupB3InUNSGroupB3_C(2  @SlotNumberDummy int,3  @dummy1 varchar(38),4  @Dummy2 varchar(38),5  @GenProcIDDummy varchar(38)6)7AS8BEGIN9  BEGIN TRY10    UPDATE UNSGroupB3Collection11    SET IsCircular = 112    FROM UNSGroupB3Collection co13    WHERE14      co.UID_UNSGroupB3Child <> co.UID_UNSGroupB3Parent AND EXISTS(15    SELECT TOP 1 116    FROM UNSGroupB3Collection ce17    WHERE18      co.UID_UNSGroupB3Child = ce.UID_UNSGroupB3Parent AND co.UID_UNSGroupB3Parent = ce.UID_UNSGroupB3Child) AND IsCircular = 019    UPDATE UNSGroupB3Collection20    SET IsCircular = 021    FROM UNSGroupB3Collection co22    WHERE23      co.UID_UNSGroupB3Child <> co.UID_UNSGroupB3Parent AND NOT EXISTS(24    SELECT TOP 1 125    FROM UNSGroupB3Collection ce26    WHERE27      co.UID_UNSGroupB3Child = ce.UID_UNSGroupB3Parent AND co.UID_UNSGroupB3Parent = ce.UID_UNSGroupB3Child) AND IsCircular = 128    UPDATE UNSGroupB3Collection29    SET IsCircular = 130    FROM UNSGroupB3Collection co31    WHERE32      co.UID_UNSGroupB3Child = co.UID_UNSGroupB3Parent AND EXISTS(33    SELECT TOP 1 134    FROM UNSGroupB3Collection ce35    WHERE36      co.UID_UNSGroupB3Parent = ce.UID_UNSGroupB3Parent AND ce.UID_UNSGroupB3Child <> ce.UID_UNSGroupB3Parent AND IsCircular = 1) AND IsCircular37    = 038    UPDATE UNSGroupB3Collection39    SET IsCircular = 040    FROM UNSGroupB3Collection co41    WHERE42      co.UID_UNSGroupB3Child = co.UID_UNSGroupB3Parent AND NOT EXISTS(43    SELECT TOP 1 144    FROM UNSGroupB3Collection ce45    WHERE46      co.UID_UNSGroupB3Parent = ce.UID_UNSGroupB3Parent AND ce.UID_UNSGroupB3Child <> ce.UID_UNSGroupB3Parent AND IsCircular = 1) AND IsCircular47    = 148    UPDATE UNSGroupB3Collection49    SET IsCircular = x.IsCircular50    FROM UNSGroupB3Collection co51    JOIN(52    SELECT53      y.UID_UNSGroupB3Child,54      y.IsCircular55    FROM UNSGroupB3Collection y56    WHERE57      y.UID_UNSGroupB3Child = y.UID_UNSGroupB3Parent) AS x58      ON x.UID_UNSGroupB3Child = co.UID_UNSGroupB3Child59    WHERE60      co.IsCircular <> x.IsCircular61  END TRY62  BEGIN CATCH63    EXEC QBM_PSessionErrorAdd DEFAULT64    RAISERROR('',65    18,66    1)67      WITH NOWAIT68  END CATCH69  ende:70  RETURN71END
Open raw exported source
SQL ยท Raw14 lines
1         create   procedure TSB_ZUNSGroupB3InUNSGroupB3_C ( @SlotNumberDummy int , @dummy1 varchar(38) , @Dummy2 varchar(38) , @GenProcIDDummy2 varchar(38) ) as begin  BEGIN TRY update UNSGroupB3Collection set IsCircular = 1 from UNSGroupB3Collection co where co.UID_UNSGroupB3Child <> co.UID_UNSGroupB3Parent3 and exists (select top 1 1 from UNSGroupB3Collection ce where co.UID_UNSGroupB3Child = ce.UID_UNSGroupB3Parent and co.UID_UNSGroupB3Parent = ce.UID_UNSGroupB3Child4 ) and IsCircular = 0  update UNSGroupB3Collection set IsCircular = 0 from UNSGroupB3Collection co where co.UID_UNSGroupB3Child <> co.UID_UNSGroupB3Parent5 and not exists (select top 1 1 from UNSGroupB3Collection ce where co.UID_UNSGroupB3Child = ce.UID_UNSGroupB3Parent and co.UID_UNSGroupB3Parent6 = ce.UID_UNSGroupB3Child ) and IsCircular = 1  update UNSGroupB3Collection set IsCircular = 1 from UNSGroupB3Collection co where co.UID_UNSGroupB3Child7 = co.UID_UNSGroupB3Parent and exists (select top 1 1 from UNSGroupB3Collection ce where co.UID_UNSGroupB3Parent = ce.UID_UNSGroupB3Parent and 8ce.UID_UNSGroupB3Child <> ce.UID_UNSGroupB3Parent and IsCircular = 1 ) and IsCircular = 0 update UNSGroupB3Collection set IsCircular = 0 from UNSGroupB3Collection9 co where co.UID_UNSGroupB3Child = co.UID_UNSGroupB3Parent and not exists (select top 1 1 from UNSGroupB3Collection ce where co.UID_UNSGroupB3Parent10 = ce.UID_UNSGroupB3Parent and ce.UID_UNSGroupB3Child <> ce.UID_UNSGroupB3Parent and IsCircular = 1 ) and IsCircular = 1 update UNSGroupB3Collection11 set IsCircular = x.IsCircular from UNSGroupB3Collection co join (select y.UID_UNSGroupB3Child, y.IsCircular from UNSGroupB3Collection y where y.UID_UNSGroupB3Child12 = y.UID_UNSGroupB3Parent ) as x on x.UID_UNSGroupB3Child = co.UID_UNSGroupB3Child where co.IsCircular <> x.IsCircular  END TRY BEGIN CATCH exec 13QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH  ende: return end 14