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, PLVtab: Easy Access to PL/SQL Tables for details.
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;
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 vcmax_table;
PROCEDURE showhdr;
Requests that a header be displayed with the contents of the table (the header text is passed in the call to the display procedure). This is the default.
PROCEDURE noshowhdr;
Turns off the display of the header text with the table contents.
FUNCTION showing_header RETURN BOOLEAN;
Returns TRUE if the header is being displayed.
PROCEDURE showblk;
Requests that blank lines be displayed. A NULL row will display as the p.fornull NULL substitution value. A line consisting only of blanks will be displayed as the word BLANKS.
PROCEDURE noshowblk;
Requests that blank lines be displayed as blank lines.
FUNCTION showing_blk RETURN BOOLEAN;
Returns TRUE if showing the contents of blank lines.
PROCEDURE display
(tab_in IN boolean_table|date_table|number_table|integer_table,
end_in IN INTEGER,
hdr_in IN VARCHAR2 := NULL,
start_in IN INTEGER := 1,
failure_threshold_in IN INTEGER := 0,
increment_in IN INTEGER := +1);
PROCEDURE display
(tab_in IN
vc30_table|vc60_table|vc80_table|vc2000_table|vcmax_table,
end_in IN INTEGER,
hdr_in IN VARCHAR2 := NULL,
start_in IN INTEGER := 1,
failure_threshold_in IN INTEGER := 0,
increment_in IN INTEGER := +1);
The display procedure is overloaded nine times, for a variety of datatypes. The first version above shows the overloading for non-string datatypes. The second version shows all the different types of string PL/SQL tables supported by the PLVtab.display procedure.
Copyright (c) 2000 O'Reilly & Associates. All rights reserved.
This HTML Help has been published using the chm2web software. |