This book explains the best way to construct packages, a powerful part of Oracle's PL/SQL procedural language that can dramatically improve your programming productivity and code quality, while preparing you for object-oriented development in Oracle technology. It comes with PL/Vision software, a library of PL/SQL packages developed by the author, and takes you behind the scenes as it examines how and why the PL/Vision packages were implemented the way they were.
-
Working With Packages
-
Chapter 1 PL/SQL Packages
- What Is a PL/SQL Package?
- What Are the Types and Layers of Packages?
- What Are the Benefits of Packages?
- Using Packages
- Types of Packages
- Building Packages
-
Chapter 2 Best Practices for Packages
- Starting With Packages
- Using Effective Coding Style for Packages
- Selecting Package Names
- Organizing Package Source Code
- Constructing the Optimal Interface to Your Package
- Building Flexibility Into Your Packages
- Building Windows Into Your Packages
- Overloading for Smart Packages
- Modularizing for Maintainable Packages
- Hiding Package Data
- Simultaneous Construction of Multiple Packages
-
Chapter 3 The PL/SQL Development Spiral
- The Basic Problem
- Adding Value
- Supplying Backward Compatibility
- Improving the User Interface
- Rough Waters Ahead
- Building a Structured Function
- Handling Program Assumptions
- Broadening the Scope
- Considering Implementation Options
- Choosing the Best Performer
- Don’t Forget Backward Compatibility
- Obliterating the Literals
- Glancing Backward, Looking Upward
-
-
PL/Vision Overview
-
Chapter 4 Getting Started with PL/Vision
- What Is PL/Vision?
- packagesin PL/VisionPL/Vision Package Bundles
- installingPL/Vision LitePL/VisioninstallingInstallation Instructionss
- installingPL/Vision help packagespackageshelpdocumentationInstalling Online Help for PL/Vision
- documentationonline helpUsing Online Help
- SQL*Plusscripts included on diskfilescreated during installationcodecreated during installationSummary of Files on Disk
-
Chapter 5 PL/Vision Package Specifications
- Common Package Elements
- p packagep: a DBMS_OUTPUT Substitute
- PLV: Top-Level Constants and Functions
- PLVcase: PL/SQL Code Conversion
- PLVcat: PL/SQL Code Cataloguing
- PLVchr: Operations on Single Characters
- PLVcmt: Commit Processing
- PLVddd: DDL Syntax Dump
- PLVdyn: Dynamic SQL Operations
- PLVexc: Exception Handling
- PLVfile: Operating System I/O Manager
- PLVfk: Foreign Key Interface
- PLVgen: PL/SQL Code Generator
- PLVhlp: Online Help Architechture
- PLVio: Input/Output Processing
- PLVlex: Lexical Analysis
- PLVlog: Logging Facility
- listsPLVlst package PLVlst: List Manager
- PLVmsg: Message Handling
- PLVobj: Object Interface
- PLVprs: String Parsing
- PLVprsps: PL/SQL Source Code Parsing
- PLVrb: Rollback Processing
- PLVstk: Stack Manager
- PLVtab: Table Interface
- PLVtkn: Token Table Interface
- PLVtmr: Program Performance Analyzer
- PLVtrc: Trace Facility
- PLVvu: Code and Error Viewing
-
-
Building Block Packages
-
Chapter 6 PLV: Top-Level Constants and Functions
- NULLsubstitution valuesubstitution value, NULLNull Substitution Value
- Setting the PL/Vision Date Mask
- Assertion Routines
- PLV Utilities
- typesdatatypestypesThe Predefined Datatypes
- The Predefined Constants
-
Chapter 7 p: A Powerful Substitute for DBMS_OUTPUT
- p packagell procedureUsing the l Procedure
- delimiterline separatorline separatorwhitespaceline separatorcharactersline separatorblank lineswhitespaceThe Line Separator
- stringsoutput prefixI/Ooutput prefixoutput prefixThe Output Prefix
- p packageoutput fromoutput from p packageI/Op package outputControlling Output from p
-
Chapter 8 PLVtab: Easy Access to PL/SQL Tables
- typestableUsing PLVtab-Based PL/SQL Table Types
- display functionDisplaying PLVtab Tables
- togglestable formatheaders, tableShowing Header Toggle
- Showing Row Number Toggle
- prefixtable row valuedisplay prefixtablesrow value prefixSetting the Display Prefix
- empty tablesdeletingtable rowsEmptying Tables with PLVtab
- Implementing PLVtab.display
-
Chapter 9 PLVmsg: Single-Sourcing PL/SQL Message Text
- PLVmsg Data Structures
- savingmessage textStoring Message Text
- Retrieving Message Text
- The Restriction Toggle
- Integrating PLVmsg with Error Handling
- Implementing load_ from_dbms
-
Chapter 10 PLVprs, PLVtkn, and PLVprsps: Parsing Strings
- PLVprs: Useful String Parsing Extensions
- PLVtkn: Managing PL/SQL Tokens
- PLVprsps: Parsing PL/SQL Strings
-
Chapter 11 PLVobj: A Packaged Interface to ALL_OBJECTS
- Why PLVobj?
- ALL_OBJECTS View
- Setting the Current Object
- Accessing ALL_OBJECTS
- Binding Objects to a Dynamic Cursor
- Populating a PL/SQL Table with Object Names
- A Programmatic Cursor FOR Loop
- Tracing PLVobj Activity
-
Chapter 12 PLVio: Reading and Writing PL/SQL Source Code
- Why PLVio?
- Code Repositories Supported by PLVio
- Managing the Source Repository
- The Source WHERE Clause
- Managing the Target Repository
- Reading From the Source
- Writing to the Target
- Saving and Restoring Settings
- Cleaning Up Source and Target
-
Chapter 13 PLVfile: Reading and Writing Operating System Files
- A Review of UTL_FILE
- Specifying the File in PLVfile
- Creating and Checking Existence of Files
- Opening and Closing Files
- Reading From a File
- Writing to a File
- Copying File Contents
- Displaying File Contents
- Handling File Errors with PLVfile
- Tracing PLVfile Activity
-
-
Developer Utility Packages
-
Chapter 14 PLVtmr: Analyzing Program Performance
- Toggling the Timer
- Capturing the Start Time
- Retrieving and Displaying the Elapsed Time
- Using PLVtmr in Scripts
-
Chapter 15 PLVvu: Viewing Source Code and Compile Errors
- Compiling PL/SQL Code in SQL*Plus
- Displaying Compile Errors
- Displaying Source Code
- Implementing PLVvu
-
Chapter 16 PLVgen: Generating PL/SQL Programs
- Best PracticesOptions for Best Practices
- Code Generated by PLVgen
- Modifying PLVgen Behavior
- Implementing PLVgen
-
Chapter 17 PLVhlp: Online Help for PL/SQL Programs
- Who Needs Online Help?
- Current Sources of Information
- What Is “Online Help” for Stored Code?
- Using PLVhlp
- Implementing PLVhlp
-
Chapter 18 PLVcase and PLVcat: Converting and Analyzing PL/SQL Code
- PLVcase: Converting the Case of PL/SQL Programs
- PLVcat: Cataloguing PL/SQL Source Code
-
-
Plug-and-Play Packages
-
Chapter 19 PLVdyn and PLVfk: Dynamic SQL and PL/SQL
- About Plug-and-Play
- Declarative Programming in PL/SQL
- The Dynamic Packages of PL/Vision
- PLVdyn: A Code Layer over DBMS_SQL
- DML Operations
- PLVfk: Generic Foreign Key Lookups
-
Chapter 20 PLVcmt and PLVrb: Commit and Rollback Processing
- PLVcmt: Enhancing Commit Processing
- PLVrb: Performing Rollbacks
-
Chapter 21 PLVlog and PLVtrc: Logging and Tracing
- PLVlog: Logging Activity in PL/SQL Programs
- PLVtrc: Tracing Execution of PL/SQL Programs
-
Chapter 22 PLVexc: Exception Handling
- The Challenge of Exception Handling
- Application-Specific Exception Packages
- Implementing PLVexc
-
-
Testing Your Knowledge
-
Appendix Appendix: PL/SQL Exercises
- Exercises
- Solutions
-
-
Colophon
- Title:
- Advanced Oracle PL/SQL Programming with Packages
- By:
- Steven Feuerstein
- Publisher:
- O'Reilly Media
- Formats:
-
- Safari Books Online
- Print Release:
- October 1996
- Pages:
- 687
- Print ISBN:
- 978-1-56592-238-9
- | ISBN 10:
- 1-56592-238-7
Our look is the result of reader comments, our own experimentation, and feedback from distribution channels. Distinctive covers complement our distinctive approach to technical topics, breathing personality and life into potentially dry subjects. A moth is featured on the cover of Advanced Oracle PL /SQL: Programming with Packages. Moths, along with butterflies, make up the insect order Lepidoptera, the second largest order of insects. Their wings are largely or entirely covered in tiny, overlapping scales. Moths, unlike butterflies, are mostly nocturnal, yet they tend to fly toward light. An old superstition holds that white moths fluttering around lights in the evening are actually the souls of the recently dead.
The long coil seen on the head of the moth on this cover is the proboscis, a hollow tube through which it sucks up food. The proboscis is actually formed of two rounded tubes joined together by a third tube. When the moth is feeding blood flows through the two outer tubes, forcing the proboscis to straighten. When feeding is done the blood stops flowing to these tubes, allowing the proboscis to coil up and out of the way. All moths and butterflies have such a feeding "tube." Most moths feed exclusively on nectar, preferring flowers that are white or green and that can be seen at night. Their feeding activities make moths and butterflies extremely efficient pollenizers. Some moths, however, have developed proboscises that are strong enough to penetrate fruits. UNIX and its attendant programs can be unruly beasts. Nutshell Handbooks help you tame them.
Edie Freedman designed this cover and the entire UNIX bestiary that appears on the Nutshell Handbooks. The beasts themselves are adapted from 19th-century engravings from the Dover Pictorial Archive. The cover layout was produced with Quark XPress 3.3 using the ITC Garamond font.
The inside layout was designed by Nancy Priest and implemented in FrameMaker 5.0 by Mike Sierra. The text and heading fonts are ITC Garamond Light and Gara mond Book. The illustrations that appear in the book were created in Macromedia Freehand 5.0 by Chris Reilley. This colophon was written by Clairemarie Fisher O'Leary.
