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

6.6. The Predefined Constants

In addition to the predefined datatypes, the PLV package offers a set of constants that are used throughout PL/Vision. These constants define the type of input or output repository you want to use in a given situation. These constants are used in PLVio, PLVlog, and PLVexc. The input/output options in PL/Vision are shown in the following table.

DescriptionConstant
Database tabledbtab
PL/SQL tablepstab
Operating system filefile
VARCHAR2 stringstring
Standard outputstdout

For example, if you want to define the target repository of the PLVio package to be a PL/SQL table, you will issue this command:

SQL> exec PLVio.settrg (PLV.pstab);

If you want PLVlog to write its information to an operating system file, you will execute this command:

SQL> exec PLVlog.tofile;

which in turn sets the v_log_type variable to the PLV.file constant.

Sidebar 1. Special Notes on PLV

Once you build a package like this, you will find yourself constantly adding to it. Be careful not to throw in constants and programs that really do have a place in another, less generic package.

The boolstg, errm, and now functions of PLV can all be used from within SQL statements, since the package specification for PLV includes calls to the RESTRICT_REFERENCES pragma.

The errm function is a good example of how you can use a layer of your own PL/SQL code around native PL/SQL builtins (SQLERRM) to make the information more widely accessible (i.e., callable from within SQL statements).

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.
Start your free trial

You might also like

Oracle Database 12c PL/SQL Programming

Oracle Database 12c PL/SQL Programming

Michael McLaughlin
Oracle PL/SQL for DBAs

Oracle PL/SQL for DBAs

Arup Nanda, Steven Feuerstein
Expert PL/SQL Practices for Oracle Developers and DBAs

Expert PL/SQL Practices for Oracle Developers and DBAs

John Beresniewicz, Adrian Billington, Martin Büchi, Melanie Caffrey, Ron Crisco, Lewis Cunningham, Dominic Delmolino, Sue Harper, Torben Holm, Connor McDonald, Arup Nanda, Stephan Petit, Michael Rosenblum, Robyn Sands, Riyaj Shamsudeen

Publisher Resources

ISBN: 1565922387Supplemental ContentCatalog PageErrata