I wanted to replace the message 'no rows selected' with an alternate message.
SQL> select * from dual where 1=0;
no rows selected
SQL>
I found a good one by using NOT EXISTS clause
SQL> select * from dual where 1=0
UNION
select 'no data found' from dual where not exists (select * from dual where 1=0);
DUMMY
no data found
1 row selected.
SQL>
No comments:
Post a Comment