Previous Topic: RDN Function--Retrieve First Component of LDAP DN

Next Topic: RIGHT Function--Retrieve Characters from a String

RELATIONDN Function--Compare Two Distinguished Names

The RELATIONDN function compares the two specified LDAP distinguished names (DNs) and returns a string indicating the relationship between them.

If either of the two DNs is invalid, or the two DNs are completely unrelated, a blank string is returned.

If the two DNs are related, the difference in levels (of the Directory Information Tree) is returned as a string. If the first DN is the ancestor of the second, the number is positive. If the first DN is a descendent of the second, the number is negative. If the two DNs are equal or siblings, the return is 0 (indicating no levels).

Note: This function does not call any LDAP server functions.

Syntax

The RELATIONDN function has the following format:

RELATIONDN(dn_1, dn_2)

Parameters

The RELATIONDN function accepts the following parameters:

dn_1 (string)

dn_2 (string)

Return Value

The RELATIONDN function returns a string.

Remarks

LDAP Only: Yes

Example

Return_value=RELATIONDN("uid=eric,o=NDS.com", "o=NDS.com")
Return_value="-1"

Return_value=RELATIONDN("o=NDS.com", "uid=eric,o=NDS.com")
Return_value="1"

Return_value=RELATIONDN("uid=dave,o=NDS.com", "uid=eric,o=NDS.com")
Return_value="0"

Return_value=RELATIONDN("uid=dave,o=XYZ.com", "uid=eric,o=NDS.com")
Return_value=""

More information:

COMMONDN Function--Find a Common Root

EXPLODEDN Function--Convert LDAP DN to Set

PARENTDN Function--Retrieve Parent in LDAP Tree

RDN Function--Retrieve First Component of LDAP DN


Copyright © 2010 CA. All rights reserved. Email CA about this topic