Expression "BETWEEN", "COUNT", "SORTBY"

Hello!

I need to search in my tamino database by specify “data_from” and “data_to”. I know that I should do it by using “between” expression. Unfortunately, I got error messages in Tamino Interactive Interface if records didn’t found.

Here are my queries:

1) with “between” and “sortby” expressions:

-----------------------------------------
DOC[OPERATION/DATE between “2002-06-10”, “2002-06-12”] sortby(OPERATION/DATE) - OK :slight_smile:
-----------------------------------------
DOC[OPERATION/DATE between “2002-06-11”, “2002-06-12”] sortby(OPERATION/DATE) - ERROR, INOXIE8306 :frowning:
-----------------------------------------
DOC[OPERATION/DATE=“2002-06-10”] - OK :slight_smile:
-----------------------------------------
DOC[OPERATION/DATE=“2002-06-11”] - ERROR, INOXIE8306 :frowning:
-----------------------------------------


2) with “count” and “sortby” expressions:
-----------------------------------------
count(/DOC) - OK
-----------------------------------------
count(/DOC[OPERATION/DATE between “2002-06-10”, “2002-06-12”]) sortby(OPERATION/DATE) - ERROR, INOXIE8379 :frowning:
-----------------------------------------
count(/DOC[OPERATION/DATE between “2002-06-11”, “2002-06-12”]) sortby(OPERATION/DATE) - ERROR, INOXIE8379 :frowning:
-----------------------------------------

How should I do to fix it?

Please help me.

best regards,
Dariusz Baumann


PS.

Documentation says:
-----------------------------------------
1)
ERROR INOXIE8306 means:
Invalid cursor position

Explanation
The supplied cursor position is invalid: there is no document in the cursor’s result set corresponding to the position. In particular, this error will be returned when positioning beyond the end of the cursor result set.

Action
Supply a correct cursor position.
-----------------------------------------

2)
ERROR INOXIE8379 means:
Internal error occurred during query processing: unknown request

Explanation
An internal error has occurred.

Action
Please contact your software supplier.
-----------------------------------------

Hi Dariusz,

If you have a query with that does not return any documents and you try and do this within a cursor then you will get the INOXIE8306. It is an information error to say the cursor set is invalid and the reason is that there are no results. Within TII if you blank out the field(s) for the cursoring and reperform the query you will get a 0 response with the message saying “XQL Request processed, no object returned”.

With regards to the count/sortby, the reason the queries are not working is that you are trying to count documents based upon some criteria which returns a count value, then sorting it based on OPERATION/DATE which is not valid in this context. So the correct syntax should be:

count((/DOC[OPERATION/DATE between “2002-06-10”, “2002-06-12”]) sortby(OPERATION/DATE))

or better/faster:

count((/DOC[OPERATION/DATE between “2002-06-10”, “2002-06-12”]))

since you are only interesting in counting and not the sorting.

Hope this helps.

Stuart Fyffe-Collins
Software AG (UK) Ltd.