Re: Finding length of a result set

2006-02-01 Thread Bernt M. Johnsen
I apologize for this mail. At last I have learned (once again) to read the whole mail before I answr. At least Craig sent a decent replay. Thanks Craig. Sorry John. Bernt M. Johnsen wrote (2006-01-31 09:56:34): I would suggest you use the SQL COUNT() function (in the same transaction). E.g.

Re: Finding length of a result set

2006-01-31 Thread Bernt M. Johnsen
I would suggest you use the SQL COUNT() function (in the same transaction). E.g. stat = con.prepareQuery(select * from myView where username='foo') count_stat = con.prepareQuery(select count(*) from myView where username='foo'); ResultSet count_res = stat2.executeQuery();

Re: Finding length of a result set

2006-01-31 Thread Craig L Russell
Hi John, This is a common problem for which there is no good, satisfying solution. If you want an exact answer, you have to run the query to count the results. So it's no surprise to me that running COUNT() with the query takes as long as running the query that returns the results you

Finding length of a result set

2006-01-30 Thread John English
I have a method in a J2EE application which displays the result of a query in a standardised tabular format. The output is presented in pages of 20 results at a time, so I need to know how many rows there are to find the number of pages, and to seek to the start of the correct page. This all