16 September, 2015

Replace 'no rows selected'

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

Finding OPP Manager log for a concurrent request

=> Use below query to find the OPP manager log for a concurrent request.  SELECT fcpp.concurrent_request_id req_id, fcp.node_name, fcp.lo...