Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: To know the number of results returned just after query ??

Re: To know the number of results returned just after query ??

From: Scott Mattes <ScottMattes_at_yahoo.com>
Date: Fri, 03 Aug 2001 13:50:33 GMT
Message-ID: <J_xa7.50$Xw3.139561@news1.news.adelphia.net>

While issuing a second 'count' query just after/before the real query will *probably* give you what you need *most* of the time, there is always that possibility that between the 2 someone else will issue a delete/insert/update that will cause the count/select to not match.

Going to the end of a result set, either by counting each returned row or jumping to the end and back, will bother your users to no end: don't do it, except for real small result sets.

You can add a count field to your result set, then each record will have the total number of rows selected, but you have to 'group by' all the fields in the select clause.

"Isma" <Isma_at_iballo.com> wrote in message news:3B6958BF.1B0AFF3F_at_iballo.com...
> Hi,
>
> I use a JDBC driver. I want to know whether exists a command to know the
> results number just after the query.(i.e. lines)
>
> [I know it exists getColumnCount() to know the number of columns return
> ..
> int numcols = rsmd.getColumnCount();
> ]
>
> stmt.execute(sql)
> ResultSet rs = stmt.getResultSet();
> ResultSetMetaData rsmd = rs.getMetaData();
>
>
> What about getfetchSize() ??? it always return 10 whatever returned
> results.
>
>
Received on Fri Aug 03 2001 - 08:50:33 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US