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

From: MCR <mrush_at_hertz.com.nospam>
Date: 1997/09/25
Message-ID: <01bcca02$4c841080$163f04d8_at_mrush.hertz.com>#1/1


You might "analyzing" the table. You could then get the number of rows from the "dba_tables" view.
The accuracy of the number of rows from the DBA view depends on how often the analyze is done and frequency of inserts and deletes into the table.

Or, you could build a trigger that fired on inserts and deletes. The trigger would increment/decrement a counter in another table. You would query that table to find the current number of rows in the table you are interested in.

Either of these methods require jsut on read, not a full table scan. However, they require more work up front.

-- 
Mark Rush
Oracle DBA
Hertz
mrush "at" hertz "dot" com

M. Thomas Groszko <mgroszko_at_sirus.com> wrote in article
<01bcc902$956ce2f0$64646464_at_GROSZKO>...

> I am still quite new to Oracle but I don't think that number is known
yet.
> Open cursor begins processing the data but has not yet processed all of
it.
> One the other hand I was quite suprised to get a no data found on a
declare
> cursor?
>
> Sidhartha Sahoo <ssahoo_at_altro.com> wrote in article
> <34285F33.28BE43FC_at_altro.com>...
> > We want to know the toal number of rows expected in a cursor fetch
> > before doing actual fetch. (before executing)
> >
> > thanks
> >
> > Sidhartha
> >
> >
>
Received on Thu Sep 25 1997 - 00:00:00 CEST

Original text of this message