Re: SQL*Plus - NO RECORDS FOUND

From: Alvin W. Law <alaw_at_oracle.com>
Date: Thu, 17 Mar 1994 08:15:31 GMT
Message-ID: <ALAW.94Mar17001531_at_ap221sun.oracle.com>


In article <CMs58t.8sx_at_idm.com> mja_at_idm.com (Mike Androff) writes:
>Ian Dixon (idixon_at_syntaxis.ukmail.net) wrote:
>: moswald_at_netserv.unmc.edu (Mike Oswald) writes:
 

>: > Does anyone remember how to get a title to print even if there are no
>: > records found?
 

>: I will often use something like this:
 

>: select a,b,c,d
>: from table_A
>: union
>: select null,
>: 'End of Report',
>: null,
>: null
>: from dual
>: order by 1
>: /
 

>: It will always give the 'End of Report' line, which I like to get, but
>: it also gives the titles if no data is selected in the first part.
>
>This is fine except in the case where your report has duplicates and you
>want those duplicates to appear. The union will reduce duplicates to
>single records (this may actuall be desirable). Just so you're aware...

Instead of UNION, UNION ALL will do the trick.

--
 Alvin W. Law .............................................. Oracle Corporation
 Senior Applications Engineer ..................... 300 Oracle Parkway, Floor 6
 Manufacturing Applications .......................... Redwood Shores, CA 94065
 Email: alaw_at_oracle.com ........... Voice: 1.415.506.3390 . Fax: 1.415.506.7299

ORA-03113: end-of-file on communication channel
Received on Thu Mar 17 1994 - 09:15:31 CET

Original text of this message