Chapter 8. PLVtab: Easy Access to PL/SQL Tables

The PLVtab (PL/Vision TABle) package offers predefined PL/SQL table types and programs to make it easier to declare, use, and display the contents of PL/SQL tables. PL/SQL tables are the closest things to arrays in PL/SQL, but there are a number of complications. First, to use a PL/SQL table, you first have to declare a table type. Then you can declare and use the PL/SQL table itself. Beyond the definition of the PL/SQL table, the fact that it is a sparse, unbounded, homogeneous data structure can lead to complications, particularly when it comes to scanning and displaying those structures (see Chapter 10 of Oracle PL/SQL Programming.

By using PLVtab, you can avoid (in most cases) having to define your own PL/SQL table types. You can also take advantage of flexible, powerful display procedures to view table contents.

When you display the contents of PL/SQL tables, PLVtab allows you to:

  • Show or suppress a header for the table

  • Show or suppress the row numbers for the table values

  • Display a prefix before each row of the table

This chapter shows how to use the different aspects of PLVtab.

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.