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

Re: modify question



No. employeeNumber is defined SINGLE-VALUEd. You cannot have more than one for each entry. Take a look at inetorgperson.schema.
No need to delete and add, simply replace.


Maharajan, Suthakar (Suthakar) % wrote:

I think you should fist delete the employeeNumber which you want to modify
and then add it. It would be like this...

dn:<the complete dn>
changetype: delete
delete: employeeNumber
employeeNumber:12345678
-
add: employeeNumber
employeeNumber: 87654321

Hope it helps for you.

Thanks,
Suthakar

-----Original Message-----
From: Susan Aurand [mailto:saurand@haywood.k12.nc.us]
Sent: Friday, August 08, 2003 3:36 PM
To: openldap-software
Subject: modify question


In my ldap database I have employeeNumber: 12345 I want to modify the first employee number and add an additional employee example: employeeNumber: 12345678 employeeNumber: 103

This is my code:

print O "dn: uid=".$uid.",ou=People,dc=xx,dc=xx\n";
print O "changetype: modify\n";
print O "replace: employeeNumber\n";
print O "employeeNumber: 12345678\n";
print O "employeeNumber: 103\n";
print O "\n";

I receive an error message: ldap_modify: contraint violation
 additionalinfo: employeeNumber: multiple value provided

So, I tried:

print O "dn: uid=".$uid.",ou=People,dc=xx,dc=xx\n";
print O "changetype: add\n";
print O "add: employeeNumber\n";
print O "employeeNumber: 103\n";
print O "\n";

I receive an error message:Type or Value exist
                                       additional info: modify : add values
failed

When I am adding a new record for the first time, I can add two values. Why
can't I modify a record
and add an additional
value? What I am I doing wrong. I help would be appreciated.
Thanks You
Susan Aurand-Evans