Oracle PL/SQL Programming, 4th Edition
Download an excerpt:
Chapter 20: Managing PL/SQL Code
Excerpt provided courtesy of O'Reilly and Associates.
|
Be the First to Write a Review and tell the world about this title!People who purchase this book frequently purchase: Books on similar topics, in best-seller order:Books from the same publisher, in best-seller order:
For the past ten years, O'Reilly's Oracle PL/SQL Programming has been
the bestselling book on PL/SQL, Oracle's powerful procedural language. Packed
with examples and helpful recommendations, the book has helped everyone--from
novices to experienced developers, and from Oracle Forms developers to database
administrators--make the most of PL/SQL.
The fourth edition is a comprehensive update, adding significant new content
and extending coverage to include the very latest Oracle version, Oracle Database
10g Release 2. It describes such new features as the PL/SQL optimizing
compiler, conditional compilation, compile-time warnings, regular expressions,
set operators for nested tables, nonsequential collections in FORALL, the programmer-defined
quoting mechanism, the ability to backtrace an exception to a line number, a
variety of new built-in packages, and support for IEEE 754 compliant floating-point
numbers.
The new edition adds brand-new chapters on security (including encryption, row-level
security, fine-grained auditing, and application contexts), file, email, and
web I/O (including the built-in packages DBMS_OUTPUT, UTL_FILE, UTL_MAIL, UTL_SMTP,
and UTL_HTTP) and globalization and localization.
Co-authored by the world's foremost PL/SQL authority, Steven Feuerstein, this
classic reference provides language syntax, best practices, and extensive code,
ranging from simple examples to complete applications--making it a must-have
on your road to PL/SQL mastery. A companion web site contains many more examples
and additional technical content for enhanced learning.
Table of Contents
Preface
Part I. Programming in PL/SQL
1. Introduction to PL/SQL
What Is PL/SQL?
The Origins of PL/SQL
So This Is PL/SQL
About PL/SQL Versions
Resources for PL/SQL Developers
Some Words of Advice
2. Creating and Running PL/SQL Code
SQL*Plus
Performing Essential PL/SQL Tasks
Calling PL/SQL from Other Languages
3. Language Fundamentals
PL/SQL Block Structure
The PL/SQL Character Set
Identifiers
Literals
The Semicolon Delimiter
Comments
The PRAGMA Keyword
Labels
Part II. PL/SQL Program Structure
4. Conditional and Sequential Control
IF Statements
CASE Statements and Expressions
The GOTO Statement
The NULL Statement
5. Iterative Processing with Loops
Loop Basics
The Simple Loop
The WHILE Loop
The Numeric FOR Loop
The Cursor FOR Loop
Loop Labels
Tips for Iterative Processing
6. Exception Handlers
Exception-Handling Concepts and Terminology
Defining Exceptions
Raising Exceptions
Handling Exceptions
Building an Effective Error Management Architecture
Making the Most of PL/SQL Error Management
Part III. PL/SQL Program Data
7. Working with Program Data
Naming Your Program Data
Overview of PL/SQL Datatypes
Declaring Program Data
Programmer-Defined Subtypes
Conversion Between Datatypes
8. Strings
String Datatypes
Working with Strings
String Function Quick Reference
9. Numbers
Numeric Datatypes
Number Conversions
Numeric Functions
10. Dates and Timestamps
Datetime Datatypes
Getting the Date and Time
Interval Datatypes
Datetime Conversions
Date and Timestamp Literals
Interval Conversions
Interval Literals
CAST and EXTRACT
Datetime Arithmetic
Date/Time Functions
11. Records
Records in PL/SQL
12. Collections
Collections Overview
Collection Methods (Built-Ins)
Working with Collections
Nested Table Multiset Operations
Maintaining Schema-Level Collections
13. Miscellaneous Datatypes
The BOOLEAN Datatype
The RAW Datatype
The UROWID and ROWID Datatypes
The LOB Datatypes
Working with LOBs
Predefined Object Types
Part IV. SQL in PL/SQL
14. DML and Transaction Management
DML in PL/SQL
Bulk DML with the FORALL Statement
Transaction Management
Autonomous Transactions
15. Data Retrieval
Cursor Basics
Working with Implicit Cursors
Working with Explicit Cursors
BULK COLLECT
SELECT . . . FOR UPDATE
Cursor Variables and REF CURSORs
Cursor Expressions
16. Dynamic SQL and Dynamic PL/SQL
NDS Statements
Binding Variables
Working with Objects and Collections
Dynamic PL/SQL
Recommendations for NDS
When to Use DBMS_SQL
NDS Utility Package
Part V. PL/SQL Application Construction
17. Procedures, Functions, and Parameters
Modular Code
Procedures
Functions
Parameters
Local Modules
Module Overloading
Forward Declarations
Advanced Topics
Go Forth and Modularize!
18. Packages
Why Packages?
Rules for Building Packages
Rules for Calling Packaged Elements
Working with Package Data
When to Use Packages
Packages and Object Types
19. Triggers
DML Triggers
DDL Triggers
Database Event Triggers
INSTEAD OF Triggers
AFTER SUSPEND Triggers
Maintaining Triggers
20. Managing PL/SQL Code
Managing Code in the Database
Using Native Compilation
Using the Optimizing Compiler and Compile-Time Warnings
Conditional Compilation
Testing PL/SQL Programs
Debugging PL/SQL Programs
Tuning PL/SQL Programs
Protecting Stored Code
21. I/O and PL/SQL
Displaying Information
Reading and Writing Files
Sending Email
Working with Web-Based Data (HTTP)
Other Types of I/O Available in PL/SQL
Part VI. Advanced PL/SQL Topics
22. Application Security and PL/SQL
Security Overview
Encryption
Row-Level Security
Application Contexts
Fine-Grained Auditing
23. Inside PL/SQL
Looking Under the Hood
PL/SQL's Optimizing Compiler
Dependency Management
Execution Authority Models
PL/SQL and Oracle Memory
Server-Side PL/SQL Processing: Reprise
What You Need to Know
24. Globalization and Localization in PL/SQL
Overview and Terminology
Unicode Primer
Character Semantics
String Sort Order
Multilingual Information Retrieval
Date/Time
Currency Conversion
Globalization Development Kit for PL/SQL
25. Object-Oriented Aspects of PL/SQL
Introduction to Oracle's Object Features
An Extended Example
Object Views
Maintaining Object Types and Object Views
Pontifications
26. Calling Java from PL/SQL
Oracle and Java
Getting Ready to Use Java in Oracle
A Simple Demonstration
Using loadjava
Using dropjava
Managing Java in the Database
Using DBMS_JAVA
Publishing and Using Java in PL/SQL
27. External Procedures
Introduction to External Procedures
The Oracle Net Configuration
Setting Up Multithreaded Mode
Creating an Oracle Library
Writing the Call Specification
Raising an Exception from the Called C Program
Nondefault Agents
Maintaining External Procedures
A. Regular Expression Metacharacters and Function Parameters
B. Number Format Models
C. Date Format Models
Index
About the Author
Steven Feuerstein is considered one of the world's leading experts on the
Oracle PL/SQL language. He is the author or coauthor of Oracle PL/SQL Programming,
Oracle PL/SQL Best Practices, Oracle PL/SQL Programming: Guide
to Oracle8i Features, Oracle PL/SQL Developer's Workbook, Oracle
Built-in Packages, Advanced Oracle PL/SQL Programming with Packages,
and several pocket reference books (all from O'Reilly). Steven is a Senior Technology
Advisor with Quest Software, has been developing software since 1980, and worked
for Oracle Corporation from 1987 to 1992. He is currently designing and building
Qnxo www.qnxo.com, the world's first active mentoring software.
|