Re: SQL*PLUS ttitle settings

From: <hazledine_at_embl-heidelberg.de>
Date: 29 Sep 93 11:49:20 +0100
Message-ID: <1993Sep29.114920.119492_at_embl-heidelberg.de>


ebaril_at_devo.ersys.edmonton.ab.ca (Evalyn Baril) writes:

> Does anyone know if there is any switch that can be set in order to have
> the title on the report print even when there are "no rows selected".
> The users really need to know which reports these are!

I don't know if and how you could force a page title, but depending on the structure of your report you could use this trick to get what you want: use the UNION operator together with a SELECT FROM DUAL to retrieve a text constant when there's no real data to be got.

Suppose you had a table called NAME_TABLE, and you wanted to report all the names added to that table since June 15th 1992, where there may be none:

SELECT	SURNAME || ', ' || INITIALS
FROM	NAME_TABLE
WHERE	DATE_ADDED >= TO_DATE('15-JUN-92')
UNION
SELECT	'No rows selected'
FROM	DUAL
WHERE	NOT EXISTS
	(
	SELECT	1
	FROM 	NAME_TABLE
	WHERE 	DATE_ADDED >= TO_DATE('15-JUN-92')
	)

Depending on the columns in the report, and the time taken to execute the query, this might be difficult or impossible to do :-(

Hope this helps.


David Hazledine                                                EMBL Data Library
Database Administrator                                                PF 10.2209
EMBL Data Library                                      69012 Heidelberg, Germany

Internet: Hazledine_at_EMBL-Heidelberg.DE


Received on Wed Sep 29 1993 - 11:49:20 CET

Original text of this message