[xquery-talk] paging mechanism

Peter Mueller Peter.Mueller10 at gmx.de
Fri Feb 3 17:04:03 PST 2006


Dear Philippe and David,

thank you very much! The following queries did exactly what I expected:

PROBLEM 1:

(for $x in /col/text/body 
order by fn:number($x/idno) 
return 
$x/idno)
[position() mod 50 < 2]


PROBLEM 2: 
this one I adopted slightly (because I only need one "chunk" of 50 at the
time)

declare variable $startIndex as xs:integer := 1;
declare variable $pageSize as xs:integer := 50;
let $sorted :=
  for $x in //text/body
  order by xs:decimal($x/idno) 
  return $x/idno
return 
  fn:subsequence($sorted , $startIndex, $pageSize)

Now I hope to make it work inside the native XML database eXist as well! ;-)

Best wishes and thanks again,
Peter

-- 
Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko!
Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner


More information about the talk mailing list