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

Re: Subclassing inetOrgPerson



>
> For our special situation I needed to have separate attributes for a
> given contacts multiple email addresses.  So I subclassed inetOrgPerson
> and added two new attributes, mail2 and mail3, identical to the mail
> attribute of inetOrgPerson.  If I do an ldapsearch like so
>
> ldapsearch -x -b 'ou=people,dc=neotool,dc=com'
> 'mail=mike.stockemer@neotool.com'
>
> The search is successfule and returns all attributes, even mail2 and
> mail3 for contacts who have this information.  If I do the same search
> with email2 I get an error :80 unknown error.
>
> Here is the query that is constructed:
>
> Constructed query: SELECT DISTINCT
> ldap_entries.id,contact1.accountno,'neoToolPerson' AS
> objectClass,ldap_entries.dn AS dn FROM ldap_entries,contact1,contsupp
> WHERE contact1.accountno=ldap_entries.keyval AND
> ldap_entries.oc_map_id=? AND upper(ldap_entries.dn) LIKE ? AND
> contsupp.rectype='P' and contsupp.contact='E-mail Address' and
> contact1.accountno = contsupp.accountno and contsupp.zip like '_0__'
> ORDER BY contsupref ASC AND (upper(TOP 1
> contsupref)='MIKE.STOCKEMER@NEOTOOL.COM') id: '1'
> (sub)dn: "%OU=PEOPLE,DC=NEOTOOL,DC=COM"
> backsql_oc_get_candidates(): error executing query
> Return code: -1
> Native error code: 156
> SQL engine state: 37000
> Message: [OpenLink][ODBC][SQL Server]Incorrect syntax near the keyword
> 'AND'. (156)
>
>
> Is my problem the ASC, where I am trying to order the results?

Just a guess: I think the ORDER BY followed by an AND
is not really legal.  It should go to the end of the
query, but I'm afraid there's no easy way to do that
in back-sql.  There should be a way to group that stuff
inside some brackets...

p.

-- 
Pierangelo Masarati
mailto:pierangelo.masarati@sys-net.it