5.25. PLVtab: Table Interface

The PLVtab (PL/Vision TABle) package makes it easier to declare, use, and display the contents of PL/SQL tables by providing predefined PL/SQL table types and programs. See Chapter 8 for details.

5.25.1. Predefined table TYPEs

Since these table TYPEs are already defined in the PLVtab package, you can use them to declare your own PL/SQL tables—and not deal with the cumbersome syntax.

TYPE boolean_table IS TABLE OF BOOLEAN INDEX BY BINARY_INTEGER;
TYPE date_table IS TABLE OF DATE INDEX BY BINARY_INTEGER;
TYPE integer_table IS TABLE OF INTEGER INDEX BY BINARY_INTEGER;
TYPE number_table IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
TYPE vc30_table IS TABLE OF VARCHAR2(30) INDEX BY BINARY_INTEGER;
TYPE vc60_table IS TABLE OF VARCHAR2(60) INDEX BY BINARY_INTEGER;
TYPE vc80_table IS TABLE OF VARCHAR2(80) INDEX BY BINARY_INTEGER;
TYPE vc2000_table IS TABLE OF VARCHAR2(2000) INDEX BY BINARY_INTEGER;
TYPE vcmax_table IS TABLE OF VARCHAR2(32767) INDEX BY BINARY_INTEGER;

5.25.2. The empty PL/SQL tables

An empty PL/SQL table is a structure in which no rows have been defined. The only way to delete all the rows from a PL/SQL table is to assign an empty table to that table. You can use these predefined PL/SQL tables to accomplish this task easily.

empty_boolean boolean_table; empty_date date_table; empty_integer integer_table; empty_number number_table; empty_vc30 vc30_table; empty_vc60 vc60_table; empty_vc80 vc80_table; empty_vc2000 vc2000_table; empty_vcmax ...

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.