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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Oracle Database 12c PL/SQL Programming

Oracle Database 12c PL/SQL Programming

Michael McLaughlin
Resilient Oracle PL/SQL

Resilient Oracle PL/SQL

Stephen B. Morris
Oracle PL/SQL

Oracle PL/SQL

Lewis Cunningham

Publisher Resources

ISBN: 1565922387Catalog PageErrata