Re: How to get total number of rows before executing the sql /fetch

From: Ken Nichols <knichols_at_mcsilo.ilo.dec.com>
Date: 1997/10/03
Message-ID: <3434AE44.439_at_mcsilo.ilo.dec.com>#1/1


NNOOR wrote:
>
> Just a suggestion: Try "simplifying" the query (may be return only the
> key column, etc) and run this mock query in a stored proc. PL/SQL has
> an internal variable (attribute) defined called %ROWCOUNT. Use it.
>
> What I am trying to say is that if you are stuck with doing the query
> to find out the count, try minimizing the damage.
>
> Good Luck.
>
> Nasir (nnoor_at_cris.com)

If this query has to be run often, it might make sense to have a table of counts for each table in the schema. The total for each table could be updated by insert and delete triggers.

Ken Received on Fri Oct 03 1997 - 00:00:00 CEST

Original text of this message