Hi,
I’m looking a little bit more on the best way to get the number of documents returned by a certain xquery expression using the new Java API.
When I have 10.000 documents which are the result of a certain xquery expression, and I specified that the data is retuned in blocks of 8 documents. I use this inside a local transaction.
Instead of reading all the data to know the number of documents, I like to have this count in the response of the first data block. I’ve dumped the document returned from Tamino server, but this data isn’t inside the ino:response.
Dump document :
---------------
<?xml version="1.0"?>
<ino:response ino:sessionid=“13” ino:sessionkey=“29534” xmlns:ino=“http://namespaces.softwareag.com/tamino/response2” xmlns:xql=“XQL FAQ (XML Query Language - Frequently Asked Questions)”>xql:query/DAO</xql:query>
<ino:message ino:returnvalue=“0”>ino:messagelinefetching cursor</ino:messageline></ino:message>
xql:result
value_namevalue_addressvalue_zipvalue_cityvalue_namevalue_addressvalue_zipvalue_cityvalue_namevalue_addressvalue_zipvalue_cityvalue_namevalue_addressvalue_zipvalue_cityvalue_namevalue_addressvalue_zipvalue_cityvalue_namevalue_addressvalue_zipvalue_cityvalue_namevalue_addressvalue_zipvalue_cityvalue_namevalue_addressvalue_zipvalue_city
</xql:result>
<ino:cursor ino:handle=“1”><ino:current ino:position=“1” ino:quantity=“8”/><ino:next ino:position=“9”/></ino:cursor>
<ino:message ino:returnvalue=“0”>ino:messagelinecursor fetched</ino:messageline></ino:message>
</ino:response>
It seems that in the HTTP Client API this data is returned, because when you execute a xquery expression in the interactive interface, then ‘result size’ number of documents are returned, but also the total number of documents found for the query.
Is there realy no other way then executing a COUNT expression to get the number of documents to be returned as result of xquery expression instead of reading all the documents first?
#webMethods-Tamino-XML-Server-APIs#webMethods#API-Management