August 30th, 2004, 11:40 AM
LDAP Query to retreive Max ID
I have an ou Company which has attribute company id (sequential number). Is there any way to do query LDAP to find out max id.
Thanks in advance for your help.
August 30th, 2004, 01:05 PM
I could be wrong but I don't think there is within LDAP. For something like this the best way would be to loop though all the records and get the max from it. Of course if you have a ton of entries this is in effienct and for that I'd recomend just having a attribute in the top level directory with the max in it and everytime you add a new entry just increment it by 1.
August 31st, 2004, 04:44 AM
According to Viper_SB there is none. The only way to get the max. value ist to use a 3rd party programming language (PHP, perl, C etc...).
The LDAP search filter are defined in RFC 2254; the basic useable operators are these: