Read Using SQL Snippets before using any of this site's code or techniques on your own systems.

Ads by Google

Custom Feedback Messages

This section presents various techniques for customizing the "n rows selected." and "no rows selected" messages that appear after query results in SQL*Plus reports. For example, instead of standard feedback messages like the ones in the report below

variable v_c1 varchar2(6)

execute :v_c1 := '%'

PL/SQL procedure successfully completed.


select *
from   t
where  c1 like :v_c1 ;

       KEY C1     C2         C3                 C4
---------- ------ ---------- ---------- ----------
         1 X      AAA        2005-04-03       3000
         2 Y      BB         2006-05-04       2000
         3 Y      CCCC       2007-06-05       4000
         4 Y                 2008-07-06          0
         5 Y      DDDDD                       5000
         6 Y

6 rows selected.


execute :v_c1 := 'Z'

PL/SQL procedure successfully completed.

/

no rows selected


 

you will learn how to create custom feedback messages like this.


       KEY C1     C2         C3                 C4
---------- ------ ---------- ---------- ----------
         1 X      AAA        2005-04-03       3000
         2 Y      BB         2006-05-04       2000
         3 Y      CCCC       2007-06-05       4000
         4 Y                 2008-07-06          0
         5 Y      DDDDD                       5000
         6 Y

6 Items Found
   

       KEY C1     C2         C3                 C4
---------- ------ ---------- ---------- ----------

** No Items Found **
   

You will also see how to suppress column headings when no rows are returned with our custom feedback messages, as in the following sample output.





** No Items Found **