[OJB-developers] Select count(x)
Brought to you by:
thma
From: Charles A. <cha...@hp...> - 2001-11-02 10:26:14
|
Hello once more, Is it possible to do a count() in an OQL expression ? Or rather, is it possible to do a count() in OJB's implementation of OQL ? As far as I can see, it isn't possible at the moment. Basically, I'm trying to give an end user the ability to do a flexible search that could return many hundred of rows; I need to be able to page the results. I can get 'blocks' of objects quite simply (by skipping the first n objects returned in a query) - but what I need to be able to do is to work out how many blocks of results there are for the results of a query (but without iterating the entire results), in order to display a paging-thing to the enduser (A'la Google). I'm sure this is a common requirement; I can think of other places where count(n) would be useful, as well as max(), min() etc. I can also see that putting functions into the OQL parser/query code could be quite tricky, too. Is there any workaround anyone can think of ? I'm sort of toying with the idea of creating a class that would create the select count(*) from x where xxx statement from the OQL query.... Cheers, Charles. This email and any attachments are strictly confidential and are intended solely for the addressee. If you are not the intended recipient you must not disclose, forward, copy or take any action in reliance on this message or its attachments. If you have received this email in error please notify the sender as soon as possible and delete it from your computer systems. Any views or opinions presented are solely those of the author and do not necessarily reflect those of HPD Software Limited or its affiliates. At present the integrity of email across the internet cannot be guaranteed and messages sent via this medium are potentially at risk. All liability is excluded to the extent permitted by law for any claims arising as a re- sult of the use of this medium to transmit information by or to HPD Software Limited or its affiliates. |