Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Dynamic SQL Query count

564035Jun 16 2007 — edited Jun 21 2007
Hi,
I need to retieve the number of records that will be retrieved by a query as follows.
How can this be done?
Is there a method to do it using native dynamic sql (open .. for .. using ) instead of DBMS_SQL (Because Native is faster than dbms_SQL )?

The following block demostrates what I need to do where v_query will hold the query text.

declare
v_query varchar2(32000);
v_count number;
begin
select query_text into v_query from groups_table where id =1;
...
...
dbms_output.put_line('count = '||v_count);
end;

Thanks in Advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 19 2007
Added on Jun 16 2007
6 comments
1,245 views