8.5. Setting the Display Prefix

The PLVtab set_prefix procedure allows you to specify a prefix that is to be displayed before the row values. This prefix is only displayed when you are not showing the row numbers. The default value for the prefix is NULL, which means that you don't see any prefix unless you call the set_prefix program. The header for this procedure is:

PROCEDURE set_prefix (prefix_in IN VARCHAR2 := NULL)

Since the single argument has a default value of NULL, you can set the prefix back to its default value simply by entering this command:

SQL> PVLtab.set_prefix;

The following script shows you how the prefix is set and used in the display of PLVtab table information.

DECLARE
   nms PLVtab.vc80_table;
   lo INTEGER;
   hi INTEGER;
BEGIN
   PLVtab.noshowrow;
   PLVtab.set_prefix ('Company Name = ');
   nms (1505) := 'ACME';
   nms (20200) := 'ArtForms';
   lo := 1505;
   hi := 20200;
   PLVtab.display (nms, hi, 'Selected Company Names', lo, hi-lo);
END;
/
Selected Company Names
Company Name = ACME
Company Name = ArtForms

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.