LDAP-SQL and multi-valued attributes

General Discussion about LDAP Administrator

Moderator: Support

LDAP-SQL and multi-valued attributes

Postby leetch77 » Tue Jul 07, 2015 5:19 pm

I've run into some issues with using LDAP-SQL to search and manipulate multi-valued attributes and was hoping to get some guidance here.

Use case #1
I want to search all values of an attribute for a particular string:

select $ou from "ou=orgChart,erglobalid=00000000000000000000,ou=CFC,ou=tim,ou=idb2b,ou=applications,o=cinfin" where POSITION('ou=idb2b' IN $eradministrator);

The problem with this is that it just searches the first value of the attribute. If values 2-n have the string I'm looking for, my search doesn't find it.

Use case #2

I want to search all values of an attribute for a particular string and update just the values that match my search and leave the other attribute values in place:

UPDATE "ou=orgChart,erglobalid=00000000000000000000,ou=CFC,ou=tim,ou=idb2b,ou=applications,o=cinfin"
SET $eradministrator=SUBSTRING($eradministrator FROM 1 FOR POSITION('ou=id' IN $eradministrator)-1) || 'ou=idB2B' ||
SUBSTRING($eradministrator FROM POSITION('ou=idb2b' IN $eradministrator) + CHARACTER_LENGTH('ou=idb2b'))
WHERE EXISTS $eradministrator AND POSITION('ou=idb2b' IN $eradministrator) > 0;

The problem with this UPDATE SET is that it updates the attribute value it found, but drops all the others. In this case, I'm left with a single-value attribute and lost the other data. Obviously, this isn't good.

Any ideas?
leetch77
 
Posts: 6
Joined: Mon Sep 10, 2012 8:47 pm

Re: LDAP-SQL and multi-valued attributes

Postby Support » Thu Jul 09, 2015 1:01 pm

Hello.

The first use case was a bug and the fix will be available in a couple days. The second use case is as designed. Now we can't make workaround on this issue to make it work as you ask.
Support
 
Posts: 886
Joined: Sun Aug 12, 2001 12:00 am

Re: LDAP-SQL and multi-valued attributes

Postby leetch77 » Fri Jul 10, 2015 2:26 pm

Thanks for the update.

Is there a way to manipulate separate values in an attribute using the LDAP-SQL interface? I couldn't quite figure that part out.
leetch77
 
Posts: 6
Joined: Mon Sep 10, 2012 8:47 pm

Re: LDAP-SQL and multi-valued attributes

Postby Support » Fri Jul 17, 2015 12:29 pm

Yo can add new attribute values to the existing or delete a specific one.
Code: Select all
UPDATE "DC=company,DC=com"
DELETE $phoneNumber='+31235530005'
WHERE $objectClass='user' AND $objectCategory='Person'
    AND $roomNumber=45;
Support
 
Posts: 886
Joined: Sun Aug 12, 2001 12:00 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron