Update Statement Examples

 

Query

Results of Query

 

UPDATE uid=test555102test222,

uid=1062test444,cn=users,cn=test,cn=testuser,

DC= LDAPSOFT , DC =COM SET 

cn='test',

sn='test',

uid='test555102test222'

basescope

 

cn,sn and uid of the entry uid=test555102test222,uid=1062test444,

cn=users,cn=test,cn=testuser,DC= LDAPSOFT , DC =COM is updated

UPDATE DC= LDAPSOFT , DC =COMSET 

businesscategory='services'

onelevelscope

businesscategory attribute of all the immediate children of DC= LDAPSOFT , DC =COM is updated

UPDATE DC= LDAPSOFT , DC =COMSET 

businesscategory='services'

subtreescope

 

businesscategory attribute of all the subentries within DC= LDAPSOFT , DC =COM is updated

 

More Update Statement Examples (Using Not Operator)

 

Query

Reasons

 

Update ou=MemberGroupA,o=stooges set postalCode= '60660' where mail != 'test@test.com' and sn!='test'

 

Update postal code of all entries in and including ou=MemberGroupA,o=stooges where mail not equal to 'test@test.com' and sn not equals to 'test' to 60660

Update ou=MemberGroupA,o=stooges set postalCode= '60660' where mail != 'test@test.com'

Update postal code of all entries in and including ou=MemberGroupA,o=stooges where mail not equal to 'test@test.com' to 60660

 

Update An Attribute with Time

 

Query

Reasons

Update cn=Larry Fine1,ou=MemberGroupA,o=stooges set homePhone=temp , description=CurrentTimestamp


Update cn=Larry Fine1,ou=MemberGroupA,o=stooges set homePhone=temp , description= CurrentTimestamp -2 months


Update cn=Larry Fine1,ou=MemberGroupA,o=stooges set homePhone=temp , description= CurrentTimestamp -7 days


Update cn=Larry Fine1,ou=MemberGroupA,o=stooges set homePhone=temp , description= CurrentTimestamp -1 years


Update cn=Larry Fine1,ou=MemberGroupA,o=stooges set homePhone=temp , description= CurrentTimestamp -1 hours


Update cn=Larry Fine1,ou=MemberGroupA,o=stooges set homePhone=temp , description= CurrentTimestamp -1 minutes


Update cn=Larry Fine1,ou=MemberGroupA,o=stooges set homePhone=temp , description= CurrentTimestamp -1 seconds

To update an attribute with current time stamp or current time stamp (-)(+) days|months|years|hours|minutes|seconds (Attribute must be of type time or you will get an error)

 

Related Links:

Update statement Examples

Select statement

Select statement Exampes

Insert statement

Delete statement examples

 


Ldapsoft Home page LDAP Admin Tool Home Page