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 🙂

thatjeffsmith
Author

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

9 Comments

  1. 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)

    • thatjeffsmith

      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

    • Michele

      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

    • thatjeffsmith

      If it’s not showing the count, what IS it showing? How are you testing your scenario?

Write A Comment