dbo.QER_FGIPWOSubMethodHasCycle
SQL_SCALAR_FUNCTION
Created 2025-06-27T17:59:26.977 · modified 2026-04-14T23:17:27.263 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
| nvarchar | yes |
@UID_PWODecisionSubMethod | varchar | no |
@UsePositiveSteps | bit | no |
@UseNegativeSteps | bit | no |
@UseEscalationSteps | bit | no |
@UseDirectSteps | bit | no |
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| PWODecisionStep | OBJECT_OR_COLUMN | ||
| QBM_YMNTable | TYPE | ||
| QBM_YSingleGUID | TYPE | ||
| dbo | QBM_FCVStringToListSplitted | OBJECT_OR_COLUMN |
Source excerpt
First extracted SQL definition lines from the exported source. Use the full source page for complete context.
1 create function dbo.QER_FGIPWOSubMethodHasCycle ( @UID_PWODecisionSubMethod varchar(38) , @UsePositiveSteps bit , @UseNegativeSteps bit , @UseEscalationSteps 2 bit , @UseDirectSteps bit ) returns nvarchar(1000) as begin declare @lauf int declare @DirectSteps nvarchar(1000) declare @FlowShell QBM_YMNTable declare 3 @DirectHelp QBM_YSingleGUID declare @erg nvarchar(1000) select @erg = '' if @UseDirectSteps = 1 begin insert into @DirectHelp (UID_SingleGuid , IntProperty 4 ) select s.UID_PWODecisionStep, a.ParameterName from PWODecisionStep s cross apply dbo.QBM_FCVStringToListSplitted(@DirectSteps, nchar(7), 0, 0 , N'=' 5) a where s.UID_PWODecisionSubMethod = @UID_PWODecisionSubMethod and s.DirectSteps > ' ' end if @UsePositiveSteps = 1 begin insert into @FlowShell(UID_Element1 6 , UID_Element2 ) select distinct s.UID_PWODecisionStep , n.UID_PWODecisionStep from pwodecisionstep s join pwodecisionstep n on s.UID_PWODecisionSubMethod 7 = @UID_PWODecisionSubMethod and n.UID_PWODecisionSubMethod = @UID_PWODecisionSubMethod and s.PositiveSteps <> 0 and s.UID_PWODecisionStep <> n.UID_PWODecisionStep 8 and s.levelnumber + s.PositiveSteps = n.levelnumber end if @UseNegativeSteps = 1 begin insert into @FlowShell(UID_Element1 , UID_Element2 ) select distinct 9 s.UID_PWODecisionStep , n.UID_PWODecisionStep from pwodecisionstep s join pwodecisionstep n on s.UID_PWODecisionSubMethod = @UID_PWODecisionSubMethod 10and n.UID_PWODecisionSubMethod = @UID_PWODecisionSubMethod and s.NegativeSteps <> 0 and s.UID_PWODecisionStep <> n.UID_PWODecisionStep and s.levelnumber 11 + s.NegativeSteps = n.levelnumber where not exists (select top 1 1 from @FlowShell e where e.UID_Element1 = s.UID_PWODecisionStep and e.UID_Element2 12 = n.UID_PWODecisionStep ) end if @UseEscalationSteps = 1 begin insert into @FlowShell(UID_Element1 , UID_Element2 ) select distinct s.UID_PWODecisionStep 13 , n.UID_PWODecisionStep from pwodecisionstep s join pwodecisionstep n on s.UID_PWODecisionSubMethod = @UID_PWODecisionSubMethod and n.UID_PWODecisionSubMethod 14 = @UID_PWODecisionSubMethod and s.EscalationSteps <> 0 and s.UID_PWODecisionStep <> n.UID_PWODecisionStep and s.levelnumber + s.EscalationSteps = n.levelnumber 15 where not exists (select top 1 1 from @FlowShell e where e.UID_Element1 = s.UID_PWODecisionStep and e.UID_Element2 = n.UID_PWODecisionStep ) end if 16@UseDirectSteps = 1 begin insert into @FlowShell(UID_Element1 , UID_Element2 ) select distinct s.UID_PWODecisionStep , n.UID_PWODecisionStep from pwodecisionstep 17 s join @DirectHelp h on s.uid_pwodecisionstep = h.UID_SingleGuid and s.UID_PWODecisionSubMethod = @UID_PWODecisionSubMethod and s.Directsteps > ' ' join 18 pwodecisionstep n on n.UID_PWODecisionSubMethod = @UID_PWODecisionSubMethod and s.UID_PWODecisionStep <> n.UID_PWODecisionStep and s.levelnumber + h.IntProperty 19 = n.levelnumber where not exists (select top 1 1 from @FlowShell e where e.UID_Element1 = s.UID_PWODecisionStep and e.UID_Element2 = n.UID_PWODecisionStep 20 ) end select @lauf = 1 while @lauf > 0 begin insert into @FlowShell(UID_Element1 , UID_Element2 ) select distinct s.UID_Element1 , n.UID_Element2 from 21 @FlowShell s join @FlowShell n on s.UID_Element2 = n.UID_Element1 where not exists (select top 1 1 from @FlowShell e where e.UID_Element1 = s.UID_Element1 22 and e.UID_Element2 = n.UID_Element2 ) select @lauf = @@rowcount end if exists(select top 1 1 from @FlowShell where UID_Element1 = UID_Element2 ) 23begin select top 1 @erg = fs.UID_Element1 from @FlowShell fs where fs.UID_Element1 = fs.UID_Element2 end ende: return(@erg) end 24
Module relation graph
Loading module relation graph…
Source-derived context
Generated from exported SQL module definitions plus read-only sandbox sys.objects/sys.parameters/sys.sql_expression_dependencies metadata. This is factual source evidence, not a semantic guess.
provenance: SQL definition export provenance: sandbox DB metadata modified: 2026-04-14T23:17:27.263
None extracted.
Summary: writes INSERT into; reads/joins PWODecisionStep, pwodecisionstep
Declared parameters
| Parameter | Type | Direction |
|---|---|---|
| nvarchar(1000) | OUTPUT |
@UID_PWODecisionSubMethod | varchar(38) | input |
@UsePositiveSteps | bit | input |
@UseNegativeSteps | bit | input |
@UseEscalationSteps | bit | input |
@UseDirectSteps | bit | input |
DML targets
INSERT intoCalled routines
None extracted.
Read/join references
SQL dependency metadata
Config/session
Config: None extracted.
Session: None extracted.
DBQueue/tasks
None extracted.Temp tables / referenced variables
Temp: None extracted.
Variables: @UID_PWODecisionSubMethod @UsePositiveSteps @UseNegativeSteps @UseEscalationSteps @UseDirectSteps @lauf @DirectSteps @FlowShell @DirectHelp @erg @rowcount
Referenced by / reverse dependencies
Generated from live DB metadata, FK rows, and exported SQL dependency/source extraction. This is factual linkage evidence, not inferred behavior.
No reverse dependencies extracted.