| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL*Plus - force TTitle to print regardless of query
On Fri, 29 Jan 1999 15:34:58 GMT, chrisoc_at_ans.net wrote:
>All is well if the queries return rows but if they don't,
>there's just a "no rows returned" in a bunch of white space.
>If I issue a fake query to dual using noprint, that forces the TTitle
>but I can end up with two TTitles if the "real" query also returns rows.
Make sure that your fake select to dual has a where clause that only allows it to return a row when the first query fails. In other words, the two queries should be mutually exclusive. For example:
select col1, col2, col3
from the_real_table
where col1=23;
select 'No Data Found' from dual
where not exists (
select col1, col2, col3 from the_real_table where col1=23 );
regards,
Jonathan Received on Sat Jan 30 1999 - 19:12:02 CST
![]() |
![]() |