I have a SQL script with SELECT queries.
1. If the query returns no/zero rows, a message has to be printed on the screen.
2. The output has to be spooled.
[color=Blue]whenever sqlerror exit failure rollback;
set heading on
set feedback off
set verify off
select empno from emp where rownum<10;
select ename from emp where ENAME='12345';
WHENEVER NOT FOUND sqlprint;
The 'WHENEVER NOT FOUND' gives a 'Usage' error. A message needs to be printed if no data is selected. I also cannot use a procedure for this as i need the spooled output.
Is there a solution to this?