Sql*Plus User’s Guide and Reference


Printing a Line of Characters after Wrapped Column Values


Download 5.34 Mb.
Pdf ko'rish
bet84/103
Sana04.08.2023
Hajmi5.34 Mb.
#1665146
1   ...   80   81   82   83   84   85   86   87   ...   103
Bog'liq
E18404-12

Printing a Line of Characters after Wrapped Column Values
As you have seen, by default SQL*Plus wraps column values to additional lines when 
the value does not fit the column width. If you want to insert a record separator (a line 
of characters or a blank line) after each wrapped line of output (or after every row), 
use the RECSEP and RECSEPCHAR variables of the SET command.
RECSEP determines when the line of characters is printed; you set RECSEP to EACH 
to print after every line, to WRAPPED to print after wrapped lines, and to OFF to 
suppress printing. The default setting of RECSEP is WRAPPED.
RECSEPCHAR sets the character printed in each line. You can set RECSEPCHAR to 
any character.
You may wish to wrap whole words to additional lines when a column value wraps to 
additional lines. To do so, use the WORD_WRAPPED clause of the COLUMN 
command as shown:
COLUMN 
column_name
WORD_WRAPPED
Example 6–9
Printing a Line of Characters after Wrapped Column Values
To print a line of dashes after each wrapped column value, enter the commands:
SET RECSEP WRAPPED
SET RECSEPCHAR "-"
Finally, enter the following query:
SELECT LAST_NAME, JOB_TITLE, CITY
FROM EMP_DETAILS_VIEW
WHERE SALARY>12000;
Now restrict the width of the column JOB_TITLE and tell SQL*Plus to wrap whole 
words to additional lines when necessary:
COLUMN JOB_TITLE FORMAT A20 WORD_WRAPPED
Run the query:
/


Clarifying Your Report with Spacing and Summary Lines
Formatting SQL*Plus Reports
6-9
If you set RECSEP to EACH, SQL*Plus prints a line of characters after every row (after 
every department, for the above example). 
Before continuing, set RECSEP to OFF to suppress the printing of record separators:
SET RECSEP OFF

Download 5.34 Mb.

Do'stlaringiz bilan baham:
1   ...   80   81   82   83   84   85   86   87   ...   103




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling