Update Statement

 

The UPDATE statement modifies attributes for the selected entries. The basic Update statement has 4 clauses:

 

The UPDATE clause specifies the entry(ies) to update. The SET clause specifies the attributes to update. The WHERE clause specifies the condition. The WHERE clause is optional; if missing, all the entries within the container will be updated depending upon the query scope. The QUERY SCOPE is new for ldap query, if missing the default is subtree scope and will return all the subentries (you can change the default from the radio buttons at the bottom of sql editor). Update statement has the following general format

 

UPDATE Entry SET set-list [WHERE predicate] [QuerryScope]

 

To update all the entries within an entry (including entry and all its subentries) you type sql statement as:

UPDATE cn=testuser,DC=LDAPSOFT,DC=COM SET title='Manager'

This sql will update all the entries in the cn=testuser,DC=LDAPSOFT,DC=COMcontainer as the default scope is subtree scope,  the above update statement is same as :

UPDATE cn=testuser,DC=LDAPSOFT,DC=COM SET title='Manager' subtreescope

 

To update only the immediate children you type sql statement as:

UPDATE cn=testuser,DC=LDAPSOFT,DC=COM SET title='Manager' onelevelscope

 

To update the entry only you type sql statement as:

UPDATE cn=testuser,DC=LDAPSOFT,DC=COM SET title='Manager' basescope

 

 

Note:  You don't have to provide the scope (subtreescope ,onelevelscope or basescope) in the sql statement. You can select it from the radio button at the bottom of the editor window

 

 

 

If the sql statement contains the scope it will take precedence over the scope selected using the radio buttons

 

You can also generate the simple type of sql update statement from the popup menu

 

 

Update Statement Confirmation Dialog

 

When you execute an update statement a status dialog appears which provides you with the following information

 

 

 

The Update Status dialog also gives you the ability to skip all errors or abort the operation after a error.

 

 

 

Related Links:

Update statement examples

Difference b/w Update, UpdateAll and UpdateReplace

UpdateAdd statement

UpdateReplace statement

 

 

 


Ldapsoft Home page Ldap plus AD Help Desk Professional Tool Home Page