Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: EXEC_SQL Question
In article <7uoves$b0n$1_at_nnrp1.deja.com>, Sue Han <sue_han_at_my-deja.com> wrote:
>Hi,
>
>I want to get an estimate on number of rows that will be returned by a
>Dynamic SELECT statement before the actual rows are fetched.
>
>Someone told me:
>Informix reports this estimate in it's sqlca data structure when a
>cursor against the query is opened, however, these estimates are
>frequently way off. They depend on statistics gathered that may be out
>of date.
>
>Estimate is exactly what I want. I will get statistics regularly.
>
>Can EXEC_SQL do this and how? What about I connect to Oracle or
>non-Oracle DB?
Try getting the row count from user_tables... The value is updated on 'analyze table TNAME [esitmate|comopute] statistics'.