5.18. PLVlst: List Manager

The PLVlst (PL/Vision LiST manager) package provides a generic list manager for PL/SQL built on PL/SQL tables. See the companion disk (see http://examples.oreilly.com/advoracle) for details.

5.18.1. Package exceptions

list_undefined EXCEPTION;

Raised when you attempt to perform a PLVlst operation on an undefined list.

list_full EXCEPTION;

Raised when you attempt to add another item to a list which is already full (currently limited to maximum of 10,000 items in a list).

out_of_bounds EXCEPTION;

Exception raised when you try to reference an item in the list that is not defined.

5.18.2. Creating and destroying lists

PROCEDURE make (list_in IN VARCHAR2);

Allocates storage for a new list of the specified name.

FUNCTION is_made (list_in IN VARCHAR2) RETURN BOOLEAN;

Returns TRUE if the specified list already exists.

PROCEDURE destroy (list_in IN VARCHAR2);

Destroys the list, freeing up associated memory.

5.18.3. Modifying list contents

PROCEDURE appenditem (list_in IN VARCHAR2, item_in IN VARCHAR2);

Adds an item to the end of the specified list.

PROCEDURE insertitem 
    (list_in IN VARCHAR2, position_in IN NUMBER,
    item_in IN VARCHAR2);

Inserts an item at the specified position in the list.

PROCEDURE prependitem (list_in IN VARCHAR2, item_in IN VARCHAR2);

Inserts an item at the first position of the list.

PROCEDURE replaceitem (list_in IN VARCHAR2, position_in IN NUMBER,
    item_in IN VARCHAR2);

Replaces the nth item in the list with the new item. ...

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.