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 **
   



Linking to SQL Snippets ™

To link to this page in Oracle Technology Network Forums or OraFAQ Forums cut and paste this code.

  • [url=http://www.sqlsnippets.com/en/topic-11844.html]SQL Snippets: SQL Techniques Tutorials - Custom Feedback Messages[/url]

To link to this page in HTML documents or Blogger comments cut and paste this code.

  • <a href="http://www.sqlsnippets.com/en/topic-11844.html">SQL Snippets: SQL Techniques Tutorials - Custom Feedback Messages</a>

To link to this page in other web sites use the following values.

  • Link Text : SQL Snippets: SQL Techniques Tutorials - Custom Feedback Messages
  • URL (href): http://www.sqlsnippets.com/en/topic-11844.html