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

Advanced Oracle PL/SQL Programming with Packages

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

5.24. PLVstk: Stack Manager

The PLVstk (PL/Vision STacK manager) package is a generic manager for both first-in-first-out (FIFO) and last-in-last-out (LIFO) stacks; it is built on PLVlst. See the companion disk (see http://examples.oreilly.com/advoracle) for details.

5.24.1. Package constants

defstk CONSTANT VARCHAR2(5) := 'stack';

The name of the default stack.

lifo CONSTANT VARCHAR2(4) := 'LIFO';

Indicates that you are working with a last-in-first-out stack. Used in calls to pop.

fifo CONSTANT VARCHAR2(4) := 'FIFO';

Indicates that you are working with a first-in-first-out stack. Used in calls to pop.

5.24.2. Creating and destroying stacks

PROCEDURE make 
   (stack_in IN VARCHAR2 := defstk,
    overwrite_in IN BOOLEAN := TRUE);

Allocates storage for a stack of up to 1,000 items with the specified name. By default, if the stack already exists it will be reinitialized to an empty stack.

PROCEDURE destroy (stack_in IN VARCHAR2 := defstk);

Releases all memory associated with this stack.

5.24.3. Modifying stack contents

PROCEDURE push (item_in IN VARCHAR2, stack_in IN VARCHAR2 := defstk);

Pushes an item onto the specified stack.

PROCEDURE pop (value_out IN OUT VARCHAR2, 
    stack_in IN VARCHAR2 := defstk,
    stack_type_in IN VARCHAR2 := lifo);

Pops an item off the top (LIFO) or bottom (FIFO) of the stack.

5.24.4. Analyzing stack contents

FUNCTION nitems (stack_in IN VARCHAR2 := defstk)
RETURN INTEGER;

Returns the number of items currently in the stack.

FUNCTION itemin (stack_in ...

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 PL/SQL Practices for Oracle Developers and DBAs

Expert PL/SQL Practices for Oracle Developers and DBAs

John Beresniewicz, Adrian Billington, Martin Büchi, Melanie Caffrey, Ron Crisco, Lewis Cunningham, Dominic Delmolino, Sue Harper, Torben Holm, Connor McDonald, Arup Nanda, Stephan Petit, Michael Rosenblum, Robyn Sands, Riyaj Shamsudeen

Publisher Resources

ISBN: 1565922387Supplemental ContentCatalog PageErrata