Oracle PL/SQL Programming, Second Edition

Corrections and Amplifications

  As much as we try to make everything perfect, yes, there are some bloopers in this 950-page tome. 

This is a list of the problems that we or others have discovered.  If you find problems with the book,  email it to us, and, in addition to our undying gratitude, we will print your name here along with the correction. 
 

  --Steven Feuerstein and Bill Pribyl 
 

[Book Cover]

 
 
Click here to read about other great Oracle books from O'Reilly & Associates. 
 
 
 

 

New for 1998: The authors are teaching a series of one-day  PL/SQL seminars in a city near you! 

 

 
 

Check out the PL/SQL Pipeline, a forum for PL/SQL developers, sponsored by Revealnet. 
 
 
 
 
 

Did you know...that you can download from Oracle a free utility for editing PL/SQL source code?  If you're an Emacs user, have a look here. 
 
 
 
 

Visit the International Oracle Users Group-Americas web site for information about upcoming Oracle-related events in your area. 
 
 
 
 
 

The latest scoop on Oracle's web server technology isn't at www.oracle.com, it's at http://www.olab.com/ .

Chapter 6: Database Interaction and Cursors

The text should be changed as follows: 
    Sometimes you will not explicitly open close a cursor; instead the PL/SQL engine will perform this operation for you.
Thanks Kim Heckler!
--Posted 15 April 1998

Chapter 4: Tips for Creating and Using Variables

On page 137, the comment within the code segment on this page ends with '*?' instead of '*/'. 

Thanks again to Kim Heckler. 

--Posted 15 April 1998 

Appendix C: Built-In Packages

Appendix C contains inaccurate information about the DBMS_AQ package. Many aspects of Oracle Advanced Queuing changed between final beta and production release of Oracle8. This page contains an up-to-date summary of Oracle AQ and documentation of the packaged program headers. 
 --Posted 5 Feb 1998

Chapter 8: Exception Handlers

On page 265, the source code for the delete_company procedure contains the declaration of a variable that is not used in the body.  Delete the following line from the code: 
    error_info VARCHAR2 (30) -- Info extracted from error_msg
Thanks to  jhodges@uswest.com for catching this error. 
 

On page 268, in a discussion of what happens when you call RAISE_APPLICATION_ERROR, the text states that Execution of the current PL/SQL block halts immediately, and all effects of the program are rolled back.  The following text is a more accurate description of what really happens: 

    Execution of the current PL/SQL block halts immediately, and any changes made to OUT or IN OUT arguments (if present) will be reversed. Changes made to global data structures, such as packaged variables, and to database objects (by executing an INSERT, UPDATE or DELETE) will not be rolled back. You must execute an explicit ROLLBACK in your exception section to reverse the effect of DML operations. 
Also, at the bottom of the page, replace the pseudo-word "frontend" with "front-end." 
--Posted 5 Feb 1998

Chapter 18 & Chapter 19 

Synonyms

On page 614 and page 688, a sidebar states that synonyms are disallowed for user-defined types. While that was true in a pre-release version of Oracle8, it is not true in the production release (8.0.3 and later). 
    CREATE SYNONYM foo_t FOR Foo_t;      -- legal in 8.0.3 and later 
          --Posted 28 Jan 98

Chapter 7: Loops

On page 220, in a paragraph regarding the use of the keyword REVERSE, the second sentence should be revised as follows:
    If the first number is less greater than the second number, the body of the loop will not execute at all.
Thanks Kim Heckler.
--Posted 15 April 98


On page 231, there is a discussion of "Scope with labels" which unfortunately uses a WHILE loop as the outer loop as the outer loop (instead of a FOR loop).  This causes most of the text surrounding the example to be incorrect. 
<<year_loop>> 
WHILE date_number <= 1995    --this is wrong 
LOOP 
   ...
should read: 
<<year_loop>> 
FOR date_number IN 1994 .. 1999 
LOOP 
   ...
Thanks to Richard Bolz for catching this one! 
      --Posted 22 Dec 97

Chapter 18: Object Types

On pages 641-2, in Table 18-4, the SQL WHERE clauses have incorrect capitalization of the literal string for the Foo_t user-defined type name. All user-defined type names are, by default, stored in upper case in the data dictionary.  That is, instead of: 
WHERE type_name = 'FOO_t'  --wrong
...the text should in fact read: 
WHERE type_name = 'FOO_T' 


Also on page 641, in Table 18-4, the last row at the bottom of the page refers to a column in user_tables that existed in Oracle 8.0.2 but is not present in 8.0.3. 
SELECT table_name 
  FROM user_tables 
 WHERE table_type = 'FOO_T';    -- invalid
In fact, Oracle removed all "object tables" -- that is, tables which are defined on object types -- from the user_tables view.  A new data dictionary view, user_object_tables, contains information about object tables.  So the query we were attempting should be expressed as follows: 
SELECT table_name 
  FROM user_object_tables 
 WHERE table_type = 'FOO_T';
      --Posted 30 Oct 97

 Chapter 5: Conditional and Sequential Control

On page 144, the IF-ELSIF example at the bottom of the page has two typographical errors.  First is an extraneous parenthesis; also, the OR in the second ELSIF should be an AND. 
IF (order_date > SYSDATE AND order_total >= min_order_total 
THEN 
   fill_order (order_id, 'HIGH PRIORITY'); 

ELSIF order_date < SYSDATE OR order_date = SYSDATE 
THEN 
   fill_order (order_id, 'LOW PRIORITY'); 

ELSIF order_date <= SYSDATE OR AND order_total < min_order_total 
THEN 
   queue_order_for_addtl_parts (order_id); 

ELSIF order_total = 0 
THEN 
   MESSAGE (' No items have been placed in this order!'); 
END IF;

A big thank-you goes to Arthur Volbert for catching this error! 
      --Posted 8 Oct 97

Chapter 19: Nested Tables and VARRAYs

On page 674, the example of MULTISET is missing a closing parenthesis (show below in red): 
SELECT CAST (MULTISET (SELECT field FROM table) AS collection-type) 
   FROM DUAL; 
--Posted 2 Oct 97
Last Modified 15 April 1998