|  | 
 | ||||
|        | |||||
|  | ||||||
| Other Library Functions | ||||||
| function | ldap.reader | 
| Library: LDAP support (OMLDAP) Import: omldap.xmd | Return type: String Returns: The value of a specified attribute. | 
define external stream function ldap.reader
    of       value ldap.attribute attribute
    item     value integer        index      optional
    null     value string         null       optional
    using    value integer        datatype   optional
Argument definitions
This function returns the value of a specified attribute. If an index is not specified, it returns the first value, otherwise it returns the specified one.
The following example outputs the telephone number for each entry satisfying the search. Each entry is assumed to have a single telephone number.
  import "omldap.xmd" prefixed by ldap.
  
  process
     local ldap.connection my-ldap
     local ldap.attribute  my-entry variable
  
     set my-ldap to ldap.open 'www.stilo.com'
     ldap.search my-ldap
        base  "o=stilo.com"
        where  "(Department=RD)"
        into   my-entry
        select "phonenumber"
  
     repeat
        exit unless ldap.entry-exists my-entry
        output ldap.entry-name of my-entry || ": "
            || ldap.reader of my-entry{"phonenumber"}
            || "%n"
        ldap.advance-entry my-entry
     again
ldap.retrieve-values can be used when an attribute contains an unknown number of values.
Copyright © Stilo International plc, 1988-2008.