# 22. Virtuoso Functions Guide - ldap_modify

Chapter Contents | Prev | Next
Keyword Search:
www.openlinksw.com
docs.openlinksw.com
Book Home
Contents
Preface
Virtuoso Functions Guide
Administration
Aggregate Functions
Array Manipulation
BPEL APIs
Backup
Compression
Cursor
Date & Time Manipulation
Debug
Dictionary Manipulation
Encoding & Decoding
File Manipulation
Free Text
Hashing / Cryptographic
LDAP
ldap_add
ldap_delete
ldap_modify
ldap_search
Locale
Mail
Miscellaneous
Number
Remote SQL Data Source
Replication
SOAP
SQL
String
Transaction
Type Mapping
UDDI
User Defined Types & The CLR
Virtuoso Java PL API
Virtuoso Server Extension Interface (VSEI)
Web Server & Internet
XML
XPATH & XQUERY
Functions Index

## ldap_modify

Modifies an existing LDAP directory.
int ldap_modify (in server_url varchar, in try_tls integer, in data varchar, in username varchar, in password varchar);
Description

This function modifies an existing LDAP directory entry.

Parameters
server_url – The server URL has three parts, <protocol>://<host>:<port>. Missing parameters will be defaulted to: <ldap://localhost:389>.
try_tls – try_tls is a flag that tells the client to perform a handshake with the LDAP server using a secure connection. This is only applicable to the ldap:// protocol and not ldaps://.
data – data is an array with name/value pairs representing the data of the modified entry.
username – username authorization credential
password – password authorization credential
Return Types

The error status code is returned.

This function will return zero on success or non-zero in case of a failure. In case of a failure the signal will be raised according to SQL error codes and Virtuoso internal error codes.

The reserved prefix for internal errors is 'LD'.

Errors

SQLState | Error Code | Error Text | Description
--- | --- | --- | ---
2E000 | LD005 | Failed to initialize LDAP connection: <reason> (<reason code>) |
2E000 | LD006 | Failed to set LDAP version option: <reason> (<reason code>) |
2E000 | LD016 | Failed to start TLS: <reason> (<reason code>) |
28000 | LD007 | Failed to bind synchronous LDAP connection: <reason> (<reason code>) |
2E000 | LD004 | The DN must be supplied |
2E000 | LD004 | Failed to modify err=<reason code (<reason>) |

Examples

    create procedure
    sam_ldap_modify (in s1 varchar, in s2 varchar)
    {
      declare res, vec any;
      declare _from_modify integer;

      vec := vector ('dn', concat ('cn=', s1, ' ', s2, ',o=opl,c=BG'), 'mail',
        vector('new_mail@techno-link.com'), 'telephoneNumber',
        vector('123-45-00', '032-633710', '048 850 760') );

      _from_modify := ldap_modify ('ldap://localhost:389', 0, vec, NULL);

      return (_from_modify);
    };

See Also

ldap_add(), ldap_delete(), ldap_search()