SQL*Plus break header

From: Phil Bewig <pbewig_at_swbell.net>
Date: 10 Nov 2003 13:02:36 -0800
Message-ID: <455f7154.0311101302.310abb98_at_posting.google.com>



[Quoted] [Quoted] I am using SQL*Plus and ordinary SQL (no PL/SQL) to create a [Quoted] [Quoted] report. I would like to write a header line each time a field breaks:

Acct Description TranDate Budget Actual

---- ------------------- -------- --------- ---------
1234 Inventory
     Beginning balance              100,000   140,000
     Purchases           11/07/03    25,000    50,000
     Cost of sales       11/19/03   -25,000   -40,000
     Ending balance                 100,000   150,000

Here, 1234 is an account number and Inventory is an account name. The basic report is simple enough to write, using the acct and acct_title fields. But there isn't room to write those fields on the same line as the rest of the data, and there is no need to duplicate the fields, so I want to write them on a header line each time there is a break in the acct field. I thought of

COLUMN acct FORMAT A4
COLUMN acct_title FORMAT A35 FOLD_AFTER
COLUMN space FORMAT A4 ''
...
BREAK ON acct NODUPLICATES

but that doesn't work. COMPUTE lets me put a footer on each break field, but I want a header on each break field.

Can anyone suggest a solution?

Many thanks,

Phil Received on Mon Nov 10 2003 - 22:02:36 CET

Original text of this message