The SQL language has established itself as the linqua franca database management; it provides the basis for systems interoperability, application portability, client/server operation, distributed database, and more, and is supported by just about every DBMS on the market today. SQL2 - or, to give it its official name, the International Standard Database language SQL (1992) - represents a major set of extensions to the earlier SQL standard. For a start, the new specification is well over 600 pages, compared with less than 100 for the original version. No database professional can afford to ignore it.
Errata
Known errors in first printing
Date of this list- March 5th, 1997
Page 31, Section 3.3- PAD and SPACE are reserved key words, not nonreserved; MESSAGE_TEXT is an additional nonreserved key word.
Page 112, first paragraph- Replace the last sentence ("Omitting the parenthesized ... within that table.") by the following-
The parenthesized commalist of column names, if included, must not specify the same column twice; omitting that commalist -- the practice is not recommended -- is equivalent to including one that specifies all of the columns of the target table, in their left-to-right order within that table.
Page 113, last paragraph- Insert the following immediately before the sentence "The rows of T ... in the SET clause."-
The assignment-commalist must not include two assignments to the same column.
Page 160- Replace the first block of cp text on this page by the following-
SELECT DISTINCT SP.PNO, ( SELECT MAX ( SPX.QTY )
FROM SP AS SPX
WHERE SPX.PNO = SP.PNO
AND SPX.SNO 'S1' ) AS XXX,
( SELECT MIN ( SPX.QTY )
FROM SP AS SPX
WHERE SPX.PNO = SP.PNO
AND SPX.SNO 'S1' ) AS YYY
FROM SP
WHERE SP.SNO 'S1'
Page 161- Replace the sole block of cp text on this page by the following-
SELECT ZZZ AS PNO, ( SELECT MAX ( QTY )
FROM SP
WHERE PNO = ZZZ
AND SNO 'S1' ) AS XXX,
( SELECT MIN ( QTY )
FROM SP
WHERE PNO = ZZZ
AND SNO 'S1' ) AS YYY
FROM ( SELECT DISTINCT PNO AS ZZZ
FROM SP
WHERE SNO 'S1' ) AS POINTLESS
Page 269, sentence beginnining "Observe" (immediately below first figure)- The final period should be outside the closing parenthesis, not inside it.
ERRATA
The Persistent Stored Modules feature (PSM) was ratified in late 1996. As a consequence, the text of Appendix E requires a number of technical revisions and clarifications (most of them fairly minor in nature). The most significant are summarized below, with an indication of those pages primarily affected.
Passim- PSM parameter and SQL variable names do not include a colon prefix. References to names are resolved according to the sequence column (highest precedence), variable, parameter (lowest precedence).
Pages 465-466- Module definitions do not contain a LANGUAGE specification, routine definitions do. LANGUAGE SQL is the default.
Page 466- The prohibition against recursion described in the footnote is now in dispute.
Pages 467ff- The [NOT] DETERMINISTIC and READS or MODIFIES SQL DATA specifications (see pages 489-490) apply not only to external routines but to SQL routines as well.
Pages 469 and 480- SQL routines cannot contain SQL dynamic statements; server modules cannot contain temporary table, cursor, or dynamic cursor definitions.
Page 471- The situation discussed in the first bullet item (in which a PSM routine invocation appears in a DEFAULT clause) cannot occur.
Pages 481-482- PSM does include the FOR statement.
Page 483- SQL domains cannot be used to specify the data type of SQL variables, nor can statement labels be used as high-level qualifiers on references to such variables.
Page 491- The following are additional key words-
CONDITION_IDENTIFIER, CONTAINS,
PARAMETER_NAME, ROUTINE_CATALOG,
ROUTINE_NAME, ROUTINE_SCHEMA,
SPECIFIC_NAME. Of these, CONTAINS (only) is reserved.
REDO is not a key word.
Page 492- CALL is the only preparable SQL control statement. FOR is transaction-initiating and LEAVE is not; the other statements are "possibly" transaction-initiating.
Page 493- Support for server modules is optional.
Several changes have occurred in the SQL standards world since the previous edition of this book was published. First of all, a major new component, the Call-Level Interface (SQL/CLI), was added to the standard in 1995. Second, another major new component, the Persistent Stored Modules feature (SQL/PSM), is currently under development (and indeed nearing completion); SQL/PSM is not yet part of the standard but is virtually certain to become so in the near future. Third, the original standard itself has been significantly changed and corrected through the publication of two Technical Corrigenda, one in 1994 and one in 1996. Taken together, these changes are more than sufficient to justify this new (fourth) edition. At the same time, I have taken the opportunity to extend and improve the text throughout in numerous ways, and in particular to correct a few errors. It is not an exaggeration to say that scarcely a sentence survives intact from the third edition.
Acknowledgments
Once again I must thank my coauthor Hugh Darwen for his invaluable contribution (especially in connection with the SQL/PSM and SQL3 appendixes). I would also like to thank Paul Cotton and Frank Pellow for their help with the material on SQL/CLI; Peter Pistor for pointing out an error in the treatment of foreign keys in the previous edition; Mike Sykes for assistance with questions regarding SQL's date and time support (especially in connection with time zones); and Mel Zimowski for assistance with questions regarding SQL's "global transaction" support. I am also indebted to Nelson Mattos, Frank Pellow, and Jeff Richey for their careful reviews of the manuscript.
Finally, I am (as always) deeply indebted to my wife, Lindy, for her support throughout this project; to my editor, Elydia Davis, for her usual sterling job; and to the staff at Addison-Wesley for their usual help and professionalism. Once again it has been a pleasure to work with them.
Healdsburg, California
C. J. Date
1996
0201964260P04062001