How to Remove “X Rows Selected” in SQLcl & SQL*Plus (Oracle)

When using SQLcl or SQL*Plus with Oracle Database, you may have noticed feedback at the bottom of your query results that tells you how many rows were selected. For example, 100 rows selected (or however many rows were returned).

If you want to get rid of this, you can use SET FEEDBACK OFF.

You also have the option of setting a row threshold, which allows you to specify how many rows should be returned before feedback is provided.

Example

First, here’s an example of query results with the feedback:

SELECT * FROM regions;

Result:

   REGION_ID               REGION_NAME 
____________ _________________________ 
           1 Europe                    
           2 Americas                  
           3 Asia                      
           4 Middle East and Africa    

4 rows selected. 

In this case, four rows were returned, and so the feedback reads 4 rows selected.

Here it is again, but this time without the feedback:

SET FEEDBACK OFF;
SELECT * FROM regions;

Result:

   REGION_ID               REGION_NAME 
____________ _________________________ 
           1 Europe                    
           2 Americas                  
           3 Asia                      
           4 Middle East and Africa   

Set a Row Threshold

You also have the option of setting a row threshold. This is where you specify the number of rows that must be returned before any feedback is output.

Example:

SET FEEDBACK 2;
SELECT * FROM regions;

Result:

   REGION_ID               REGION_NAME 
____________ _________________________ 
           1 Europe                    
           2 Americas                  
           3 Asia                      
           4 Middle East and Africa    

4 rows selected. 

In this case, I specified a row threshold of 2. The query resulted in four rows being returned, and so feedback was also provided.

Here’s another example:

SET FEEDBACK 5;
SELECT * FROM regions;

Result:

   REGION_ID               REGION_NAME 
____________ _________________________ 
           1 Europe                    
           2 Americas                  
           3 Asia                      
           4 Middle East and Africa    

This time the number of rows returned were less than the threshold, and so no feedback was provided.