Count of Records

rohanale

Member²
Hi,

By default PL/SQL Developer only shows a subset of the records returned from a query.

Is there a quick way to get a count of the records returned.

Of course I know I can do a select count(*) but if I actually retrieve the records can I get a count quickly.

I know I can click the Last Page button. Is that the only option for getting the count?
Thanks

Rohan
 
When there is a large data table, select count(*) will cost a long time.
So there is no option to set record count as default option I think.
 
I use the Browser Extender plugin. Right-clicking on a table will give you a record count in the popup menu.
 
Last edited:
I like Patrick's idea and the Browser extender idea. I'll need to remember them.

What I do is change the preference on the SQL Window to return all records and I leave the Maximum result set to like 100 MB.

There are times that I don't want to wait for all of them to load, so I limit the SQL with rownum
 
Browser Extender is brilliant, but I would advise against having a "select count(*) from ..." in the Table popup menu if you have any significantly large tables. In most of the systems I've worked on that could take several hours for some tables, and you'd get pretty unpopular with the DBAs.

Instead I would have the popup item report the num_rows, the last_analyzed date and whether the stats are stale. Then in the onclick action either do the actual count or (what I do):

Code:
select count(*) * 10 from [tablename] sample block(10)

(Unfortunately at my current site I don't have local admin privs though, so no Browser Extender :( )
 
Last edited:
Along the same lines is:

Code:
select t.num_rows
from user_tables t
where t.table_name = [tablename]

 
Last edited:
Back
Top