Back to OIM Explorer

dbo.QER_FTDelegationPossibleTo

Inline Table FunctionSQL_INLINE_TABLE_VALUED_FUNCTIONSandbox DB

Inline Table Function.

Source: sandbox-db sys.sql_modules

Source size: 823 characters

Interpretation

  • Database function. Usually supports views, validation, or calculated predicates; look at referenced-by entries for callers.

Relations

  • No extracted relations.

Typed Edges

  • No typed edges extracted for this source.

References

  • No direct source references extracted.

Referenced By

  • No direct source references extracted.

Complete Source

SQL25 lines
1CREATE FUNCTION dbo.QER_FTDelegationPossibleTo(2  @UID_PersonSender varchar(38),3  @UID_personReceiver varchar(38)4) RETURNS TABLE5AS6RETURN(7SELECT di.*8FROM DelegableItem di9WHERE10  di.UID_Person = @UID_PersonSender AND NOT EXISTS(11SELECT TOP 1 112FROM PersonInBasetree hha13WHERE14  hha.UID_Person = @UID_personReceiver AND hha.UID_Org = di.UID_Org AND di.Criteria = 'Membership' AND hha.XOrigin & 0xFFFFFFFC > 0) AND NOT15EXISTS(16SELECT TOP 1 117FROM HelperHeadPerson hha18WHERE19  hha.UID_PersonHead = @UID_personReceiver AND hha.UID_Person = di.UID_Org AND di.Criteria = 'HeadPerson' AND hha.XOrigin & 0xFFFFFFFC > 020) AND NOT EXISTS(21SELECT TOP 1 122FROM HelperHeadOrg hha23WHERE24  hha.UID_PersonHead = @UID_personReceiver AND hha.UID_Org = di.UID_Org AND di.Criteria = 'HeadStructure' AND hha.XOrigin & 0xFFFFFFFC > 025))
Open raw exported source
SQL ยท Raw7 lines
1create function dbo.QER_FTDelegationPossibleTo (@UID_PersonSender varchar(38) , @UID_personReceiver varchar(38) ) returns table as return( select di.* 2from DelegableItem di where di.UID_Person = @UID_PersonSender and Not exists( select top 1 1 from PersonInBasetree hha where hha.UID_Person = @UID_personReceiver3 and hha.UID_Org = di.UID_Org and di.Criteria = 'Membership' and hha.XOrigin & 0xFFFFFFFC > 0 ) and Not exists( select top 1 1 from HelperHeadPerson hha4 where hha.UID_PersonHead = @UID_personReceiver and hha.UID_Person = di.UID_Org and di.Criteria = 'HeadPerson' and hha.XOrigin & 0xFFFFFFFC > 0 ) and Not5 exists( select top 1 1 from HelperHeadOrg hha where hha.UID_PersonHead = @UID_personReceiver and hha.UID_Org = di.UID_Org and di.Criteria = 'HeadStructure'6 and hha.XOrigin & 0xFFFFFFFC > 0 ) ) 7