How do I use the max() min() and sum() functions with the Ja

using xql I can do the following and get the max value for the DocID element.

_xql=max(/Document/DocID)
result in browser.
xql:result169034</xql:result>

What is the syntax from the Java layer. I tried the following, but no data is retreived. I know the query code is working because I can do other queries.
query(“max(/Document/DocID)”)

Your help is appreciated.

Andy

Hi Andy,

I think that the easiest way to get the result of a function is to use the method
getQueryContentAsString() of the TResponse object.

For example:

    // create tquery object from xml string
    TQuery query = TQuery.newInstance("max(/Document/DocID)");

    // Invoke the query operation and obtain the response
    response = accessor.query(query);

    System.out.println("Max: " + response.getQueryContentAsString());



Cheers,
Trevor.

Thank you, that make sense. I will give it a try.

Andy

Trevor,
It works great.

Thank you,

Andy