Hi,

In the below code, how can I always get the heading to print out to the report even if no rows selected.
The below is actually 2 queries. If the first query shows no rows selected, you do not get the headings.

I want to see the heading before the no rows selected.



no rows selected


XXX Telephone Operations
Page: 1
COMPLEMENTS SOURCED TO -99 : Removal
Status
May 27, 2002

IPID CABLE_ID SOURCE_IPID LOW_PAIR HIGH_PAIR FILENAME POST
LAST_MODIFY_ID ORIGINAL_ID
---------- ---------- ----------- ---------- ---------- -------------- ----
-------------- --------------
1590 F0476 -99 1 12 UG83761 PPX
G007397 G007397
8077 18 -99 151 175 P8061 PPX
T3CBXJ1 CONV
8152 2 -99 901 1000 UG80392 PPR
T3CBXJ1 CONV
8152 2 -99 601 700 UG80392 PPR
T3CBXJ1 CONV


set linesize 120
set pagesize 66
set echo off
set wrap off
set flush off
set termout off
set verify off
set feedback on

column today new_value cur_date
break on today

select to_char( sysdate,'fmMonth DD, YYYY' ) today from dual;
clear breaks

column JC new_value var_jc
column WC new_value var_wc

define line1 = 'Verizon Telephone Operations'
define line2 = 'COMPLEMENTS SOURCED TO -99 : Non-Removal Status '
define page = 'Page: '

ttitle center line1 right page sql.pno skip 1 -
center line2 skip 1 -
center cur_date skip 2

break on JC nodup on WC nodup on unique nodup

set trimspool on
spool &&3.source_99.rpt

select b.ipid "IPID", b.cable_id "CABLE_ID", b.source_ipid
"SOURCE_IPID",
b.low_pair "LOW_PAIR", b.high_pair "HIGH_PAIR", c.filename "FILENAME",
b.post_status "POST_STATUS", b.last_modify_id "LAST_MODI
FY_ID", b.original_id "ORIGINAL_ID"
from complement b, cpr_graphic c where
b.source_ipid = -99 and
b.post_status not in ('PPX', 'PPR', 'ABX', 'FPR', 'RIP') and
b.jur = upper('&&1') and b.wc = upper('&&2') and
c.jur = upper('&&1') and c.wc = upper('&&2') and
c.ipid = b.ipid and
c.filename in (select max(filename) from cpr_graphic where
ipid = b.ipid and jur = b.jur and wc = b.wc)
order by b.ipid, b.cable_id;

--Report of Removed Complement records

define line2 = 'COMPLEMENTS SOURCED TO -99 : Removal Status'

select b.ipid "IPID", b.cable_id "CABLE_ID", b.source_ipid "SOURCE_IPID",
b.low_pair "LOW_PAIR", b.high_pair "HIGH_PAIR", c.filename "FILENAME",
b.post_status "POST_STATUS", b.last_modify_id "LAST_MODIFY_ID",
b.original_id "ORIGINAL_ID"
from complement b, cpr_graphic c where
b.source_ipid = -99 and
b.post_status in ('PPX', 'PPR', 'ABX', 'FPR', 'RIP') and
b.jur = upper('&&1') and b.wc = upper('&&2') and
c.jur = upper('&&1') and c.wc = upper('&&2') and
c.ipid = b.ipid and
c.filename in (select max(filename) from cpr_graphic where
ipid = b.ipid and jur = b.jur and wc = b.wc)
order by b.ipid, b.cable_id;

spool off
quit

Thanks in Advance.