Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to combine 2 LDAP queries

Status
Not open for further replies.

Morbeas

MIS
Jun 24, 2009
2
0
0
US
Hey guys, I have these two queries I'd like to combine into one. Is there any way of doing it?

Query 1: (&(!cn=SystemMailbox{*})(&(&(ou>="")(name=executive*)(objectCategory=organizationalUnit)(ou=*operations))))

Query 2: (&(!cn=SystemMailbox{*})(&(ou>="")(name=50*)))

Thanks in advance.
 
[0] The logic is the following. The rfc1960 defines the grammar of the string search filter: here keeping the relevant parts.
[tt]
[R1] <filter> ::= '(' <filtercomp> ')'
[R2] <filtercomp> ::= <and> | <or> | etc ...
[R3] <and> ::= '&' <filterlist>
[R4] <or> ::= '|' <filterlist>
[R5] etc...
[R6] <filterlist> ::= <filter> | <filter> <filterlist>
[R7-R19] etc...
[/tt]
[1] The existing filters (query 1 and query 2) symbolically shown can be combined using R1,R2,R3 and R6.
[tt]
filter_1 -> (filtercomp_1)
filter_2 -> (filtercomp_2)
filter_combined -> (&(filtercomp_1)(filtercomp_2))
[/tt]
[1.1] where it is observed that R6 effective mean a filterlist can be concatination of filters.
[tt]
<filterlist> ::= <filter> | <filter><filter> | <filter><filter><filter> | ...
[/tt]
and in [1], it uses the case of the second case on the right-hand side.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top