[turba] no incremental id or timestamp. How can I get first 10 or last 10 records

Atif Ghaffar aghaffar@developer.ch
Mon, 23 Apr 2001 23:31:20 +0200


Jon Parise wrote:
> > Our customer is asking for a feature (maybe others will ask for it to=
o).
> > When someone opens the contacts window, the last n records are
> > displayed.
> =

> Just curious: What is their reasoning?

As always, no clue.


> > so getting last 10 entries would be simply 'order by lastModifed DESC=
'
> > and 'limit 10'
> =

> That's SQL specific, of course.  I don't recall whether LDAP has
> an inherent notion of a "last modified" time for a given
> attribute.  It might also require an additional field in the
> schema.

In ldap (atleast with openldap) you can use lastmod on | off
here is the excerpt from slapd.conf manpage

lastmod on | off
Controls  whether slapd will automatically maintain
the modifiersName,  modifyTimestamp,  creatorsName,
and  createTimestamp  attributes  for  entries.  By
default, lastmod is off. 

you can then use this attribute to sort the result.
ldapsearch -S modifytimestamp var=val




-- 
Atif Ghaffar
Internet Development Manager
4unet AG/SA/Ltd.
-------------------------.
        +41 21 351 53 60 ¦ voice
        +41 78 787 51 45 ¦ mobile
        +41 86 0796598972¦ fax
    http://www.4unet.net ¦ www
http://atif.developer.ch ¦ homepage
  atif.ghaffar@4unet.net ¦ email