The BREAK command also may be used to skip lines when a column's value changes.
By adding a skip clause, it also can advance to a new page when a column's value changes.
The format for this skip clause is shown in the following diagram:
If, for example, you wanted the report showing database objects to print each owner's own set of pages,
skipping one line each time the object type changed, you would use the following BREAK command:
BREAK ON owner SKIP PAGE ON object_type SKIP 1
The SKIP PAGE following the owner column tells SQL*Plus to start a new page when the owner column changes.
The SKIP 1 following the object_type column tells SQL*Plus to skip one line when the object_type column changes
The final script for the object report looks like this:
BREAK ON owner SKIP PAGE ON object_type SKIP 1
COLUMN owner FORMAT A12
COLUMN object_type FORMAT A10
COLUMN object_name FORMAT A30
SELECT owner, object_type, object_name
FROM dba_objects
ORDER BY owner, object_type, object_name;
SQL*Plus does not create page breaks as you would expect. With the default settings, SQL*Plus skips one blank line and reprints the page titles. If you lookat the report on the screen, it is fairly easy to follow. However, if you plan to print the report, you may want a form-feed character to start each new page. Later in this module, you will learn how to use the NEWPAGE setting to do that.