dbo.QER_FTPwoValidDateRanges
SQL_TABLE_VALUED_FUNCTION
Created 2026-04-14T23:17:27.317 · modified 2026-04-14T23:17:27.317 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
@UID_PersonOrdered | varchar | no |
@UID_ITShopOrgPR | varchar | no |
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| BaseTreeHasObject | OBJECT_OR_COLUMN | ||
| PersonWantsOrg | OBJECT_OR_COLUMN | ||
| QBM_YDateTimePair | TYPE | ||
| dbo | QBM_FCVDatetimeToDatetimeEve | OBJECT_OR_COLUMN | |
| dbo | QBM_FCVStringToInt | OBJECT_OR_COLUMN | |
| dbo | QBM_FGIConfigparmValue | OBJECT_OR_COLUMN | |
| dbo | QBM_FTDateTimeGaps | OBJECT_OR_COLUMN | |
| dbo | QER_FGIBitPatternInheritInfo | OBJECT_OR_COLUMN |
Source excerpt
First extracted SQL definition lines from the exported source. Use the full source page for complete context.
1create function dbo.QER_FTPwoValidDateRanges(@UID_PersonOrdered varchar(38) , @UID_ITShopOrgPR varchar(38) ) returns @erg table(FromDatetime datetime 2 , UntilDatetime datetime ) as begin declare @heute datetime = getutcdate() declare @ObjectKeyAnPR varchar(138) declare @QER_BitPatternInheritInfo int 3= dbo.QER_FGIBitPatternInheritInfo('|Direct|', 0) declare @ist QBM_YDateTimePair declare @GapDefinition int = 0 select @GapDefinition = dbo.QBM_FCVStringToInt 4(dbo.QBM_FGIConfigparmValue('QER\ITShop\GapBehavior\GapDefinition'), 0) select top 1 @ObjectKeyAnPR = bho.ObjectKey from BaseTreeHasObject bho where bho.UID_Org 5 = @UID_ITShopOrgPR and bho.InheritInfo = @QER_BitPatternInheritInfo insert into @ist (FromDate , ToDate) select case when isnull(pwo.ValidFrom, '1899-12-30' 6) < @heute then @heute else pwo.ValidFrom end , dbo.QBM_FCVDatetimeToDatetimeEve(isnull(pwo.ValidUntil, '2200-01-01')) from PersonWantsOrg pwo join BaseTreeHasObject 7 bho on pwo.UID_Org = bho.UID_Org and bho.InheritInfo = @QER_BitPatternInheritInfo where bho.ObjectKey = @ObjectKeyAnPR and pwo.UID_PersonOrdered = @UID_PersonOrdered 8 and (pwo.Orderstate in ('Assigned', 'Granted', 'New', 'OrderProduct', 'OrderProlongate', 'OrderUnsubscribe', 'Waiting') and @GapDefinition = 0 9 or pwo.OrderState in ('Assigned', 'Granted', 'OrderProlongate', 'OrderUnsubscribe', 'Waiting') and @GapDefinition = 1 or pwo.OrderState in ('Assigned' 10, 'OrderProlongate', 'OrderUnsubscribe' ) and @GapDefinition = 2 ) insert into @erg(FromDatetime, UntilDatetime) select g.GapStart, g.GapEnd from dbo.QBM_FTDateTimeGaps 11(@ist) g endLabel: return end 12
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.317
None extracted.
Summary: writes INSERT into; reads/joins BaseTreeHasObject, PersonWantsOrg, QBM_FTDateTimeGaps; uses config QER\ITShop\GapBehavior\GapDefinition
Declared parameters
| Parameter | Type | Direction |
|---|---|---|
@UID_PersonOrdered | varchar(38) | input |
@UID_ITShopOrgPR | varchar(38) | input |
DML targets
INSERT intoCalled routines
None extracted.
Read/join references
SQL dependency metadata
Config/session
Config: QER\ITShop\GapBehavior\GapDefinition
Session: None extracted.
DBQueue/tasks
None extracted.Temp tables / referenced variables
Temp: None extracted.
Variables: @UID_PersonOrdered @UID_ITShopOrgPR @erg @heute @ObjectKeyAnPR @QER_BitPatternInheritInfo @ist @GapDefinition
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.