Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 50 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
50
Dung lượng
251,64 KB
Nội dung
Previous: About the Disk
Preface
Next: Acknowledgments
Comments and Questions
Please address comments and questions concerning this book to the publisher:
O'Reilly & Associates
101 Morris Street
Sebastopol, CA 95472
1-800-998-9938 (in the U.S. or Canada)
1-707-829-0515 (international or local)
1-707-829-0104 (FAX)
You can also send us messages electronically. See the insert in the book for information about
O'Reilly & Associates' online services.
For corrections and amplifications for the book, check out
http://www.oreilly.com/catalog/oraclep2/.
If you have any questions about the disk supplied with this book, contact RevealNet Inc. at http://
www.revealnet.com.
Previous: About the Disk
Oracle PL/SQL
Programming, 2nd Edition
Next: Acknowledgments
About the Disk
Book Index
Acknowledgments
The Oracle Library
Navigation
Copyright (c) 2000 O'Reilly & Associates. All rights reserved.
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Previous: Which Platform
or Version?
Preface
Next: Comments and
Questions
About the Disk
The content of the companion Windows disk for this book has been included on this CD, in the /
prog2/disk/ directory. This disk contains the Companion Utilities Guide for Oracle PL/SQL
Programming, an online tool developed by RevealNet, Inc. that gives you point-and-click access to
more than 100 files of source code and documentation that we developed. Many of the code examples
are also printed in the book. We've included these to give you a jump start on writing your own PL/
SQL code and to keep you from having to type many pages of PL/SQL statements from printed text.
Appendix A, describes how to install the Windows-based interface. You can run the software in any
Microsoft Windows environment. If you are working in a non-Windows environment, you can obtain
a compressed file containing the utilities on the desk from the RevealNet PL/SQL Pipeline Archives
at
http://www.revealnet.com/plsql-pipeline.
Previous: Which Platform
or Version?
Oracle PL/SQL
Programming, 2nd Edition
Next: Comments and
Questions
Which Platform or Version?
Book Index
Comments and Questions
The Oracle Library
Navigation
Copyright (c) 2000 O'Reilly & Associates. All rights reserved.
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Previous: Conventions
Used in This Book
Preface
Next: About the Disk
Which Platform or Version?
In general, all of the discussions and examples in this book apply regardless of the machine and/or
operating system you are using. In those few cases where a feature is in any way system-dependent, I
note that in the text.
There are many versions of PL/SQL, and you may even find that you need to use multiple versions in
your development work.
Chapter 1, Introduction to PL/SQL describes in detail the many versions of
PL/SQL and what you need to know about them; see
Section 1.4, "PL/SQL Versions" in Chapter 1 in
Chapter 1.
Previous: Conventions
Used in This Book
Oracle PL/SQL
Programming, 2nd Edition
Next: About the Disk
Conventions Used in This
Book
Book Index
About the Disk
The Oracle Library
Navigation
Copyright (c) 2000 O'Reilly & Associates. All rights reserved.
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Previous: Audience
Preface
Next: Which Platform or
Version?
Conventions Used in This Book
The following conventions are used in this book:
Italic
is used for file and directory names.
Constant width
is used for code examples.
Constant width bold
In some code examples, highlights the statements being discussed.
Constant width italic
In some code examples, indicates an element (e.g., a filename) that you supply.
UPPERCASE
In code examples, indicates PL/SQL keywords.
lowercase
In code examples, indicates user-defined items such as variables, parameters, etc.
punctuation
In code examples, enter exactly as shown.
indentation
In code examples, helps to show structure but is not required.
In code examples, a double hyphen begins a single-line comment, which extends to the end of
a line.
/* and */
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
In code examples, these characters delimit a multiline comment, which can extend from one
line to another.
.
In code examples and related discussions, a dot qualifies a reference by separating an object
name from a component name. For example, dot notation is used to select fields in a record
and to specify declarations within a package.
< >
In syntax descriptions, angle brackets enclose the name of a syntactic element.
[ ]
In syntax descriptions, square brackets enclose optional items.
In syntax descriptions, an ellipsis shows that statements or clauses irrelevant to the discussion
were left out.
Previous: Audience
Oracle PL/SQL
Programming, 2nd Edition
Next: Which Platform or
Version?
Audience
Book Index
Which Platform or Version?
The Oracle Library
Navigation
Copyright (c) 2000 O'Reilly & Associates. All rights reserved.
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Previous: Structure of This
Book
Preface
Next: Conventions Used in
This Book
Audience
This book was designed to be used by anyone who needs to develop Oracle-based applications using
the PL/SQL programming language. There are a number of distinct audiences:
Role How to Use the Book
Information systems manager The application development or database
administration manager in an Oracle shop needs a
thorough grasp of the technology used in the
development groups. Familiarity with the
technology will help the manager to better
understand the challenges faced by the team
members and the ability of that team to solve
problems. These managers will want to pay
particular attention to
Part 4, for the big picture of
structuring PL/SQL-based applications.
One-person information systems shop Oracle licenses are frequently sold into small
companies or departments where the supporting
information systems organization consists of little
more than a single manager and single developer (or
perhaps both of those functions rolled into one).
These small organizations do not have the time to
search through multiple manuals or sets of training
notes to find the solution to their problems. This
book offers one-stop shopping for these people a
consolidated reference and solutions source.
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Database administrator The DBA in the world of Oracle7 needs to build
database triggers and stored procedures in order to
manage business rules at the RDBMS levels and
implement distributed databases. The DBA will use
this book to strengthen his or her understanding of
how to write efficient RDBMS-level objects. This
book will also discuss constructing packages of
related objects which will reduce the resources
required to maintain these objects.
New developer in the Oracle
Developer/2000 environment
Many developers arrive fresh on the Oracle scene
through the use of the new Oracle Developer/2000
tools in the Windows environment. These
developers will be comfortable manipulating the
various widgets in the GUI world, but will find PL/
SQL to be a strange, new partner for development.
This book will quickly bring them up to speed and
make them more productive users of Oracle
Developer/2000 software.
Experienced Oracle developer Many thousands of programmers have spent years
writing, debugging, and maintaining programs
written in SQL*Forms, SQL*Reportwriter,
SQL*Plus, and SQL*Menu. While their PL/SQL
skills have progressed to meet the needs of specific
applications, most could expand both their PL/SQL
knowledge and their awareness of its subtleties. In
addition, as developers move into the Oracle
Developer/2000 generation, PL/SQL plays a
significantly more central role; the developer will
have to gain new expertise to meet the demands of
this change.
Consultant Consultants must offer a high level of service and
quality to their customers. This added value is
measured in productivity and in the application of
skills not currently held by the client. Consultants
should find this book an invaluable aid in deepening
their understanding of PL/SQL technology.
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Previous: Structure of This
Book
Oracle PL/SQL
Programming, 2nd Edition
Next: Conventions Used in
This Book
Structure of This Book
Book Index
Conventions Used in This
Book
The Oracle Library
Navigation
Copyright (c) 2000 O'Reilly & Associates. All rights reserved.
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Previous: Objectives of
This Book
Preface
Next: Audience
Structure of This Book
This second edition has changed from the first edition in a number of significant ways. Before listing
the individual parts of the book, I want to explain the overall restructuring.
About the Second Edition
We (the authors and O'Reilly & Associates) are committed to providing comprehensive, useful
coverage of the PL/SQL language over the life of this language. The first edition of this book covered
most of PL/SQL's features as it existed through PL/SQL Release 2.3. With the release of Oracle8,
however, we faced a challenge: how do we fit all the new technologies of PL/SQL8 into Oracle PL/
SQL Programming and fill out coverage of existing elements of PL/SQL without creating a tome so
unwieldy that reading the book becomes as much a physical as a mental workout?
Furthermore, if we look ahead a few years, we can easily expect that Oracle will continue to roll out
expanded functionality in the objects area, as well as providing new and enhanced built-in packages.
Given this situation, it quickly became clear to us that it was not practical to offer a single text which
covered "all things PL/SQL."
Two questions then arose: what do we cut and what do we do with the stuff that we cut? The answers
are as follows:
● Move the package examples from the printed text to the disk. The second edition's disk offers
a Windows-based interface designed by RevealNet, Inc. (http://www.revealnet.com) allowing
you rapid access to the many utilities and samples. Now, instead of having to look through a
directory listing and then using an editor to view those files, you will be able to mouse-click
and drill-down your way to the topics in which you are interested. We take advantage of this
interface to give you an easy way to examine the many examples of packages I built for the
book.
● Remove the chapter on built-in packages and expand it into a complete book. This chapter in
the first edition offered lots of good information, but it was not comprehensive and simply
couldn't keep growing to absorb all the new technology issuing forth from Oracle
headquarters. Moving coverage of built-in packages to its own book will give us room to
provide more and better information about this key element of the PL/SQL language.
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Appendix A, What's on the Companion Disk?, of this edition of Oracle PL/SQL Programming
will still provide a quick reference to the more common built-in packages.
About the Contents
The second edition of Oracle PL/SQL Programming is divided into seven parts:
Part 1, Programming in PL/SQL
Chapters 1 through 3 explain what it means to program in PL/SQL and in Oracle-based
applications in general. This part of the book introduces you to the main features of the PL/
SQL language and gives you some general advice on programming habits and effective
coding style.
Part 2, PL/SQL Language Elements
Chapters 4 through 10 describe the basic PL/SQL programming components variables,
cursors, conditional and sequential control statements, loops, exception handlers, PL/SQL
records, and PL/SQL tables. These chapters contain numerous examples, along with tips on
how, when, and where to apply these programming constructs most effectively. When you
complete this section of the book you will know how to apply all the constructs of the PL/SQL
language. You will also be able to examine the complex requirements in your own
applications and use the different parts of PL/SQL to implement those requirements.
Part 3, Built-In Functions
Chapters 11 through 14 present the many built-in (predefined) PL/SQL functions and
procedures, which you can put to use immediately in your applications. One of the key
barometers of your success with PL/SQL will be the extent to which you know how to
leverage all of the capabilities that Oracle Corporation provides. (You don't want to have to
reinvent the wheel when so many functions and procedures are provided for you.) Appendix
C, Built-In Packages supplements Part 3 by summarizing the syntax of Oracle's built-in
packages.
Part 4, Modular Code
Chapters 15 through 17 take you past the individual components of the PL/SQL language to
explore modular construction in PL/SQL. You will learn how to build procedures, functions,
and packages; more than that, you will learn how to build them correctly. More than with any
other aspect of code, the way you design your modules has an enormous impact on your
applications' development time, reusability, and maintainability.
Part 5, New PL/SQL8 Features
Chapters 18 through 21 contain the main discussion of the new features of Oracle8 in
particular, object types, new types of collections (nested tables and VARRAYs), object views,
and external procedures. Although we describe Oracle8 enhancements as appropriate in other
sections of the book, we localize the major discussion here. Doing so allows developers new
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
[...]... Language Support in Oracle This book does not offer comprehensive coverage of Oracle' s National Language Support (NLS) capabilities for developing applications for multiple languages Trusted OracleOracle Corporation has developed a special version of its Oracle7 Server for high-security environments This book does not detail the additional datatypes and features available only for Trusted Oracle Please... very few titles in my Oracle collection of more than 70 books that is actually dog-eared from use All of my colleagues already know the book intimately I have known Steven Feuerstein and his work for a long time through my publishing of Oracle technical publications: the NY Oracle Users newsletter in 1989; the Oracle User Resource newsletter from 1990 to 1994; the International Oracle Users Journal... Data Definition Language (DDL) of Oracle' s SQL Application and database tuning I don't cover detailed tuning issues in this book, though the second edition does add a chapter on PL/SQL tuning Oracle Performance Tuning by Peter Corrigan and Mark Gurry (O'Reilly & Associates, Second Edition, 1997) gives you all the information you need about tuning your Oracle applications Oracle tool-specific technologies... provided by Oracle Corporation to build complex systems that manage vast quantities of data At the heart of much of Oracle' s software is PL/SQL a programming language that provides procedural extensions to the SQL relational database language and an ever-growing range of Oracle development tools PL/SQL figures prominently as an enabling technology in almost every new product released by Oracle Corporation... q q Implementing crucial business rules in the Oracle Server with PL/SQL-based stored procedures and database triggers Enhancing powerful and easy-to-use GUI interfaces of products like Oracle Developer/2000 with detailed, programmatic control Employing object-oriented design principles in Oracle- based applications Linking a World Wide Web page to an Oracle database Perhaps most importantly, PL/SQL... thousands of users on the Internet Oracle is even promising that you will be able to execute Java in the database server itself and write stored procedures in Java rather than PL/SQL So why aren't we rushing off to learn Java? Because even with all of the hoopla over Java, PL/SQL is still the best way to build programs to access data in Oracle7 and Oracle8 databases After Oracle began using PL/SQL to build... technologies as SQL*Forms and Oracle Forms triggers Similarly, you won't find detailed discussions of repeating frames of Oracle Reports in here Nevertheless, many of the techniques offered in this book certainly do apply to the Oracle Developer/2000 environment Third-party application development software There are many alternatives to using PL/SQL and the tools supplied by Oracle to build your applications... 1990 to 1992; the Proceedings of the East Coast Oracle Developers Conference from 1991 to 1996; and since 1994, Pinnacle Publishing's Oracle Developer Steven has been my most prolific and admired writer for more than seven years Now that Steven (with the able help of Bill Pribyl) has updated the original version of Oracle PL/ SQL Programming, I advise every Oracle developer to replace his or her own well-utilized... "poor man's objects" User-defined datatypes such as objects and nested tables (with the Oracle objects option) PL/SQL is integrated tightly into Oracle' s SQL language: you can execute SQL statements directly from your procedural program Conversely, you can also call PL/SQL functions from within a SQL statement Oracle developers who want to be successful in the 1990s and beyond must learn to use PL/SQL... PL/SQL logic With these new improvements, PL/SQL8 assumes even more importance as the principal data access language for Oracle8 Oracle has been methodically enhancing the capabilities of PL/SQL to make it the language of choice for developing distributed computing environments When Oracle finally delivers client-side PL/SQL with the full characteristics of server-side code (effectively turning all clients . of Oracle
technical publications: the NY Oracle Users newsletter in 1989; the Oracle User Resource newsletter
from 1990 to 1994; the International Oracle. applications for
multiple languages.
● Trusted Oracle. Oracle Corporation has developed a special version of its Oracle7 Server for
high-security environments.