dbo.QBM_PQBMTranslationAddOnClean
Stored ProcedureSQL_STORED_PROCEDURESandbox DB
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_FCVGUIDToModuleOwner source text reference
- references source dbo.QBM_FGIDBOwner source text reference
- references source dbo.QBM_FGISessionErrorRethrow source text reference
- references source dbo.QBM_PSessionErrorAdd source text reference
References
- dbo.QBM_FCVGUIDToModuleOwner
- dbo.QBM_FGIDBOwner
- dbo.QBM_FGISessionErrorRethrow
- dbo.QBM_PSessionErrorAdd
Referenced By
- No direct source references extracted.
Complete Source
1CREATE PROCEDURE QBM_PQBMTranslationAddOnClean2AS3BEGIN4 DECLARE @DebugSwitch int = 05 DECLARE @lauf int = 16 DECLARE @Module varchar(3)7 DECLARE @EntryKey nvarchar(1024)8 SET XACT_ABORT OFF9 BEGIN TRY10 WHILE @lauf > 011 BEGIN12 SELECT @Module = NULL13 SELECT14 TOP 1 @Module = z.AddOnOwner,15 @EntryKey = z.EntryKey16 FROM(17 SELECT18 md.SortOrder AS AddOnSortorder,19 sign(len(isnull(co.UID_ModuleFollower, ''))) AS AddOnIsDBOwnersPredecessor,20 sign(len(replace(y.AddOnOwner, y.TranslationOwner, ''))) AS OwnerOfTranslationAndAddonDiffers,21 y.*22 FROM(23 SELECT24 dbo.QBM_FCVGUIDToModuleOwner(s.UID_QBMTranslationAddOnSource) AS AddOnOwner, isnull(m.ModuleOwner,25 'ZZZ') AS TranslationOwner, s.EntryKey26 FROM QBMTranslationAddOnSource s27 JOIN(28 SELECT a.EntryKey29 FROM QBMTranslationAddOnSource a30 GROUP BY a.EntryKey31 HAVING COUNT(*) > 1) AS x32 ON s.EntryKey = x.EntryKey33 LEFT34 OUTER35 JOIN(36 SELECT37 dbo.QBM_FCVGUIDToModuleOwner(m.UID_DialogMultiLanguage) AS ModuleOwner, m.EntryKey38 FROM DialogMultiLanguage m39 WHERE40 m.UID_DialogColumn = 'QBM-7262717EE68049A9BE2EEB30C6EC408B'41 GROUP BY dbo.QBM_FCVGUIDToModuleOwner(m.UID_DialogMultiLanguage), m.EntryKey) AS m42 ON m.EntryKey = s.EntryKey) AS y43 JOIN QBMModuleDef md44 ON y.AddOnOwner = md.ModuleName45 LEFT46 OUTER47 JOIN QBMModuleDependCollection co48 ON co.UID_ModuleFollower = dbo.QBM_FGIDBOwner() + '-Moduledefinition' AND co.UID_ModulePredecessor = y.AddOnOwner+ '-Moduledefinition') AS z49 ORDER BY z.EntryKey,50 z.OwnerOfTranslationAndAddonDiffers DESC,51 AddOnIsDBOwnersPredecessor ASC,52 z.AddOnSortorder DESC,53 z.AddOnOwner,54 z.TranslationOwner55 IF @Module > ' '56 BEGIN57 IF @debugSwitch > 058 BEGIN59 print @module print @entrykey60 END61 DELETE QBMTranslationAddOnSource62 WHERE63 EntryKey = @EntryKey AND dbo.QBM_FCVGUIDToModuleOwner(UID_QBMTranslationAddOnSource) = @Module64 END65 ELSE66 BEGIN67 SELECT @lauf = 068 END69 END70 END TRY71 BEGIN CATCH72 EXEC QBM_PSessionErrorAdd DEFAULT73 DECLARE @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow()74 RAISERROR(@Rethrow,75 18,76 1)77 WITH NOWAIT78 END CATCH79 ende:80 RETURN81END
Open raw exported source
1 create procedure QBM_PQBMTranslationAddOnClean as begin declare @DebugSwitch int = 0 declare @lauf int = 1 declare @Module varchar(3) declare2 @EntryKey nvarchar(1024) SET XACT_ABORT OFF BEGIN TRY while @lauf > 0 begin select @Module = null select top 1 @Module = z.AddOnOwner , @EntryKey = z.EntryKey3 from ( select md.SortOrder as AddOnSortorder , sign(len(isnull(co.UID_ModuleFollower, ''))) as AddOnIsDBOwnersPredecessor , sign(len(replace(y.AddOnOwner4, y.TranslationOwner, ''))) as OwnerOfTranslationAndAddonDiffers , y.* from ( select dbo.QBM_FCVGUIDToModuleOwner(s.UID_QBMTranslationAddOnSource) as 5AddOnOwner , isnull(m.ModuleOwner, 'ZZZ') as TranslationOwner , s.EntryKey from QBMTranslationAddOnSource s join ( select a.EntryKey from QBMTranslationAddOnSource6 a group by a.EntryKey having COUNT(*) > 1 ) as x on s.EntryKey = x.EntryKey left outer join ( select dbo.QBM_FCVGUIDToModuleOwner(m.UID_DialogMultiLanguage7) as ModuleOwner , m.EntryKey from DialogMultiLanguage m where m.UID_DialogColumn = 'QBM-7262717EE68049A9BE2EEB30C6EC408B' group by dbo.QBM_FCVGUIDToModuleOwner8(m.UID_DialogMultiLanguage) , m.EntryKey ) as m on m.EntryKey = s.EntryKey ) as y join QBMModuleDef md on y.AddOnOwner = md.ModuleName left outer join 9QBMModuleDependCollection co on co.UID_ModuleFollower = dbo.QBM_FGIDBOwner() + '-Moduledefinition' and co.UID_ModulePredecessor = y.AddOnOwner+ '-Moduledefinition'10 ) as z order by z.EntryKey, z.OwnerOfTranslationAndAddonDiffers desc, AddOnIsDBOwnersPredecessor asc, z.AddOnSortorder desc, z.AddOnOwner , z.TranslationOwner11 if @Module > ' ' begin if @debugSwitch > 0 begin print @module print @entrykey end DELETE QBMTranslationAddOnSource WHERE EntryKey = @EntryKey and dbo.QBM_FCVGUIDToModuleOwner12(UID_QBMTranslationAddOnSource) = @Module end else begin select @lauf = 0 end end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default declare @Rethrow13 varchar(1000) = dbo.QBM_FGISessionErrorRethrow() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH ende: return end 14