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

Re: Back-sql+mysql



>Note: inetOrgPerson scheme requires a value for 'cn' and 'sn'. Because we 
>have some contacts that only have values in "Company", 

Why not just make those "OrganizationUnit" objects?  And not 
inetOrgPerson?  Thats 'more' true.

>my real 'cn' sel_expr is:
>MySQL:
>IF(Length(LastName)>0,IF(Length(FirstName)>0,IF(Length(MInitial)>0,CONCAT(FirstName, ' ', MInitial, ' ', LastName),CONCAT(FirstName, ' ', LastName)),LastName),IF(Length(FirstName)>0,FirstName,Company))
>PostgreSQL (shortned due to varchar(255) length):
>CASE WHEN Length(lastname)>0 THEN CASE WHEN Length(firstname)>0 THEN CASE WHEN Length(minitial)>0 THEN firstname||' '||minitial||' '||lastname ELSE firstname||' '||lastname END ELSE lastname END ELSE company END
>and my real 'sn' sel_expr is:
>MySQL:
>IF(Length(LastName)>0,LastName,IF(Length(FirstName)>0,FirstName,Company))
>PostgreSQL:
>CASE WHEN Length(lastname)>0 THEN lastname ELSE company END
>where do i have to put that? 

Create a view that realizes this view of the data and map OpenLDAP to 
query the view.

>I created the tables contacts and orgunit and the values that the manual
>says in the tables ldap_oc_mappings and ldap_attr_mappings.

If you don't already have existing database applications why not just use 
"real" LDAP?