Question: How can I make SQL Developer display the number of rows returned by a query?

Answer: Execute the query, and fetch all the rows.

Two styles of execution, both show total number of rows returned.
Two styles of execution, both show total number of rows returned.

But I’m not seeing it!

and fetch all the rows.

This part is important.

Execution using ctrl+enter executes statement, and returns the FIRST ‘fetch’, by default of 50 records.

First Fetch

What's implied, is that there are MORE rows to get. Scroll down the grid, or hit Ctrl+End to jump to the last record.
What’s implied, is that there are MORE rows to get. Scroll down the grid, or hit Ctrl+End to jump to the last record.

Last Fetch
Warning: Rant ahead!

This is important for another reason...
This is important for another reason…

…Until All Rows Are Read – there’s one or more proceses on the server WAITING for you

So close these grids. Or read all the rows. Then you don’t have to worry about upsetting the DBA because you’re wasting server resources.

This becomes especially important if you enable the ‘More Grids’ preference.

Show Query Results In New Tabs = MORE TABS.
Show Query Results In New Tabs = MORE TABS.

Close when finished 🙂

Author

I'm a Distinguished Product Manager at Oracle. My mission is to help you and your company be more efficient with our database tools.

13 Comments

  1. CuriousUser Reply

    I prefer it shows the query results as a column in sql history when i run the query first time. Some of the other product SQL tools actually show that. Does SQL developer not know how rows were fetched from the database for a successful query?

    • CuriousUser

      I was not very clear. No. The number of rows returned by the query.

  2. Julia Wiener Reply

    would this apply to VIEWS? How can I read the returned rows in a view? Views don´t have the “count rows” option…

    • Julia Wiener

      sorry what I am asking is, when I create a view, is there a way to read the resulting numbers of rows of that view?
      Tables do have the option to “count rows” but views don´t…
      Thanks!

    • Julia Wiener

      I want to know if, after creating a view, is there a direct way of knowing how many resulting rows it has, apart from the option of doing a select count query on that view (that is what I do now)

    • that will re-run the query, the numbers could be off, but should generally be ok if you’re ok with the perf hit of running the query again

    • How do you get it to show the count? The changes he suggests in Worksheet aren’t adding the count of rows returned for me

Write A Comment