Home » SQL & PL/SQL » SQL & PL/SQL » sql*plus Report
sql*plus Report [message #196437] Thu, 05 October 2006 06:11 Go to next message
sanjit
Messages: 65
Registered: November 2001
Member
Hello

Is there any way to print
***no data found***
when no data found by the query in the SQL*PLUS report.

any input would be appreciated.

Re: sql*plus Report [message #196530 is a reply to message #196437] Thu, 05 October 2006 17:28 Go to previous messageGo to next message
Barbara Boehmer
Messages: 8636
Registered: November 2002
Location: California, USA
Senior Member
-- If feedback is set off, you get nothing:
SCOTT@10gXE> SET FEEDBACK OFF
SCOTT@10gXE> SELECT dname FROM dept WHERE deptno = 99
  2  /


-- If feedback is set on, you get 'no rows selected'
SCOTT@10gXE> SET FEEDBACK ON
SCOTT@10gXE> SELECT dname FROM dept WHERE deptno = 99
  2  /

no rows selected


-- If you want a custom message, you can do something like this:
SCOTT@10gXE> SET FEEDBACK OFF
SCOTT@10gXE> SELECT dname FROM dept WHERE deptno = 99
  2  UNION ALL
  3  SELECT '***no data found***' FROM DUAL
  4  WHERE  NOT EXISTS
  5  	    (SELECT dname FROM dept WHERE deptno = 99)
  6  
SCOTT@10gXE> /

DNAME
-------------------
***no data found***

Re: sql*plus Report [message #196579 is a reply to message #196530] Fri, 06 October 2006 01:00 Go to previous messageGo to next message
sanjit
Messages: 65
Registered: November 2001
Member
thanks.

Is there any way to just print ****No data FOUND ****** message , this will have all header and footer printed.

Re: sql*plus Report [message #196679 is a reply to message #196579] Fri, 06 October 2006 08:39 Go to previous message
joy_division
Messages: 4643
Registered: February 2005
Location: East Coast USA
Senior Member
set head off feedback off
Previous Topic: unable to view constraints
Next Topic: How to wait for a condition and timeout?
Goto Forum:
  


Current Time: Fri Dec 09 05:59:12 CST 2016

Total time taken to generate the page: 0.10576 seconds