Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.
#Automation
HiI need to implement an XQuery which will return a subset of the whole data. in sql it would look like:select * from table LIMIT 5;how can this be done via XQuery (or the Java API)?CheersBrian
Hello Brian,I do not know the LIMIT expression.Maybe you mean not getting the completeresult sequence of a query but only a definednumber of items. This can be achieved by a cursor. In the Java API this is doneby an XQuery method with an additionalparameter:TResponse xquery(TXQuery xquery,int quantity)or by appending the following filter to a query(for $i in input()/ADoctypereturn $i)[position() > 10 and position() < 20 ]Is that what you mean?Walter
Hi WalterThanks for the info. That seems to help a lot. I am facing a further problem now when trying to sort the data. I am trying to run the following query, but tamino seems to crash when trying to run it. what is the prob?declare namespace tf=“http://namespaces.softwareag.com/tamino/TaminoFunction”{ ( for $l in input()/schedule/locality/locality_name where $l/…/…/island = ‘island’ and ( tf:containsText($l, “") or tf:containsText($l, "”) or tf:containsText($l, tf:phonetic(“k”)) ) return {$l/text()} { $l/…/pre/name } sort by (locality) ) [position() >= 1 and position() < 11 ]}