[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: replacing just one value of a multivalue attribute



Jason,

1.  Please send all support requests to openldap-software@openldap.org.
2.  You can not update a single value of an attribute in LDAP the way
you would in an RDBMS.  The where clause is used to find the entry to
apply the modify operation on.  What you would need to do is delete
and then add the value :

UPDATE ENTRY cn=Me,dc=domain,dc=com DO DELETE SET attrib='oldval' DO
ADD SET attrib='newval' WHERE attrib='oldval'

Marc



On 8/3/05, Jason Millard <jsm174@verizon.net> wrote:
>  
> Marc, 
>   
> Hello. I am extremely sorry to write you directly, 
> as I probably should have gone directly to the 
> posts. 
>   
> Using JDBCLDAP, is possible to update just 
> one value inside of a multivalue attribute. 
>   
> For example, 
>   
>  
> apps_0='MSRP' 
> apps_1='MHCT' 
> apps_2='MSCP' 
>   
> UPDATE ENTRY CN=x,OU=People,DC=ms,DC=com DO REPLACE SET apps='MHCP' WHERE
> apps='MSCP' 
>   
> apps_0='MSRP' 
> apps_1='MHCT' 
> apps_2='MSCP' 
>   
> I've tried all kinds of possible combinations, 
> including the connect string props, EXP_ROWS, 
> CONCAT_ATTRS 
>   
> The only way I can think of accomplishing this 
> is by doing a SELECT, finding the exists apps, 
> then running through the result set, than doing a 
> DO DELETE SET apps followed by the correct 
> DO ADD SET apps='' (since apps can be in any 
> order) 
>   
> I've built all the newer code from CVS figuring 
> maybe some changes were laying around. 
>   
> Anyway, I would also like to say thanks for such 
> a great piece of software. I use it all the time. 
>   
> -- Jason