5.21. PLVprs: String Parsing

The PLVprs (PL/Vision PaRSe) package offers a set of programs which provide generic and flexible string parsing capabilities. See Chapter 10 for details.

5.21.1. Package constants

c_ignore_case CONSTANT VARCHAR2(1) := 'I';
c_respect_case CONSTANT VARCHAR2(1) := 'R';

Use these constants to indicate whether you want case to be ignored or respected in the current operation.

c_all CONSTANT VARCHAR(3) := 'ALL';
c_word CONSTANT VARCHAR(4) := 'WORD';
c_delim CONSTANT VARCHAR(5) := 'DELIM';

The different types of atomics; c_all indicates "all atomics"; c_word indicates "words only"; c_delim indicates "delimiters only".

std_delimiters CONSTANT VARCHAR2 (50) :=
    !@#$%^&*()-_=+\|`~{{]};:''",<.>/?' ||
    PLVchr.newline_char || PLVchr.tab_char || PLVchr.space_char;

The standard set of delimiter characters.

plsql_delimiters CONSTANT VARCHAR2 (50) :=
    '!@%^&*()-=+\|`~{{]};:''",<.>/?' ||
    PLVchr.newline_char || PLVchr.tab_char || PLVchr.space_char;

The set of delimiters for the PL/SQL language; this list is a bit different from the std_delimiters. The underscore and pound sign characters, for example, are not delimiters in PL/SQL.

5.21.2. Wrapping long strings into paragraphs

PROCEDURE wrap 
   (text_in IN VARCHAR2,
   line_length IN INTEGER,
   paragraph_out IN OUT PLVtab.vc2000_table,
   num_lines_out IN OUT INTEGER);

Wraps the string provided by text_in into separate lines with a maximum specified length, each line of which is stored in consecutive rows in a PL/SQL ...

Get Advanced Oracle PL/SQL Programming with Packages now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.