Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Row count from REF CURSOR
<greg.sewell_at_gmail.com> wrote in message
news:1140012179.431100.175920_at_g44g2000cwa.googlegroups.com...
> I'm sure I'm just missing something, but can't seem to find the answer.
>
> We have a function that returns a REF CURSOR using the OPEN..FOR
> syntax. The SQL for the cursor is dynamically built in the procedure
> based on a series of configurations, such that the cursor will always
> be different based on the most current configuration. The generalized
> approach is that the dynamic SQL string is stored in a temporary table
> and then retrieved.
>
> SELECT to_char(SQLTranslationString)
> INTO vcSQLTranslationString
> FROM TranslationString
> WHERE AuditID = iAuditID;
>
> OPEN returnCursor FOR vcSQLTranslationString;
>
> In this particular system, we have stringent audit requirements, such
> that we have to know the final target row count. I know the calling
> system that initiated the procedure can always call back and tell me
> the answer, but I was wondering if I could force the procedure to do
> it. I tried the following:
> iRowsProcessed := returnCursor%ROWCOUNT;
> , but found in the documentation that this will always be zero.
>
> Any suggestions?
>
You won't know the record count until you fetch the last row.
Jim
Received on Wed Feb 15 2006 - 08:58:02 CST