100% found this document useful (4 votes)
151 views

Pkg Oracle Developer PL SQL Prog Oracle CD Joan Casteel All Chapters Instant Download

SQL

Uploaded by

mechtahoweda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (4 votes)
151 views

Pkg Oracle Developer PL SQL Prog Oracle CD Joan Casteel All Chapters Instant Download

SQL

Uploaded by

mechtahoweda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

Download the full version of the ebook at ebookname.

com

Pkg Oracle Developer PL SQL Prog Oracle CD Joan


Casteel

https://ebookname.com/product/pkg-oracle-developer-pl-sql-
prog-oracle-cd-joan-casteel/

OR CLICK BUTTON

DOWNLOAD EBOOK

Download more ebook instantly today at https://ebookname.com


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Oracle 12c SQL 3rd Edition Joan Casteel

https://ebookname.com/product/oracle-12c-sql-3rd-edition-joan-casteel/

ebookname.com

Oracle PL SQL Programming Third Edition Steven Feuerstein

https://ebookname.com/product/oracle-pl-sql-programming-third-edition-
steven-feuerstein/

ebookname.com

Oracle PL SQL Best Practices 2nd Edition Steven Feuerstein

https://ebookname.com/product/oracle-pl-sql-best-practices-2nd-
edition-steven-feuerstein/

ebookname.com

Hormone Replacement Therapy and the Menopause 1st Edition


Michael S. Marsh

https://ebookname.com/product/hormone-replacement-therapy-and-the-
menopause-1st-edition-michael-s-marsh/

ebookname.com
Cancer Genomics 1st Edition L. A. Cannizzaro

https://ebookname.com/product/cancer-genomics-1st-edition-l-a-
cannizzaro/

ebookname.com

Asymptotic Statistics With a View to Stochastic Processes


1st Edition Reinhard Höpfner

https://ebookname.com/product/asymptotic-statistics-with-a-view-to-
stochastic-processes-1st-edition-reinhard-hopfner/

ebookname.com

Volatility Trading Second Edition Euan Sinclair(Auth.)

https://ebookname.com/product/volatility-trading-second-edition-euan-
sinclairauth/

ebookname.com

Advanced high strength steels science technology and


applications 1st Edition Mahmoud Y. Demeri

https://ebookname.com/product/advanced-high-strength-steels-science-
technology-and-applications-1st-edition-mahmoud-y-demeri/

ebookname.com

The Essential Victor Hugo Oxford World s Classics Victor


Hugo

https://ebookname.com/product/the-essential-victor-hugo-oxford-world-
s-classics-victor-hugo/

ebookname.com
Powders and solids developments in handling and processing
technologies 1st Edition W. Hoyle

https://ebookname.com/product/powders-and-solids-developments-in-
handling-and-processing-technologies-1st-edition-w-hoyle/

ebookname.com
ORACLE® 11g: PL/SQL
PROGRAMMING

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
ORACLE® 11g: PL/SQL
PROGRAMMING
Second Edition

Joan Casteel

Australia • Brazil • Japan • Korea • Mexico • Singapore • Spain • United Kingdom • United States

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
This is an electronic version of the print textbook. Due to electronic rights restrictions, some third party content may be suppressed. Editorial
review has deemed that any suppressed content does not materially affect the overall learning experience. The publisher reserves the right to
remove content from this title at any time if subsequent rights restrictions require it. For valuable information on pricing, previous
editions, changes to current editions, and alternate formats, please visit www.cengage.com/highered to search by
ISBN#, author, title, or keyword for materials in your areas of interest.

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Oracle® 11g: PL/SQL Programming, © 2013 Course Technology, Cengage Learning
Second Edition
WCN: 02-200-203
by Joan Casteel
ALL RIGHTS RESERVED. No part of this work covered by the copyright
Editor-in-Chief: Joe Sabatino herein may be reproduced, transmitted, stored or used in any form or by
Senior Acquisitions Editor: any means—graphic, electronic, or mechanical, including but not limited
Charles McCormick, Jr. to photocopying, recording, scanning, digitizing, taping, Web distribution,
information networks, or information storage and retrieval systems,
Senior Product Manager: Kate Mason
except as permitted under Section 107 or 108 of the 1976 United States
Development Editor: Lisa M. Lord Copyright Act—without the prior written permission of the publisher.
Editorial Assistant: Anne Merrill
Art and Cover Direction, Production For product information and technology assistance, contact us at
Management, and Composition: Cengage Learning Customer & Sales Support, 1-800-354-9706.
PreMediaGlobal For permission to use material from this text or product,
submit all requests online at cengage.com/permissions.
Sr. Brand Manager: Robin LeFevre
Further permissions questions can be e-mailed to
Market Development Manager: Jon Monahan [email protected].
Marketing Coordinator: Mike Saver
Media Editor: Chris Valentine Library of Congress Control Number: 2012942665
Manufacturing Coordinator: Julio Esperas Student Edition: Instructor Edition:
Cover Credit: ©binabina/iStockphoto ISBN-13: 978-1-133-94736-3 ISBN-13: 978-1-133-95551-1
ISBN-10: 1-133-94736-0 ISBN-10: 1-133-95551-7

Course Technology
20 Channel Center Street
Boston, MA 02210
USA

Some of the product names and company names used in this book have been used for
identification purposes only and may be trademarks or registered trademarks of their
respective manufacturers and sellers.
Any fictional data related to persons or companies or URLs used throughout this book is
intended for instructional purposes only. At the time this book was printed, any such data
was fictional and not belonging to any real persons or companies.
Cases in this book that mention company, organization, or persons’ names were written using
publicly available information to provide a setting for student learning. They are not intended
to provide commentary on or evaluation of any party’s handling of the situation described.
Oracle is a registered trademark, and Oracle 11g, Oracle 10g, Oracle 9i, Oracle 8i, SQL
Developer, SQL*Plus, and PL/SQL are trademarks or registered trademarks of Oracle
Corporation and/or its affiliates.
Microsoft is a registered trademark of Microsoft Corporation in the United States and/or
other countries. Course Technology is an independent entity from the Microsoft Corporation
and not affiliated with Microsoft in any manner.
TOAD is a registered trademark of Quest Software, Inc.
Disclaimers: Course Technology reserves the right to revise this publication and make
changes from time to time in its content without notice.
Course Technology, a part of Cengage Learning, reserves the right to revise this publication
and make changes from time to time in its content without notice.
Cengage Learning is a leading provider of customized learning solutions with office
locations around the globe, including Singapore, the United Kingdom, Australia, Mexico,
Brazil, and Japan. Locate your local office at: www.cengage.com/global

Printed in the United States of America


1 2 3 4 5 6 7 16 15 14 13 12

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
TABLE OF CONTENTS

Preface xi

Chapter 1 Introduction to PL/SQL 1


Introduction 1
Application Programming and PL/SQL 2
Application Programming 2
PL/SQL Advantages 3
Application Models 4
Two-Tier or Client/Server Application Model 5
Three-Tier Application Model 6
Oracle Resources 7
Web Resources 7
SQL and PL/SQL Tools 8
Software Tools for This Book 8
Third-Party PL/SQL Development Tools 10
Databases Used in This Book 11
The Brewbean’s Database 11
The DoGood Donor Database 13
The More Movies Database 14
SQL Query Review 15
Chapter Summary 22
Review Questions 23
Hands-On Assignments Part I 25
Hands-On Assignments Part II 29
Case Projects 29

Chapter 2 Basic PL/SQL Block Structures 33


Introduction 33
Programming Fundamentals 34
The Current Challenge in the Brewbean’s Application 36
PL/SQL Block Structure 37
DECLARE Section 38
BEGIN Section 38
EXCEPTION Section 38
Working with Variables 39
Working with Scalar Variables 39
Decision Structures 53
Simple IF Statements 53
IF Statement Evaluations 58
Operators in an IF Clause 61
Nested IF Statements 63
CASE Statements 63

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
vi Table of Contents

Looping Constructs 69
Basic Loops 69
WHILE Loops 72
FOR Loops 73
CONTINUE Statements 75
Common Errors in Using Looping Statements 75
Nested Loops 76
Chapter Summary 78
Review Questions 79
Advanced Review Questions 80
Hands-On Assignments Part I 82
Hands-On Assignments Part II 83
Case Projects 84

Chapter 3 Handling Data in PL/SQL Blocks 85


Introduction 85
The Current Challenge in the Brewbean’s Application 86
Rebuilding the Database 87
Including a Query in a PL/SQL Block 88
Adding an INTO Clause to a SELECT Statement 88
Encountering PL/SQL Error Messages 91
Using the %TYPE Attribute 94
Data Retrieval with Control Structures 95
Including DML Statements in a PL/SQL Block 98
Using Record Variables 101
Record Data Type 101
The Role of the %ROWTYPE Attribute 103
Record Operations 104
Working with Collections 108
Associative Arrays 108
Table of Records 111
Other Collections: VARRAYs and Nested Tables 113
Introduction to Bulk Processing 113
GOTO Statements 115
Chapter Summary 116
Review Questions 116
Advanced Review Questions 118
Hands-On Assignments Part I 119
Hands-On Assignments Part II 123
Case Projects 124

Chapter 4 Cursors and Exception Handling 125


Introduction 125
The Current Challenge in the Brewbean’s Application 126
Rebuilding the Database 126
Working with Cursors 127
Implicit Cursors 127
Explicit Cursors 130
Cursor Variables 141

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Table of Contents vii

Bulk-Processing Features 142


Exception Handlers 144
Predefined Exceptions in Oracle 144
Undefined Exceptions in Oracle 149
User-Defined Exceptions 151
Additional Exception Concepts 153
WHEN OTHERS, SQLCODE, and SQLERRM 153
The RAISE_APPLICATION_ERROR Procedure 158
Exception Propagation 158
Commenting Code 162
Chapter Summary 164
Review Questions 164
Advanced Review Questions 166
Hands-On Assignments Part I 167
Hands-On Assignments Part II 171
Case Projects 172

Chapter 5 Procedures 175


Introduction 175
The Current Challenge in the Brewbean’s Application 175
Rebuilding the Database 177
Introduction to Named Program Units 177
Types of Named Program Units 178
Making Procedures Reusable: Parameters 178
The CREATE PROCEDURE Statement 179
Creating a Procedure 181
When a CREATE PROCEDURE Statement Produces Errors 182
Testing a Procedure 185
Using the IN OUT Parameter Mode 187
Calling a Procedure from Another Procedure 188
Using the DESCRIBE Command 190
Using DBMS_OUTPUT to Assist in Debugging 191
Subprograms 195
Scope of Variables, Exception Handling, and Transactions 196
Working with Variable Scope 196
Exception-Handling Flow 198
Transaction Control Scope 202
Error Handling with RAISE_APPLICATION_ERROR 204
Removing Procedures 205
Chapter Summary 206
Review Questions 206
Advanced Review Questions 208
Hands-On Assignments Part I 209
Hands-On Assignments Part II 213
Case Projects 213

Chapter 6 Functions 215


Introduction 215
The Current Challenge in the Brewbean’s Application 215
Rebuilding the Database 217

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
viii Table of Contents

An Introduction to Functions 217


Creating a Stored Function 218
Using the OUT Parameter Mode in a Function 225
Multiple RETURN Statements 226
Using a RETURN Statement in a Procedure 228
Actual and Formal Parameter Constraints 228
Techniques of Passing Parameter Values 230
Function Purity Levels 232
Additional Program Unit Options 236
Data Dictionary Information on Program Units 236
Deleting Program Units 238
Chapter Summary 239
Review Questions 239
Advanced Review Questions 241
Hands-On Assignments Part I 243
Hands-On Assignments Part II 246
Case Projects 247

Chapter 7 PL/SQL Packages 249


Introduction 249
The Current Challenge in the Brewbean’s Application 250
Rebuilding the Database 250
Creating Packages 250
Declarations in a Package Specification 250
Ordering Items in a Specification 252
Package Body 252
Invoking Package Constructs 255
Package Scope 257
Global Constructs in Packages 259
Package Specifications with No Body 261
Improving Processing Efficiency 262
Forward Declarations in Packages 264
One-Time-Only Procedures 266
Overloading Program Units in Packages 269
Managing SQL Restrictions for Packaged Functions 272
Why Developers Indicate Purity Levels 273
PRAGMA RESTRICT_REFERENCES in Action 274
Default Purity Levels for Packaged Functions 274
Functions Written in External Languages 274
Using a REF CURSOR Parameter in Packages 275
Granting Execute Privileges for Program Units and Packages 276
Data Dictionary Information for Packages 276
Deleting Packages 277
Chapter Summary 278
Review Questions 278
Advanced Review Questions 280
Hands-On Assignments Part I 281
Hands-On Assignments Part II 283
Case Projects 284

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Table of Contents ix

Chapter 8 Dependencies, Privileges, and Compilation 285


Introduction 285
The Current Challenge in the Brewbean’s Application 286
Rebuilding the Database 286
Local Dependency Activity 287
Identifying Direct and Indirect Dependencies 292
Data Dictionary Views for Dependencies 292
The Dependency Tree Utility 294
Package Dependencies 300
Remote Object Dependencies 304
Models for Checking Remote Dependencies 308
Tips to Prevent Recompilation Errors 310
Granting Program Unit Privileges 310
PL/SQL Compilation 313
Compiler Parameters 313
PL/SQL Compiler Warnings 314
Conditional Compilation 317
Chapter Summary 322
Review Questions 323
Advanced Review Questions 326
Hands-On Assignments Part I 327
Hands-On Assignments Part II 329
Case Projects 330

Chapter 9 Database Triggers 331


Introduction 331
The Current Challenge in the Brewbean’s Application 332
Rebuilding the Database 333
Introduction to Database Triggers 334
Database Trigger Syntax and Options 334
Trigger Timing and Correlation Identifiers 335
Trigger Events 337
Trigger Body 338
Conditional Predicates 340
Creating and Testing a DML Trigger 341
Creating and Testing an INSTEAD OF Trigger 344
Additional Triggers 348
Using Triggers to Address Processing Needs 352
Compound Triggers 354
Trigger-Firing Order 358
The ALTER TRIGGER Statement 360
Deleting a Trigger 361
Data Dictionary Information for Triggers 361
Chapter Summary 363
Review Questions 364
Advanced Review Questions 366
Hands-On Assignments Part I 367
Hands-On Assignments Part II 373
Case Projects 373

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
x Table of Contents

Chapter 10 Oracle-Supplied Packages, Dynamic SQL, and


Hiding Source Code 375
Introduction 375
The Current Challenge in the Brewbean’s Application 376
Rebuilding the Database 376
Generating Output 377
The DBMS_OUTPUT Package 377
The UTL_FILE Package 381
Large Objects 384
The DBMS_LOB Package 385
Communication Capabilities 387
The DBMS_ALERT Package 387
The UTL_MAIL Package 388
The UTL_HTTP Package 390
Additional Packages 392
The DBMS_DDL Package 392
Exploring Additional Oracle-Supplied Packages 394
Dynamic SQL and PL/SQL 395
The DBMS_SQL Package 398
Native Dynamic SQL 406
DBMS_SQL Versus Native Dynamic SQL 410
Hiding Source Code 410
Chapter Summary 414
Review Questions 414
Advanced Review Questions 416
Hands-On Assignments 417
Case Project 422

Appendix A Tables for the Brewbean’s Database 423

Appendix B Oracle Installation and Using Oracle SQL Developer 439


Introduction 439
Oracle Database Installation 440
SQL Developer 446
Installation 446
Establishing a Database Connection 446
Executing Statements 449
Summary 452

Glossary 453
Index 457

Appendix C TOAD (Tool for Oracle Application Developers) (Online Only) C1

Appendix D Statement Tuning (Online Only) D1

Appendix E SQL*Loader Utility (Online Only) E1

Appendix F An Introduction to Object Technology (Online Only) F1

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
PREFACE

Almost every organization depends on a relational database to meet its information


system needs. One important challenge these organizations face is providing user-friendly
application interfaces that enable users to work efficiently. To facilitate logical processing
and user interaction with the Oracle 11g database, Oracle offers a robust procedural
language extension, PL/SQL, to complement the industry-standard SQL. PL/SQL is an
integral part of the Oracle 11g database, and the PL/SQL compiler and interpreter are
embedded in the Oracle 11g Developer Suite of tools. This arrangement results in a
consistent development environment on both the client and server sides. PL/SQL
knowledge leads to opportunities not only in developing applications with Oracle
Developer tools, but also in supporting existing Oracle applications that are developed and
marketed by Oracle in many industries. In addition to database software and application
development tools, Oracle is one of the world’s leading suppliers of application software.
The purpose of this book is to introduce you to using the PL/SQL language to interact
with an Oracle 11g database and to support applications in a business environment. In
addition, concepts related to objectives of the Oracle 11g PL/SQL certification exams
have been incorporated for those wanting to pursue certification.

The Intended Audience


This book has been designed for students in technical two-year or four-year programs who
need to learn how to develop application code with Oracle 11g databases. It’s assumed
you already understand relational database design and SQL commands.

Oracle Certification Program (OCP)


This book covers objectives of Exam 1Z0-147, Oracle 11g: Program with PL/SQL,
the second exam in the Oracle PL/SQL Developer Certified Associate track. You can find
information about exams, including registration and other reference material, at
www.oracle.com/education/certification. In addition, grids showing the Oracle exam
objectives and chapters of this book that address them are available for download at
cengagebrain.com via the Student Downloads link on this book’s Web page.

The Approach
The concepts introduced in this book are explained in the context of a hypothetical
real-world business—Brewbean’s, an online coffee goods retailer. First, the business
operation and database structure are introduced and analyzed. Each chapter begins with
a description of the current application challenge Brewbean’s needs to address. Then
PL/SQL statements are introduced and used throughout the chapter to solve the
Brewbean’s application challenge. This organization enables you to learn the syntax

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
xii Preface

of PL/SQL statements and apply them in a real-world environment. A script file that
generates the necessary database objects is included in each chapter’s student data files
so that you get hands-on practice in re-creating the examples and practicing variations
of PL/SQL statements to enhance your understanding.
The core PL/SQL language elements are covered in Chapters 5 through 10, including
procedures, functions, packages, and database triggers. Chapters 2 through 4 introduce
the basic PL/SQL language elements and processing techniques. Later chapters cover
more advanced topics, including dynamic SQL, compiler parameters, and code obfusca-
tion. These topics go beyond certification objectives, but they help you appreciate
Oracle’s many development features.
To reinforce the material, there are topic summaries, review questions, hands-on
assignments, and case projects at the end of each chapter. They test your knowledge
and challenge you to apply it to solving business problems. In addition, to expand your
knowledge of PL/SQL, the appendixes have tutorials on using software utilities, such as
SQL*Loader, to assist in PL/SQL code development.

Overview of This Book


The examples, assignments, and cases in this book help you learn how to do the following:
• Create PL/SQL blocks.
• Use a variety of variable types to handle data in a block.
• Process statements conditionally with control structures.
• Reuse lines of code with looping structures.
• Manage errors with exception handlers.
• Create and use procedures and functions.
• Bundle program units with packages.
• Develop database triggers.
• Use the features of Oracle-supplied packages.
• Identify program unit dependencies.
• Use dynamic SQL.
The chapter contents build in complexity and reinforce previous concepts. Chapter 1
introduces PL/SQL, explains how it fits into application programming, and describes the
Brewbean’s database used throughout this book. Chapter 2 shows you how to retrieve
and handle data in a block by using scalar variables and how to manipulate data with
decision and looping structures. Chapter 3 explains embedding SQL statements in
blocks and using composite variable types. Chapter 4 covers using cursors and managing
exceptions. Chapter 5 explains how to create a procedure and pass values by using para-
meters. Chapter 6 shows you how to create functions and how to return values with
functions. Chapter 7 covers creating packages, including the package specification and
body. Chapter 8 describes methods of identifying program unit dependencies and
compiler parameters. Chapter 9 shows you how to create DML, INSTEAD OF, system,
and compound triggers. Chapter 10 describes a sampling of Oracle-supplied packages and
covers dynamic SQL and code obfuscation. The appendixes support and expand on
chapter materials. Appendix A is a printed version of the tables and data in the Brewbean’s
database. This database serves as a running example from chapter to chapter. Appendix B
guides you through Oracle and SQL Developer installation and includes a tutorial on using

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Preface xiii

SQL Developer, a free utility from Oracle. Appendix C has a tutorial on using a third-party
development utility, TOAD. Appendix D gives you an overview of SQL and PL/SQL state-
ment tuning. Appendix E is an overview of using the SQL*Loader utility. Appendix F
introduces object technology. (Note: Appendixes C through F are available on this book’s
Web page.)

Features
To enhance your learning experience, each chapter in this book includes the following
elements:
• Chapter objectives: Each chapter begins with a list of the concepts to be
mastered by the chapter’s conclusion. It gives you a quick overview of
chapter contents as well as a useful study aid.
• Running case: An application development challenge for the Brewbean’s
online coffee retail company is described at the beginning of each chapter.
• Methodology: New concepts are introduced in the context of solving the
Brewbean’s application challenge in that chapter. Step-by-step exercises
illustrate the concepts, and many screenshots and code examples are
included to help you understand the concepts better. As you work through
the chapters, less detailed instructions are given for familiar tasks, and
detailed instructions are reserved for new tasks.
• Tips: This feature, designated by the Tip icon, offers practical advice or
information. In some instances, tips explain how a concept applies in the
workplace.
• Notes: These explanations, designated by the Note icon, give you more
information on the files and operations being discussed.
• Cautions: This feature, designated by the Caution icon, warns you of potential
pitfalls.
• Chapter summaries: Each chapter’s text is followed by a summary of the
important concepts. These summaries are a helpful recap of chapter
material.
• Review questions: End-of-chapter assessment begins with 15 review questions
(10 multiple choice and 5 short answer) that reinforce the chapter’s main ideas.
These questions ensure that you have mastered the concepts and understand
the information.
• Advanced review questions: Chapters 2 through 9 have an additional five
multiple-choice questions covering the chapter material. They’re similar to
Oracle certification exam questions and are included to prepare you for the
types of questions you can expect on a certification exam and to measure
your level of understanding. (Chapter 10 has no advanced questions because
its material goes beyond the certification objectives.)
• Hands-on assignments: Each chapter has 8 to 15 hands-on assignments
related to the chapter’s contents to give you practical experience. Many
assignments are based on the Brewbean’s database application to continue
the examples given in the chapter; others are based on the DoGood Donor
organization, a hypothetical company that tracks donors’ pledges and
payments.

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Exploring the Variety of Random
Documents with Different Content
“Uncle Sam a-wadin’ in sin up to his old knee jints.”
“Uncle Sam?” sez he; “I know him not. I meant your great people; I
do not speak of one alone.”
“I know,” sez I; “that is what we call our Goverment when we are on
intimate terms with it.”
“And,” sez I, “you little know what that old man has been through.
He wants to do right—he honestly duz; but you know jest how it is—
how mistaken counsellors darken wisdom and confound jedgment.”
But the sweet, melodious voice went on—
“Your missionaries preach loud to my people against the sins of
stealing and gambling.
“But I find that in this country great places are fitted up for gambling
and theft.”
Truly he spoke plain, but then I d’no as I could blame him.
“In these places of theft and gambling, called your stock exchanges,
I find that you have people called brokers, and some wild animals
called bulls and bears, though for what purpose they are kept I
know not, unless it is that they are trained for the Arena. I know not
yet all your customs.
“But this I know, that your brokers gamble and steal from the people
—sometimes millions in one day. Which money, taken from the
common people all over this country, is divided by these brokers
amongst a few rich men. Perhaps then the game of bulls and bears,
fighting each other for their amusement, begins. I know not yet all
your ways.
THE GAME OF BULLS AND BEARS.
“But I know that in one day five million bushels of wheat were
bought and sold when there was no wheat in sight—when even
during that whole year the crop amounted to only two hundred and
eighty millions. There were more than two million, two hundred
thousand bushels of wheat bought and paid for that never grew—
that were not ever in the world.
“As I saw this, oh! how my heart burned to teach this poor sinful
people the morality that our own people enjoy.
“For never were there such sins committed in our country.
“I find your rich men controlling the market—holding back the bread
that the poor hungered and starved for, putting burdens on them
more grievous than they could bear. These rich men, sitting with
their soft, white hands, and forms that never ached with labor,
putting such high prices on grain and corn that the poor could not
buy to eat—these rich men prayed in the morning (for they often go
through the forms of the holy religion)—they prayed, ‘Give us this
day our daily bread,’ and then made it their first business to keep
people from having that prayer answered to them.
“They prayed, ‘Lead us not into temptation,’ and then deliberately
made circumstances that they knew would lead countless poor into
temptation—temptation of theft—temptation of selling Purity and
Morality for bread to sustain life.”
Sez I, a-groanin’ out loud and a-sithin’ frequent—
“I can’t bear to hear sech talk, it kills me almost; and,” sez I
honestly, “there is so much truth in it that it cuts me like a knife.”
Sez he, a-goin’ on, not mindin’ my words—“I felt that I must warn
this people of its sins. I must tell them of what was done once in
one of our own countries,” sez he, a-wavin’ his hand in a impressive
gester towards our east door—
“In one of our countries the authorities learned that stock exchanges
were being formed at Osaka, Yokohama, and Koba.
“The police, all wearing disguises, went at once to the exchanges
and mingled with the crowd. When all was ready a sign was given,
the police took possession of the exchanges and all the books and
papers, the doors were locked and the prisoners secured. Over
seven hundred were put in prison, the offence being put down
—‘Speculation in margins.’
“I yearn to tell this great people of the way of our countries, so that
they may follow them.”
“A heathen a-comin’ here as a missionary!” sez I, a-thinkin’ out loud,
onbeknown to me. “Wall, it is all right.” Sez I, “It’s jest what the
country needs.”
But before I could say anythin’ further, at that very minute my
beloved pardner come in.
He paused with a look of utter amazement. He stood motionless and
held complete silence and two pails of milk.
But I advanced onwards and relieved him of his embarrassment and
one pail of milk, and introduced Al Faizi. Al Faizi riz up to once and
made a deep bow, almost to the floor; but my poor Josiah, with a
look of bewilderment pitiful to witness, and after standin’ for a brief
time and not speakin’ a word, sez he—
Al Faizi made a deep bow, almost to the floor.

“I guess, Samantha, I will go out to the sink and wash my hands.”


Truly, it wuz enough to surprise any man, to leave a pardner with no
companion but a sheep’s-head nightcap, partly finished, and come
back in a few minutes and see her a-keepin’ company with a
heathen, clothed in a long robe and turban.
Wall, Josiah asked me out into the kitchen for a explanation, which I
gin to him with a few words and a clean towel, and then sez I—“We
must ask him to stay all night.”
And he sez, “I d’no what we want of that strange-lookin’ creeter a-
hangin’ round here.”
And I sez, “I believe he is sent by Heaven to instruct us heathens.”
And Josiah said that if he wuz sent from Heaven he would most
probble have wings.
He didn’t want him to stay, I could see that, and he spoke as if he
wuz on intimate terms with angels, a perfect conoozer in ’em.
But I sez, “Not all of Heaven’s angels have wings, Josiah Allen, not
yet; but,” sez I, “they are probble a-growin’ the snowy feathers on
’em onbeknown to ’em.”
CHAPTER III.
OFF INTO SIDE PATHS.
Wall, the upshot of the matter wuz Al Faizi stayed right there for
weeks. He seemed to have plenty of money, and I d’no what
arrangement he and Josiah did make about his board, but I know
that Josiah acted after that interview with him in the back yard real
clever to him, and didn’t say a word more aginst the idee of his not
bein’ there.
(Josiah is clost.)
As for me, I would have scorned to have took a cent from him,
feelin’ that I got more’n my pay out of his noble but strange
conversation.
But Josiah is the head of the family (or he calls himself so).
And mebby he is some of the time.
But suffice it to say, Al Faizi jest stayed and made it his home with
us, and peered round, and took journeys, and tried to find out things
about our laws and customs.
Thomas Jefferson loved to talk with him the best that ever wuz. And
Al Faizi would make excursions to different places round, a-walkin’
mostly, a-seein’ how the people lived, and a-watchin’ their manners
and customs, and in writin’ down lots of things in some books he
had with him, takin’ notes, I spozed, and learnin’ all he could. One
book that he used to carry round with him and make notes in wuz as
queer a lookin’ book as I ever see.
With sunthin’ on the cover that looked some like a cross and some
like a star.
There wuz some precious stuns on it that flashed. If it wuz held up
in some lights it looked like a cross, and then agin the light would
fall on’t and make it look like a star. And the gleamin’ stuns would
sparkle and flash out sometimes like a sharp sword, and anon soft,
like a lambient light.
It wuz a queer-lookin’ book; and he said, when I atted him about it,
that he brought it from a country fur away.
And agin he made that gester towards the East, that might mean
Loontown, and might mean Ingy and Hindoosten—and sech.
After that first talk with me, in which he seemed to open his heart,
and tell what wuz in his mind, as you may say, about our country, he
didn’t seem to talk so very much.
He seemed to be one of the kind who do up their talkin’ all to one
time, as it were, and git through with it.
Of course he asked questions a sight, for he seemed to want to find
out all he could. And he would anon or oftener make a remark, but
to talk diffuse and at length, he hardly ever did. But he took down
lots of notes in that little book, for I see him.
I enjoyed havin’ him there dretful well, and done well by him in
cookin’, etcetery and etcetery.
But the excitement when he first walked into the Jonesville meetin’-
house with Josiah and me wuz nearly rampant. I felt queer and
kinder sheepish, to be walkin’ out with a man with a long dress, and
turban on, and sandals. And I kinder meached along, and wuz glad
to git to our pew and set down as quick as I could. But Josiah looked
round him with a dignified and almost supercilious mean. He felt
hauty, and acted so, to think that we had a heathen with us and that
the other members of the meetin’-house didn’t have one.
But if I felt meachin’ over one heathen, or, that is, if I felt
embarrassed a-showin’ him off before the bretheren and sistern,
what would I felt if Josiah had had his way about comin’ to meetin’
that day?
Little did them bretheren and sistern know what I’d been through
that mornin’.
Josiah wore his gay dressin’-gown down to breakfast, which I bore
well, although it wuz strange—strange to have two men with dresses
on a-settin’ on each side of me to the table—I who had always been
ust to plain vests and pantaloons and coats on the more opposite
sex.
But I bore up under it well, and didn’t say nothin’ aginst it, and
poured out the coffee and passed the buckwheat cakes and briled
chicken and etc. with a calm face.
But when church-time come, and Ury brought the mair and
democrat up to the door, and I got up on to the back seat, when I
turned and see Josiah Allen come out with that rep dressin’-gown
on, trimmed with bright red, and them bright tossels a-hangin’ down
in front, and a plug hat on, you could have knocked me down with a
pin feather.
And sez I sternly, “What duz this mean, Josiah Allen?”
Sez he, “I am a-goin’ to wear this to meetin’, Samantha.”
“To meetin’?” sez I almost mekanically.
“Yes,” sez he; “I am a-doin’ it out of compliments to Fazer; he would
feel queer to be the only man there with a dress on, and so I
thought I would keep him company; and,” sez he, a-fingerin’ the
tossels lovin’ly, “this costoom is very dressy and becomin’ to me, and
I’d jest as leave as not let old Bobbett and Deacon Garvin see me
appearin’ in it,” sez he.
“Do you go and take that off this minute, Josiah Allen! Why, they’d
call you a idiot and as crazy as a loon!”
Sez he, a-puttin’ his right foot forward and standin’ braced up on it,
sez he, “I shall wear this dress to meetin’ to-day!”
Sez I, “You won’t wear it, Josiah Allen!”
Sez he, “You know you are always lecturin’ me on bein’ polite. You
know you told me a story about a woman who broke a china teacup
a purpose because one of her visitors happened to break hern. You
praised her up to me; and now I am actin’ out of almost pure
politeness, and you want to break it up, but you can’t,” sez he, and
he proceeded to git into the democrat.
Ury wuz a-standin’ with his hands on his sides, convulsed with
laughter, and even the mair seemed to recognize sunthin’ strange,
for she whinnered loudly.
Sez I in frigid axents, “Even the old mair is a whinnerin’, she is so
disgusted with your doin’s, Josiah Allen.”
“The old mair is whinnerin’ for the colt!” sez he, and agin he put his
foot on the lowest step.

Sez I, a-risin’ up in the democrat, “I’ll git out.”


“Wall,” sez I, a-risin’ up in the democrat, with dignity, “I’ll git out and
stay to home. I will not go to church and see my pardner took up for
wearin’ female’s clothin’.”
He paused with his foot on the step, and a shade of doubt swept
over his liniment.
“Do you spoze they would?” sez he.
“Of course they would!” sez I; “twilight would see you a-moulderin’
in a cell in Loontown.”
“I couldn’t moulder much in half a day!” sez he.
But I see that I wuz about to conquer. He paused a minute in deep
thought, and then he turned away; but as he went up the steps
slowly, I hearn him say—“Dum it all, I never try to show off in
politeness or anything but what sunthin’ breaks it up!”
But anon he come down clothed in his good honorable black
kerseymeer suit, and Al Faizi soon follered him in his Oriental garb,
and we proceeded to meetin’.
As I say, the excitement wuz nearly rampant as we went in. And I
spoze nothin’ hendered the female wimmen and men from bein’
fairly prostrated and overcome by their feelin’s, only this fact, that
the winter before a Hindoo in full costoom had lectured before the
Jonesville meetin’-house, so that memory kinder broke the blow
some. And then some on ’em had been to the World’s Fair, and seen
quantities of heathens and sech there.
So no casuality wuz reported, though feather fans wuz waved wildly,
and more caraway wuz consoomed, I dare presoom to say, than
would have been in a month of Sundays in ordinary times.
But while the wonder and curosity waxed rampant all round, Al Faizi
sot silent and motionless as the dead, with his soft, brilliant eyes
fixed on the minister’s face, eager to ketch every word that fell from
his lips—a-tryin’ to hear the echo of the Great Voice speak to him
through the minister’s words, so I honestly believe.
For I think that a honester, sincerer, well-meanin’er creeter never
lived and breathed than he wuz; and as days went on I see nothin’
to break up my opinion of him.
Politer he wuz than any female, or minister, I ever see fur or near.
Afraid of makin’ trouble to a marked extent, eager and anxious to
learn everything he could about everything—all our laws, and
customs, and habits, and ways of thinkin’—and tellin’ his views in a
simple way of honest frankness, that almost took my breath away—
anxious to learn, and anxious to teach what he knew of the truth.
Though, as I said, after that first bust of talk with me he seemed
inclined to not talk so much, but learn all he could. It wuz as if he
had his say out in that first interview. Dretful interestin’ creeter to
have round, he wuz—sech a contrast to the inhabitants of Jonesville,
Deacon Garvin and the Dankses, etc.
He didn’t stay to our house all the time, as I said, but would take
pilgrimages round and come back, and make it his home there.
Wall, it wuz jest about this time that a contoggler come to our house
to contoggle a little for me. I wanted some skirts, and some
underwaists, and some of Josiah’s old clothes contoggled.
You know, it stood to reason that we couldn’t have all new things for
our voyage, and so I had to have some of our old clothes fixed up.
You see, things will git kinder run down once in awhile—holes and
rips in dresses, trimmin’ offen mantillys, tabs to new line, and
pantaloons to hem over round the bottom, and vests to line new,
and backs to put into ’em, and etcetery and etcetery.
And, then, you’ll outgrow some of your things, and have to let ’em
out; or else they’ll outgrow you, and you’ll have to take ’em in, or
sunthin’.
Sech cases as these don’t call for a dressmaker or a tailoress. No, at
sech times a contoggler is needed. And I’ve made a stiddy practice
for years of hirin’ a woman to come to the house every little while
for a day or two at a time, and have my clothes and Josiah’s all
contoggled up good.
This contoggler I had now wuz a old friend of mine, who had made
it her home with me for some time in the past, and now bein’ a-
keepin’ house happy not fur away, had sech a warm feelin’ for me in
her heart, that she always come and contoggled for me when I
needed a contoggler.
She had a dretful interestin’ story. Mebby you’d like to hear it?
I hate to have a woman meander off into side paths too much, but if
the public are real sot and determined on hearin’ me rehearse her
history, why I will do it. For it is ever my desire to please.
It must be now about three years sence I had my first interview with
my contoggler. And I see about the first minute that she wuz a likely
creeter—I could see it in her face.
She wuz a perfect stranger to me, though she had lived in Jonesville
some five months prior and before I see her.
And Maggie, my son’s, Thomas Jefferson’s, wife, hearn of her
through her mother’s second cousin’s wife’s sister, Miss Lemuel Ikey.
And Miss Ikey said that she seemed to be one of the best wimmen
she ever laid eyes on, and that it would be a real charity to give her
work, as she wuz a stranger in the place, without much of anything
to git along with, and seemed to be a deep mourner about sunthin’.
Though what it wuz she didn’t know, for ever sence she had come to
Jonesville she had made a stiddy practice of mindin’ her own bizness
and workin’ when she got work.
She had come to Jonesville kinder sudden like, and she had hired
her board to Miss Lemuel Ikey’s son’s widow, who kep’ a small—a
very small boardin’-house, bein’ put to it for things herself though,
likely.
I told Maggie to ask her mother to ask her second cousin’s wife to
ask her sister, Miss Lemuel Ikey, to ask her son’s wife what the
young woman could do.
And the word come back to me straight, or as straight as could be
expected, comin’ through five wimmen who lived on different roads.
“That she wuzn’t a dressmaker, or a mantilly maker, or a tailoress.
But she stood ready to do what she could, and needed work
dretfully, and would be awful thankful for it.”
Then feelin’ deeply sorry for her, and wantin’ to befriend her, I sent
word back in the same way—“To know if she could wash, or iron, or
do fancy cookin’. Or could she make hard or soft soap? Or feather
flowers? Or knit striped mittens? Or pick geese? Or paint on plaks?
Or do paperin’?”
And the answer come back, meanderin’ along through the five
—“That she wuzn’t strong enough, or didn’t know how to do any
one of these, but she stood ready to do all she could do, and needed
work the worst kind.”
Then I tackled the matter myself, as I might better have done in the
first place, and went over to see her, bein’ willin’ to give her help in
the best way any one can give it, by helpin’ folks to help themselves.
I went over quite early in the mornin’, bein’ on my way for a all-day’s
visit to Tirzah Ann’s.
But I found the woman up and dressed up slick, or as slick as she
could be with sech old clothes on.
And I liked her the minute I laid eyes on her.
Her face, though not over than above handsome, wuz sweet-lookin’,
the sweetness a-shinin’ out through her big, sad eyes, like the light
in the western skies a-shinin’ out through a rift in heavy clouds.
Very pale complected she wuz, though I couldn’t tell whether the
paleness wuz caused by trouble, or whether she wuz made so. And
the same with her delicate little figger. I didn’t know whether that
frajile appearance wuz nateral, or whether Grief had tackled her with
his cold, heavy chisel, and had wasted the little figger until it looked
more like a child’s than a woman’s.
And in her pretty brown hair, that kinder waved round her white
forward, wuz a good many white threads.
Of course I couldn’t tell but what white hair run through her family—
it duz in some. And I had hearn it said that white hair in the young
wuz a sign of early piety, and of course I couldn’t set up aginst that
idee in my mind.
But them white hairs over her pale young face looked to me as if
they wuz made by Sorrow’s frosty hand, that had rested down too
heavy on her young head.
She met me with a sweet smile, but a dretful sad one, too, when
Miss Ikey introduced me.

She met me with a sweet smile.

But when I told my errent she brightened up some. But after settin’
down with her for more’n a quarter of a hour, a-questionin’ her in as
delicate a way as I could and get at the truth, I found that every
single thing that she could do wuz to contoggle.
So I hired her as a contoggler, and took her home with me that night
on my way home from Tirzah Ann’s as sech, and kep’ her there three
weeks right along.
I see plain that she could do that sort of work by the first look that I
cast onto her dress, which wuz black, and old and rusty, but all
contoggled up good, mended neat and smooth, and so I see, when
she got ready to go with me, wuz her mantilly, and her bunnet; both
on ’em wuz old and worn, but both on ’em showed plain signs of
contogglin’.
She wuz a pitiful-lookin’ little creeter under her black bunnet, and
pitiful-lookin’ when the bunnet wuz hung up in our front bedroom,
and she kep’ on bein’ so from day to day, as pale and delicate-lookin’
as a posey that has growed in the shade—the deep shade.
And though she kep’ to work good, and didn’t complain, I see from
day to day the mark that Sufferin’ writes on the forwards of them
that pass through the valleys and dark places where She dwells. (I
don’t know whether Sufferin’ ort to be depictered as a male or a
female, but kinder think that it is a She.)
But to resoom. I didn’t say nothin’ to make her think I pitied her, or
anything, only kep’ a cheerful face and nourishin’ provisions before
her from day to day, and not too much hard work.
I thought I’d love to see her little peekéd face git a little mite of
color in it, and her sad blue eyes a brighter, happier look.
But I couldn’t. She would work faithful—contoggle as I have never
seen any livin’ woman contoggle, much as I have witnessed
contogglin’.
And I don’t mean any disrespect to other contogglers I have had
when I say this—no, they did the best they could. But Miss Clark
(that wuz the name she gin—Annie Clark), she had a nateral gift in
this direction.
She worked as stiddy as a clock, and as patient, and patienter, for
that will bust out and strike every now and then. But she sot
resigned, and meek, and still over rents and jagged holes in
garments, and rainy days and everything.
Calm in thunder storms, and calm in sunshine, and sad, sad as
death through ’em all, and most as still.
And I sot demute and see it go on as long as I could, a-feelin’ that
yearnin’ sort of pity for her that we can’t help feelin’ for all dumb
creeters when they are in pain, deeper than we feel for talkative
agony—yes, I always feel a deeper pity and a more pitiful one for
sech, and can’t help it.
And so one day, when I wuz a-settin’ at my knittin’ in the settin’-
room, and she a-settin’ by me sad and still, a-contogglin’ on a
summer coat of my Josiah’s, I watched the patient, white face and
the slim, patient, white fingers a-workin’ on patiently, and I stood it
as long as I could; and then I spoke out kinder sudden, being took,
as it were, by the side of myself, and almost spoke my thoughts out
loud, onbeknown to me, and sez I:
“My dear!” (She wuzn’t more’n twenty-two at the outside.)
“My dear! I wish you would tell me what makes you so unhappy; I’d
love to help you if I could.”
She dropped her work, looked up in my face sort o’ wonderin’, yet
searchin’.
I guess that she see that I wuz sincere, and that I pitied her
dretfully. Her lips begun to tremble. She dropped her work down
onto the floor, and come and knelt right down by me and put her
head in my lap and busted out a-cryin’.
You know the deeper the water is, and the thicker the ice closes
over it, the greater the upheaval and overflow when the ice breaks
up.
She sobbed and she sobbed; and I smoothed back her hair, and
kinder patted her head, and babied her, and let her cry all she
wanted to.
My gingham apron wuz new, but it wuz fast color and would wash,
and I felt that the tears would do her good.
I myself didn’t cry, though the tears run down my face some. But I
thought I wouldn’t give way and cry.
And this, the follerin’, is the story, told short by me, and terse, terser
than she told it, fur. For her sobs and tears and her anguished looks
all punctuated it, and lengthened it out, and my little groans and
sithes, which I groaned and sithed entirely onbeknown to myself.
But anyway it wuz a pitiful story.
She had at a early age fell in love voyalent with a young man, and
he visey versey and the same. They wuz dretful in love with each
other, as fur as I could make out, and both on ’em likely and well
meanin’, and well behaved with one exception.
He drinked some. But she thought, as so many female wimmen do,
that he would stop it when they wuz married.
Oh! that high rock that looms up in front of prospective brides, and
on which they hit their heads and their hearts, and are so oft
destroyed.
They imagine that the marriage ceremony is a-goin’ in some strange
way to strike in and make over all the faults and vices of their young
pardners and turn ’em into virtues.
Curous, curous, that they should think so, but they do, and I spoze
they will keep on a-thinkin’ so. Mebby it is some of the visions that
come in the first delerium of love, and they are kinder crazy like for
a spell. But tenny rate they most always have this idee, specially if
love, like the measles, breaks out in ’em hard, and they have it in
the old-fashioned way.
Wall, as I wuz a-sayin’, and to resoom and proceed.
Annie thought he would stop drinkin’ after they wuz married. He said
he would. And he did for quite a spell. And they wuz as happy as if
they had rented a part of the Garden of Eden, and wuz a-workin’ it
on shares.
Then his brother-in-law moved into the place, and opened a cider-
mill and a saloon—manafactered and sold cider brandy, furnished all
the saloons round him with it, took it off by the load on Saturdays,
and kep’ his saloon wide open, so’s all the boys and men in the
vicinity could have the hull of Sunday to git crazy drunk in, while he
wuz a-passin’ round the contribution-box in the meetin’-house.
For he wuz a strict church-goer, the brother-in-law wuz, and felt that
he wuz a sample to foller.
Wall, Ellick Gurley follered him—follered him to his sorrer. The
brother-in-law employed him in his soul slaughter-house—for so I
can’t help callin’ the bizness of drunkard-makin’. I can’t help it, and I
don’t want to help it.
And so, under his influence, Ellick Gurley wuz led down the soft,
slippery pathway of cider drunkenness, with the holler images of
Safety and old Custom a-standin’ up on the stairway a-lightin’ him
down it.
Ellick first neglected his work, while his face turned first a pink, and
then a bloated, purplish red.
Then he begun to be cross to his wife and abusive to little Rob, the
beautiful little angel that had flown to them out of the sweet
shadows of Eden, where they had dwelt the first married years of
their life.
Finally, he got to be quarrelsome. Annie wuz afraid of him. And all of
his money and all of hern went to buy that cider brandy (it makes
the ugliest, most dangerous kind of a drunk, they say, of any kind of
liquor, and I believe it from what I have seen myself, and from what
Annie told me of her husband’s treatment of her and little Rob).
Finally, he got to be quarrelsome.
And at last she begun to suffer for food and clothin’ for herself and
the child.
And as the drink demon riz up in Ellick’s crazy brain, and grew more
clamorous in its demands, and he weaker to contend aginst it, Ellick
sold all of the household stuff he could git holt of to appease this
dretful power that had got holt of him, body and soul.
Annie took in all the work she could do, did washin’ for the
neighbors, who ust to envy her her happiness and prosperity—
rubbed and hung out the heavy garments with tremblin’ fingers—
sewed with her achin’ head a-bendin’ over the long seams, and her
tear-filled eyes dimmed with the pain of unavailin’ agony.
But heartaches and abuse made her weak form weaker and weaker,
and then there wuz but little work to do, if she had been as strong
as Sampson; so, bein’ fairly drove to it by Agony, and Fear, and
Starvation, them three furies a-drivin’ her, as you may say,
harnessed up three abreast behind her, a-goadin’ her weak, cowerin’
form with their fire-tipped lashes, she appealed to the brother-in-
law.
She told him, what he knew before, that she and little Robbie were
starvin’, and she wuz afraid of her life, and she urged him to not sell
Ellick any more of the poison that wuz a-destroyin’ him.
He wuz to meetin’ when she went. He wuz dretful particular about
his religious observances.
No Hindoos wuz ever stricter about burnin’ their widders on the
funeral pyre of the departed than he wuz a-follerin’ up what he
called his religion.
(Religion, sweet, pure sperit, how could she stand it, to have him a-
burnin’ his incense in front of her? But, then, she has had to stand a
good deal in this old world, and has to yet.)
But, as I wuz a-sayin’, there never wuz a Pharisee in old or modern
times that went ahead of him in cleanin’ the outside of his platters
and religious deep dishes, and makin’ broad the border of his
phylakricy. Why, his phylakricy wuz broader and deeper than you
have any idee on.
But inside of his platters and deep dishes wuz dead men’s bones!
More’n one quarrel, riz up out of his accursed brandy, had led to
bloodshed, besides achin’ and broken hearts without number, and
ruined souls and lives.
And his phylakricy ort to be broad, for it had to be used as a pall
time and agin, and it covered, so he thought, a multitude of sins.
Yes, indeed!
Wall, as I say, he wuz to a church meetin’. There wuz a-goin’ to be a
Association of Religious Bodies for the Amelioration of Human Woe.
And he wuz anxious to be sent as a delegate, so he hung on to the
last, and wuz appinted.
But finally he got home, and Annie tackled him on the subject
nearest her heart, talked to him with tears in her eyes and a voice
tremblin’ with the anguished beatin’s of her poor, achin’ heart.
She begged him to not sell her husband any more drink, begged him
for her sake and for the sake of little Rob. For she knew that if the
man had a tender place in his heart it wuz for his little nephew. He
did love him deeply, or as deep as a man like this could love
anything above his money and his reputation as a religious leader.
But he wouldn’t promise, and he acted dretful high-headed and
hateful to her to cover up his meanness, for he felt that if he should
refuse to sell his stuff, it would not only stop his money-makin’, but it
would be like ownin’ up that he had been in the wrong.
And he plumed himself, and carried the idee that cider wuz a
healthful beverage, and very strengthenin’ in janders and sech. Why,
he carried the idee to the world, and mebby in the first place he did
to his own soul, so blindin’ is the spectacles of selfishness that he
wore, that he wuz a-doin’ a charitable work a-keepin’ that old cider-
mill and saloon a-goin’.
So he wouldn’t pay no attention to her pleadin’s, only acted hateful
and cross to her, his guilty conscience makin’ him so, I spoze.
And then, too, he wuz in a hurry, for his church duties wuz a-waitin’
for him, and his barrels of cider wanted doctorin’ with alcohol and
sech.
So he turned onto his heel and left her.
And Annie went home more broken-hearted than ever, for his cold,
cruel sneers and scorn hurt her on the poor heart made sore by her
husband’s brutality.
And Ellick went on worse than ever. And it wuz on that very day that
his brother-in-law (and to make it shorter we will call him B. I. L.)—it
wuz on the very day that the B. I. L. went to New York on his great
Amelioratin’ Human Misery errent, that Ellick, crazy drunk with cider
shampain, struck little Rob sech a blow that it knocked the child
down, and he laid stunted for more’n a hour. And he threatened
Annie that he would take her life, because she interfered between
him and the boy.
He raved round, like the maniac that he wuz. He said that he would
throw her out doors if she didn’t git a good dinner, when there
wuzn’t a mite of food in the house to cook. He raved about the
house bein’ so freezin’ cold, when there wuzn’t a stick of wood nor a
lump of coal.
Ellick lay drunk in the office.

And finally he reeled off to his usual place of resort. And while the B.
I. L. wuz a-raisin’ up in the great meetin’-house, and a-smoothin’ out
his phylakricy, and a-layin’ the border of it careful, so’s it would show
off well, and then bustin’ out into sech a speech, on the duties of
church-members to the sinful and the sorrowin’ round ’em—a speech
that riz him up powerful in religious circles—Ellick lay drunk in the
office of his cider-mill.
Little Rob lay like a dead child in a cold, bare room, and a white-
faced, half-starved mother bent over him with big, despairin’,
anxious eyes—bent over him till life come back to his poor, bruised
body; and then as darkness crept over the earth she stole away, a-
carryin’ him in her arms.
She got a ride with a passin’ teamster, got carried fur off, then got
another ride, wuz fed and warmed by pityin’ hearts on the way; so
she come to a place nigh Jonesville, onbeknown to anybody.
When Ellick rousted up out of his drunken sleep he went back to a
desolate, empty house. His surprise, his grief, sobered him. He flew
to the B. I. L., woke him out of a sound sleep filled with visions of
his triumphs.
The B. I. L. wuz in a tryin’ place. He wuz about to be riz up to a high
position in the meetin’-house. If this story got out, it might and
probble would hurt him. Annie must be found and brought back.
They jined forces to try to find her. They sot out that very day, but
the quest wuz a long one.
Annie stayed a spell with the family who took her in first out of the
cold and the darkness.
The man of the house, and the woman, too, wuz relations on the
soul side to the good old Samaritan mentioned in Skripter. They did
well by her.
But little Rob never got over the effects of the cruel blow, and the
fall on the hard floor, and the awful journey through the coldness of
the midnight escape. They all sort o’ underminded his little
constitution, and he wuz took sick a bed.
And bein’ too tired out and hardly dealt with here on earth, he wuz
promoted up to that higher home, where we may be sure that his
True Father, the Helper of all the oppressed and burdened, accepted
him right into His great heart of Love, and wuz good to the little,
patient soul.
Wall, Annie couldn’t tell me much about that time, when she had to
let the child, a part of her own life, go out of her arms, and she wuz
left alone—alone amongst strangers, helpless, despairin’, and poor.
No, she couldn’t talk much about it, not in words, but I understood
the language of her tremblin’ lips and her fallin’ tears.
Wall, when little Rob wuz laid away under the dead grasses and the
bare shade trees of that little country church-yard, Annie couldn’t
stay long in the house where he had been and now wuz not.
His little figger hanted every room, and her agonized Remembrance
wuz a-walkin’ up and down with her. So she heard of a place in
Jonesville where mebby she could git work, and she come there.
But lately news had come to her that her husband and B. I. L. wuz
huntin’ for her.
Ellick really and truly loved his wife and child, so it wuz spozed, and
hunted for Love’s and Anxiety’s sakes.
The B. I. L. hunted ’em so’s to hush up the story; it wuz a-hurtin’
him dretfully in the eyes of the meetin’-house. And Anger and
Selfishness and Hypocrocy wuz a-holdin’ up their blue-flamed
torches to light him on his hunt.
Wall, Annie wuz in deathly fear that they would find her. She had
took another name—her mother’s maiden name—but she wuz afraid
they would find it out.
She said that she could not live to go through agin what she had
gone through with. And yet when I pinned her right down on the
subject (a calm, religious pinnin’) she owned up that she did love her
husband yet. She cried when she said it.
And I thought to myself that I would cry if I wuz in her place, if I
loved such a thing as that.
But she said, and mebby it wuz so, that he would have been all right
if it hadn’t been for the influence of the B. I. L. and his bein’ gradual
led back into drinkin’ agin by sunthin’ that he thought wouldn’t hurt
him. She said that he never would have touched whiskey agin, havin’
promised and broke off.
But he thought, somehow, that the liquid sech a highly religious man
wuz a-sellin’ under the name of cider must be sort o’ soothin’ to his
insides; but instead of that it set fire to ’em, and his morals and all,
and burnt ’em right up.
Annie showed me Ellick’s picter, and it wuz a good-lookin’ face, or
kinder good; it would have been handsome if it hadn’t been for a
sort of a weak look onto it.
But weak or strong, she loved him. And so I didn’t really know how
she wuz a-comin’ out so fur as her own happiness wuz concerned.
Wimmen are so queer.
But I chirked her up all I could, told her to keep jest as calm as she
could conveniently, and I would take care of her for the present.
CHAPTER IV.
SAMANTHA’S SWORD OF TRUTH AND JUSTICE.
Wall, if you’ll believe it, it wuz the very next day I had a occasion to
go to Jonesville for some necessaries; and Josiah wuz busy a-makin’
a new stanchil in the barn, so I sot off alone after breakfast with a
large pail of good butter, and a cross-cut saw that Josiah had sent
down to be filed, and the mair.
Wall, jest about a mild from our house is a old tarvern that has been
fixed up and is used now as a sort of a half-way house between
Jonesville and Loontown. Teamsters and sech stop there a sight to
git “Refreshments for man and beast,” as the sign reads.
Wall, I had got most there when I see a man approachin’ me a-
walkin’ afoot. And I knew him the first minute I sot my eyes on him.
It wuz Ellick Gurley.
It wuz Ellick Gurley.

And the very minute I sot my eyes onto his face Duty and Principle
both hunched me up hard to tackle him in this matter.
Wall, most probble he had been hangin’ round for some time, for he
knew me the first thing, and he come up to the side of the democrat
wagon I wuz a-ridin’ in, bold as brass, and he sez:
“Is this Josiah Allen’s wife?” sez he.
“Yes, sir,” sez I, up clear and decided.
“Is a woman calling herself Anna Clark at your house?”
I wuzn’t a-goin’ to fight for Annie with any pewter weepons of
untruth. No, I wuz a-goin’ to fight with the two-edged sword of
Eternal Truth and Jestice, and I took ’em out and whetted ’em (as it
were), and sez I, sharp and keen—
“Yes, sir!”
“Well,” sez he, lookin’ dretful defiant and mad at me, “she is my
wife, and I hereby forbid you harboring her, for I will pay no debts of
her contracting.”
“Like as not,” sez I coolly, “as you never paid any of your own.”
He kinder blushed up some, but he went on some as if he wuz a-
rehearsin’ a piece he had learnt:
“She has left my bed and board!”
Then I waved that sword of Truth agin that I had been a-whettin’,
and sez I—
“It wuz her bed. Her mother gin it to her for her settin’ out, and
picked every feather in it from her own geese and ganders. I got it
from Annie’s own lips, and you sold it for drink. As for the boards,”
sez I candidly, for even in the midst of the fiercest battle with the
forces of wrong I must be jest to my foe, and so sez I—
“As for the piece of board you speak of, I d’no whose it wuz, but I
believe it wuz hern. Anyway, I know she earnt every mite of food
and drink you took into your miserable body.”
And the remembrance of Annie’s wrongs and woes so overmastered
me, that I sez right out—
“You drunken, low-lived snipe, you! how dast you be comin’ round
that good little creeter, and tryin’ to git her back into her starvation
and slavery, and peril of life and limb? How dast you, you drunken
coot, you?” sez I, a-lookin’ two or three daggers at him and some
simeters.
He quailed. I d’no as I ever see signs of quail any plainer than I see
it in him.
But he muttered sunthin’ about—“A man’s having a right to his wife
and child.”
“A right?” sez I; “do you dast to look anybody in the face and talk of
your right to wife and child, when it wuz your poor, abused, half-

You might also like