Skip to Main Content
Advanced Oracle PL/SQL Programming with Packages
book

Advanced Oracle PL/SQL Programming with Packages

by Steven Feuerstein
October 1996
Intermediate to advanced content levelIntermediate to advanced
687 pages
16h 41m
English
O'Reilly Media, Inc.
Content preview from Advanced Oracle PL/SQL Programming with Packages

7.2. The Line Separator

When you compile and store code in SQL*Plus, any blank lines in your source code are discarded. This annoying "undocumented feature" wreaks havoc at compile time. If there are any compile errors, the line number stored in USER_ERRORS and returned by SHOW ERRORS almost never matches the line number of the code in your operating system file. What an annoyance!

The situation gets even worse when you really want to preserve those blank lines for readability. The PLVhlp package, for example, provides an architecture for online help. Without blank lines in the help text, it would be very difficult to make this text understandable. It would be awfully nice to be able to preserve those blank lines—or at least make a line appear to be blank when displayed.

The p package recognizes this need and allows you to specify a line separator character. If a line of text passed to p.l consists only of the line separator character, it is displayed as a blank line.

You set the line separator with the set_linesep procedure, whose header is:

PROCEDURE set_linesep (linesep_in IN VARCHAR2);

You can retrieve the current line separator character with the linesep function:

FUNCTION linesep RETURN VARCHAR2;

The default line separator character is =. As a result, if I execute the following anonymous block,

BEGIN
   p.l ('this');
   p.l ('=');
   p.l ('is');
   p.l ('=');
   p.l ('separated!');
END;
/

I see this output:

this

is

separated!
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Oracle Database 12c PL/SQL Programming

Oracle Database 12c PL/SQL Programming

Michael McLaughlin
Oracle PL/SQL for DBAs

Oracle PL/SQL for DBAs

Arup Nanda, Steven Feuerstein
Expert Oracle PL/SQL

Expert Oracle PL/SQL

Ron Hardman, Michael McLaughlin

Publisher Resources

ISBN: 1565922387Supplemental ContentCatalog PageErrata