Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL*Plus - force TTitle to print regardless of query

Re: SQL*Plus - force TTitle to print regardless of query

From: Jonathan Gennick <gennick_at_worldnet.att.net>
Date: 31 Jan 1999 01:12:02 GMT
Message-ID: <36c2a5f6.4350365@netnews.worldnet.att.net>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US