SQL*Plus User's Guide and Reference
Release 8.1.6
A75664-01

Library

Product

Contents

Index

PrevUpNext

Command Reference, 10 of 52


BREAK

Purpose

Specifies where and how formatting will change in a report, such as

Also lists the current BREAK definition.

Syntax

BRE[AK] [ON report_element [action [action]]] ...

where: 

report_element


 
Requires the following syntax: 
{column|expr|ROW|REPORT}
 
action
 
Requires the following syntax: 
[SKI[P] n|[SKI[P]] PAGE][NODUP[LICATES]|DUP[LICATES]]

 

Terms and Clauses

Refer to the following list for a description of each term or clause:

ON column [action [action]]
a change in the value of a column or expressionthe output of a rowthe end of a report
ON expr [action [action]]
ON ROW [action [action]]
ON REPORT [action]

Refer to the following list for a description of each action:

SKI[P] n
[SKI[P]] PAGE
NODUP[LICATES]
DUP[LICATES]

Enter BREAK with no clauses to list the current break definition.

Usage Notes

Each new BREAK command you enter replaces the preceding one.

To remove the BREAK command, use CLEAR BREAKS.

Example

To produce a report that prints duplicate job values, prints the average of SAL and inserts one blank line when the value of JOB changes, and additionally prints the sum of SAL and inserts another blank line when the value of DEPTNO changes, you could enter the following commands. (The example selects departments 10 and 30 and the jobs of clerk and salesman only.)

SQL> BREAK ON DEPTNO SKIP 1 ON JOB SKIP 1 DUPLICATES
SQL> COMPUTE SUM OF SAL ON DEPTNO
SQL> COMPUTE AVG OF SAL ON JOB
SQL> SELECT DEPTNO, JOB, ENAME, SAL FROM EMP
  2  WHERE JOB IN ('CLERK', 'SALESMAN')
  3  AND DEPTNO IN (10, 30)
  4  ORDER BY DEPTNO, JOB;

The following output results:

    DEPTNO JOB       ENAME             SAL
---------- --------- ---------- ----------
        10 CLERK     MILLER           1300
           *********            ----------
           avg                        1300

**********                      ----------
sum                                   1300

        30 CLERK     JAMES             950
           *********            ----------
           avg                         950


    DEPTNO JOB       ENAME             SAL
---------- --------- ---------- ----------
        30 SALESMAN  ALLEN            1600
           SALESMAN  WARD             1250
           SALESMAN  MARTIN           1250
           SALESMAN  TURNER           1500
           *********            ----------
           avg                        1400

**********                      ----------
sum                                   6550


6 rows selected.

Prev Up Next
Oracle
Copyright © 1999 Oracle Corporation.
All Rights Reserved.

Library

Product

Contents

Index