XQuery is it possible to have multi-result in a samex query

Hi,

To explain my problem, I will show two queries of XQuery:

declare namespace tf=‘http://namespaces.softwareag.com/tamino/TaminoFunction
(for $Person in input()/Person
where (tf:containsText($Person/Name ,‘for’))
return $Person/Name)
[position() > 0 and position() <= 1000]
–> this query shows only the first 1000 names.

declare namespace tf=‘http://namespaces.softwareag.com/tamino/TaminoFunction
count(for $Person in input()/Person where (tf:containsText($Person/Name ,‘for’)) return $Person/Name)
–> this query shows 2500 rows like result.

I would like to do only one query where I can have the number of total results (2500 results) and the first 1000 Names.

Is someone know if it is possible to do this in the same query with Xquery?

Thank you very much for your help!

C

declare namespace tf=‘http://namespaces.softwareag.com/tamino/TaminoFunction
let $persons:=(for $Person in input()/Person
where (tf:containsText($Person/Name ,‘for’))
return $Person/Name)
return
(count($persons),
$persons [position() > 0 and position() <= 1000])

Hi Dr. Harald Schoening,

In the query it missed {…} between {count($persons)} to have the result of count function.
The query gives the result that I want!

Thank you for your help! :lol:

C

Sorry for forgetting the {}, I am glad you worked this out.

Regards

Harald