0% found this document useful (0 votes)
16 views

Beginning Oracle Application Express 5 3rd Doug Gault instant download

The document provides information about the book 'Beginning Oracle Application Express 5' by Doug Gault, which serves as a guide for web application development using Oracle's APEX tool. It includes links to various editions and related Oracle books available for download. The content outlines the structure of the book, including chapters that cover topics from introduction to advanced features of APEX.

Uploaded by

eliseeskey17
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
0% found this document useful (0 votes)
16 views

Beginning Oracle Application Express 5 3rd Doug Gault instant download

The document provides information about the book 'Beginning Oracle Application Express 5' by Doug Gault, which serves as a guide for web application development using Oracle's APEX tool. It includes links to various editions and related Oracle books available for download. The content outlines the structure of the book, including chapters that cover topics from introduction to advanced features of APEX.

Uploaded by

eliseeskey17
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/ 85

Beginning Oracle Application Express 5 3rd Doug

Gault download

https://ebookbell.com/product/beginning-oracle-application-
express-5-3rd-doug-gault-5312584

Explore and download more ebooks at ebookbell.com


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

Beginning Oracle Application Express 4 1st Edition Doug Gault

https://ebookbell.com/product/beginning-oracle-application-
express-4-1st-edition-doug-gault-2124346

Beginning Oracle Application Express Wrox Programmer To Programmer 1st


Edition Rick Greenwald

https://ebookbell.com/product/beginning-oracle-application-express-
wrox-programmer-to-programmer-1st-edition-rick-greenwald-2470572

Beginning Oracle Application Express Rick Greenwald

https://ebookbell.com/product/beginning-oracle-application-express-
rick-greenwald-4097838

Beginning Oracle Application Express 42 2nd Edition Doug Gault

https://ebookbell.com/product/beginning-oracle-application-
express-42-2nd-edition-doug-gault-4241718
Beginning Oracle Sql For Oracle Database 12c 3rd New Edition Gorman

https://ebookbell.com/product/beginning-oracle-sql-for-oracle-
database-12c-3rd-new-edition-gorman-20009618

Beginning Oracle Sql 1st Edition Lex De Haan Tim Gorman Karen Morton

https://ebookbell.com/product/beginning-oracle-sql-1st-edition-lex-de-
haan-tim-gorman-karen-morton-2009762

Beginning Oracle Database 11g Administrationfrom Novice To


Professional Iggy Fernandez Fernandez

https://ebookbell.com/product/beginning-oracle-
database-11g-administrationfrom-novice-to-professional-iggy-fernandez-
fernandez-23406232

Beginning Oracle Database 11g Administration From Novice To


Professional 1st Edition Iggy Fernandez

https://ebookbell.com/product/beginning-oracle-
database-11g-administration-from-novice-to-professional-1st-edition-
iggy-fernandez-23892448

Beginning Oracle Programming 1st Edition Sean Dillon Christopher Beck

https://ebookbell.com/product/beginning-oracle-programming-1st-
edition-sean-dillon-christopher-beck-4491322
T HE E X P ER T ’S VOIC E ® IN OR AC L E

Beginning Oracle
Application
Express 5
Your ticket to easy and robust
web-application development using
Oracle’s powerful toolset for
power-users, programmers, and
database administrators

Doug Gault
Beginning Oracle
Application Express 5

Doug Gault
Beginning Oracle Application Express 5
Copyright © 2015 by Doug Gault
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the
material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information
storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now
known or hereafter developed. Exempted from this legal reservation are brief excerpts in connection with
reviews or scholarly analysis or material supplied specifically for the purpose of being entered and executed
on a computer system, for exclusive use by the purchaser of the work. Duplication of this publication or
parts thereof is permitted only under the provisions of the Copyright Law of the Publisher’s location, in its
current version, and permission for use must always be obtained from Springer. Permissions for use may be
obtained through RightsLink at the Copyright Clearance Center. Violations are liable to prosecution under
the respective Copyright Law.
ISBN-13 (pbk): 978-1-4842-0467-2
ISBN-13 (electronic): 978-1-4842-0466-5
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol
with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only
in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the
trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are
not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to
proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication,
neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or
omissions that may be made. The publisher makes no warranty, express or implied, with respect to the
material contained herein.
Managing Director: Welmoed Spahr
Lead Editor: Jonathan Gennick
Technical Reviewer: Warren Capps
Editorial Board: Steve Anglin, Louise Corrigan, Jonathan Gennick, Robert Hutchinson,
Michelle Lowman, James Markham, Matthew Moodie, Jeffrey Pepper, Douglas Pundick,
Ben Renow-Clarke, Gwenan Spearing
Coordinating Editor: Jill Balzano
Copy Editor: April Rondeau
Compositor: SPi Global
Indexer: SPi Global
Artist: SPi Global
Distributed to the book trade worldwide by Springer Science+Business Media New York,
233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, email
[email protected], or visit www.springeronline.com. Apress Media, LLC is a California LLC
and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc).
SSBM Finance Inc is a Delaware corporation.
For information on translations, please e-mail [email protected], or visit www.apress.com.
Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use.
eBook versions and licenses are also available for most titles. For more information, reference our Special
Bulk Sales–eBook Licensing web page at www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this text is available to
readers at www.apress.com/. For detailed information about how to locate your book’s source code, go to
www.apress.com/source-code/.
To those in search of knowledge and better understanding,
I dedicate this effort. Hopefully, as your skills grow,
you too will continue to share the wealth.
—Doug Gault
Contents at a Glance

About the Authors���������������������������������������������������������������������������������������������������xix


About the Technical Reviewer��������������������������������������������������������������������������������xxi
Acknowledgments������������������������������������������������������������������������������������������������xxiii


■Chapter 1: An Introduction to APEX 5.0����������������������������������������������������������������� 1

■Chapter 2: A Developer’s Overview����������������������������������������������������������������������� 7

■Chapter 3: Identifying the Problem and Designing the Solution�������������������������� 37

■Chapter 4: SQL Workshop������������������������������������������������������������������������������������ 45

■Chapter 5: Applications and Navigation�������������������������������������������������������������� 67

■Chapter 6: Forms and Reports: The Basics������������������������������������������������������� 107

■Chapter 7: Forms and Reports: Advanced��������������������������������������������������������� 167

■Chapter 8: Programmatic Elements������������������������������������������������������������������ 231

■Chapter 9: Security�������������������������������������������������������������������������������������������� 259

■Chapter 10: Application Bundling and Deployment������������������������������������������� 287

■Chapter 11: Understanding Websheets������������������������������������������������������������� 309

■Chapter 12: A Websheet Example���������������������������������������������������������������������� 339

■Chapter 13: Extended Developer Tools�������������������������������������������������������������� 359

■Chapter 14: Managing Workspaces������������������������������������������������������������������� 383

v
■ Contents at a Glance


■Chapter 15: Team Development������������������������������������������������������������������������� 401

■Chapter 16: Dynamic Actions���������������������������������������������������������������������������� 431

■Appendix A: Page Designer Walkthrough and Reference���������������������������������� 449

Index��������������������������������������������������������������������������������������������������������������������� 469

vi
Contents

About the Author����������������������������������������������������������������������������������������������������xix


About the Technical Reviewer��������������������������������������������������������������������������������xxi
Acknowledgments������������������������������������������������������������������������������������������������xxiii


■Chapter 1: An Introduction to APEX 5.0����������������������������������������������������������������� 1
What Is APEX?������������������������������������������������������������������������������������������������������������������ 1
A Brief History of APEX����������������������������������������������������������������������������������������������������� 2
Ancient History��������������������������������������������������������������������������������������������������������������������������������������� 2
More Recent History������������������������������������������������������������������������������������������������������������������������������� 2
APEX 5.0 and the Future������������������������������������������������������������������������������������������������������������������������� 3

What You Need to Get Started������������������������������������������������������������������������������������������ 4


Access to an APEX Instance������������������������������������������������������������������������������������������������������������������� 5
Web Browser������������������������������������������������������������������������������������������������������������������������������������������ 5
SQL Developer���������������������������������������������������������������������������������������������������������������������������������������� 5

Summary�������������������������������������������������������������������������������������������������������������������������� 6

■Chapter 2: A Developer’s Overview����������������������������������������������������������������������� 7
The Anatomy of a Workspace������������������������������������������������������������������������������������������� 7
APEX Users��������������������������������������������������������������������������������������������������������������������������������������������� 8
Applications, Pages, Regions, and Items������������������������������������������������������������������������������������������������ 9
Workspaces, Applications, and Schemas��������������������������������������������������������������������������������������������� 10
A Final Word on Workspaces���������������������������������������������������������������������������������������������������������������� 12

A Tour of the APEX Modules������������������������������������������������������������������������������������������� 12


The Home Page������������������������������������������������������������������������������������������������������������������������������������ 13
Application Builder������������������������������������������������������������������������������������������������������������������������������� 16

vii
■ Contents

SQL Workshop�������������������������������������������������������������������������������������������������������������������������������������� 19
Packaged Apps������������������������������������������������������������������������������������������������������������������������������������� 32
Administration and Team Development������������������������������������������������������������������������������������������������ 35

Summary������������������������������������������������������������������������������������������������������������������������ 36

■Chapter 3: Identifying the Problem and Designing the Solution�������������������������� 37
Identifying System Requirements���������������������������������������������������������������������������������� 37
Never a Clean Slate������������������������������������������������������������������������������������������������������������������������������ 37
A Broken System���������������������������������������������������������������������������������������������������������������������������������� 38
How Do You Fix Things?������������������������������������������������������������������������������������������������������������������������ 38

System Design with APEX in Mind��������������������������������������������������������������������������������� 40


Table Definition and User-Interface Defaults���������������������������������������������������������������������������������������� 40
APEX and Primary Keys������������������������������������������������������������������������������������������������������������������������ 41
Business Logic vs. User-Interface Logic����������������������������������������������������������������������������������������������� 41
Placement of Database Objects������������������������������������������������������������������������������������������������������������ 42

Translating Theory to Practice���������������������������������������������������������������������������������������� 42


Summary������������������������������������������������������������������������������������������������������������������������ 43

■Chapter 4: SQL Workshop������������������������������������������������������������������������������������ 45
Creating Objects with the Object Browser��������������������������������������������������������������������� 45
Loading Data with the Data Workshop Utility����������������������������������������������������������������� 52
Creating a Lookup Table������������������������������������������������������������������������������������������������� 57
Loading and Running SQL Scripts���������������������������������������������������������������������������������� 60
User Interface Defaults��������������������������������������������������������������������������������������������������� 64
Understanding User Interface Defaults������������������������������������������������������������������������������������������������� 64
Defining UI Defaults for Tables������������������������������������������������������������������������������������������������������������� 64

Summary������������������������������������������������������������������������������������������������������������������������ 66

■Chapter 5: Applications and Navigation�������������������������������������������������������������� 67
The Create Application Wizard���������������������������������������������������������������������������������������� 67
Sample and Packaged Applications����������������������������������������������������������������������������������������������������� 68
Websheet Applications������������������������������������������������������������������������������������������������������������������������� 72

viii
■ Contents

Database Applications from Spreadsheets������������������������������������������������������������������������������������������� 72


Applications from Scratch�������������������������������������������������������������������������������������������������������������������� 73

Static Content Regions��������������������������������������������������������������������������������������������������� 82


Public Pages������������������������������������������������������������������������������������������������������������������� 87
Navigation Bar Entries���������������������������������������������������������������������������������������������������� 88
Global Pages������������������������������������������������������������������������������������������������������������������� 91
Breadcrumb Regions������������������������������������������������������������������������������������������������������ 93
Breadcrumb Entries������������������������������������������������������������������������������������������������������� 98
Lists�������������������������������������������������������������������������������������������������������������������������������� 99
Lists of Values ������������������������������������������������������������������������������������������������������������� 102
Static List of Values���������������������������������������������������������������������������������������������������������������������������� 103
Dynamic List of Values����������������������������������������������������������������������������������������������������������������������� 104

Summary���������������������������������������������������������������������������������������������������������������������� 106

■Chapter 6: Forms and Reports: The Basics������������������������������������������������������� 107
APEX Forms������������������������������������������������������������������������������������������������������������������ 107
Form on a Table������������������������������������������������������������������������������������������������������������ 109
Creating a Form on a Table����������������������������������������������������������������������������������������������������������������� 109
Modifying a Form on a Table�������������������������������������������������������������������������������������������������������������� 115
Looking Behind the Scenes���������������������������������������������������������������������������������������������������������������� 120

Form on a Procedure���������������������������������������������������������������������������������������������������� 122


Creating a Form on a Procedure��������������������������������������������������������������������������������������������������������� 122
Modifying a Form on a Procedure������������������������������������������������������������������������������������������������������ 125
Looking Behind the Scenes���������������������������������������������������������������������������������������������������������������� 126

Master–Detail Report and Form����������������������������������������������������������������������������������� 127


Creating a Master–Detail Report and Form���������������������������������������������������������������������������������������� 127
Modifying a Master-Detail Report������������������������������������������������������������������������������������������������������� 132

Session State��������������������������������������������������������������������������������������������������������������� 137


Understanding Session State������������������������������������������������������������������������������������������������������������� 137
Sharing Database Connections����������������������������������������������������������������������������������������������������������� 138

ix
■ Contents

Setting and Retrieving Session State������������������������������������������������������������������������������������������������� 139


Viewing Session State������������������������������������������������������������������������������������������������������������������������ 140

APEX Items������������������������������������������������������������������������������������������������������������������� 141


Page vs. Application Items����������������������������������������������������������������������������������������������������������������� 142
The Importance of Bind Variables������������������������������������������������������������������������������������������������������� 142
Built-In Items�������������������������������������������������������������������������������������������������������������������������������������� 143

APEX URL Syntax���������������������������������������������������������������������������������������������������������� 143


Searchable APEX Reports��������������������������������������������������������������������������������������������� 145
Creating a Searchable APEX Report��������������������������������������������������������������������������������������������������� 145
Adding Reset Pagination�������������������������������������������������������������������������������������������������������������������� 147
Looking Behind the Scenes—APEX Report���������������������������������������������������������������������������������������� 148
Looking Behind the Scenes—APEX Master–Detail Forms����������������������������������������������������������������� 150

More on APEX Forms���������������������������������������������������������������������������������������������������� 152


Item Layout����������������������������������������������������������������������������������������������������������������������������������������� 152
Placing Multiple Items in the Same Row�������������������������������������������������������������������������������������������� 154
Implementing LOVs����������������������������������������������������������������������������������������������������������������������������� 156
Master–Detail Cleanup����������������������������������������������������������������������������������������������������������������������� 159

APEX Help��������������������������������������������������������������������������������������������������������������������� 160


Adding a Help Text Region������������������������������������������������������������������������������������������������������������������ 161
Seeding Help Text������������������������������������������������������������������������������������������������������������������������������� 162

Declarative BLOBs�������������������������������������������������������������������������������������������������������� 163


Summary���������������������������������������������������������������������������������������������������������������������� 166

■Chapter 7: Forms and Reports: Advanced��������������������������������������������������������� 167
Tabular Forms�������������������������������������������������������������������������������������������������������������� 167
Creating a Tabular Form��������������������������������������������������������������������������������������������������������������������� 167
Modifying a Tabular Form������������������������������������������������������������������������������������������������������������������� 172
Looking Behind the Scenes���������������������������������������������������������������������������������������������������������������� 176

Interactive Reports������������������������������������������������������������������������������������������������������� 177


Creating an Interactive Report������������������������������������������������������������������������������������������������������������ 177
Running an Interactive Report������������������������������������������������������������������������������������������������������������ 181

x
■ Contents

Restricting Functionality by Report���������������������������������������������������������������������������������������������������� 182


Restricting Functionality by Column��������������������������������������������������������������������������������������������������� 184
Using the Column Heading Menu������������������������������������������������������������������������������������������������������� 184
Searching by Column�������������������������������������������������������������������������������������������������������������������������� 185
Selecting Columns������������������������������������������������������������������������������������������������������������������������������ 188
Filtering���������������������������������������������������������������������������������������������������������������������������������������������� 188
Sorting������������������������������������������������������������������������������������������������������������������������������������������������ 191
Adding Breaks������������������������������������������������������������������������������������������������������������������������������������ 191
Highlighting���������������������������������������������������������������������������������������������������������������������������������������� 192
Computing Columns��������������������������������������������������������������������������������������������������������������������������� 193
Adding Aggregates����������������������������������������������������������������������������������������������������������������������������� 194
Adding Charts to Interactive Reports�������������������������������������������������������������������������������������������������� 194
Grouping��������������������������������������������������������������������������������������������������������������������������������������������� 196
Pivot���������������������������������������������������������������������������������������������������������������������������������������������������� 197
Using Flashback��������������������������������������������������������������������������������������������������������������������������������� 198
Saving an Interactive Report�������������������������������������������������������������������������������������������������������������� 198
Resetting an Interactive Report���������������������������������������������������������������������������������������������������������� 200
Getting Help���������������������������������������������������������������������������������������������������������������������������������������� 200
Adding a Subscription������������������������������������������������������������������������������������������������������������������������ 201
Downloading��������������������������������������������������������������������������������������������������������������������������������������� 202
Modifying an Interactive Report��������������������������������������������������������������������������������������������������������� 204
Looking Behind the Scenes���������������������������������������������������������������������������������������������������������������� 212

Calendars��������������������������������������������������������������������������������������������������������������������� 213
Understanding Calendar Types����������������������������������������������������������������������������������������������������������� 214
Creating a Calendar���������������������������������������������������������������������������������������������������������������������������� 214
Looking Behind the Scenes���������������������������������������������������������������������������������������������������������������� 222

Charts��������������������������������������������������������������������������������������������������������������������������� 222
Writing Queries for Charts������������������������������������������������������������������������������������������������������������������ 223
Creating a Chart���������������������������������������������������������������������������������������������������������������������������������� 224

xi
■ Contents

Filtering Data for a Chart�������������������������������������������������������������������������������������������������������������������� 226


Looking Behind the Scenes���������������������������������������������������������������������������������������������������������������� 229

Summary���������������������������������������������������������������������������������������������������������������������� 229

■Chapter 8: Programmatic Elements������������������������������������������������������������������ 231
Conditions�������������������������������������������������������������������������������������������������������������������� 231
Required Values������������������������������������������������������������������������������������������������������������ 231
Validations�������������������������������������������������������������������������������������������������������������������� 234
Item-Level Validation�������������������������������������������������������������������������������������������������������������������������� 234
Page-Level Validation������������������������������������������������������������������������������������������������������������������������� 238
Tabular Form Validation���������������������������������������������������������������������������������������������������������������������� 240

Computations��������������������������������������������������������������������������������������������������������������� 242
Execution�������������������������������������������������������������������������������������������������������������������������������������������� 242
Types�������������������������������������������������������������������������������������������������������������������������������������������������� 243
Creating a Computation���������������������������������������������������������������������������������������������������������������������� 243

Processes��������������������������������������������������������������������������������������������������������������������� 246
Execution Points��������������������������������������������������������������������������������������������������������������������������������� 247
Process Types������������������������������������������������������������������������������������������������������������������������������������� 247
Processes in the Help Desk Application��������������������������������������������������������������������������������������������� 248

PL/SQL Regions������������������������������������������������������������������������������������������������������������ 251


Dynamic SQL���������������������������������������������������������������������������������������������������������������� 253
Summary���������������������������������������������������������������������������������������������������������������������� 258

■Chapter 9: Security�������������������������������������������������������������������������������������������� 259
User-Maintenance Navigation ������������������������������������������������������������������������������������� 259
User-Maintenance Data Entry�������������������������������������������������������������������������������������� 263
Authentication�������������������������������������������������������������������������������������������������������������� 269
Custom Authentication Schemes��������������������������������������������������������������������������������� 270
Conditional Security����������������������������������������������������������������������������������������������������� 272
Access Control������������������������������������������������������������������������������������������������������������� 273
Authorization���������������������������������������������������������������������������������������������������������������� 276

xii
■ Contents

Read-Only Items����������������������������������������������������������������������������������������������������������� 279


Data Security���������������������������������������������������������������������������������������������������������������� 281
Session-State Protection���������������������������������������������������������������������������������������������� 284
Summary���������������������������������������������������������������������������������������������������������������������� 285

■Chapter 10: Application Bundling and Deployment������������������������������������������� 287
Identifying Application Components����������������������������������������������������������������������������� 287
External Files�������������������������������������������������������������������������������������������������������������������������������������� 288
Database Objects�������������������������������������������������������������������������������������������������������������������������������� 288
APEX-Based Files������������������������������������������������������������������������������������������������������������������������������� 294
APEX Application Exports�������������������������������������������������������������������������������������������������������������������� 296

Supporting Objects������������������������������������������������������������������������������������������������������� 299


Prerequisites�������������������������������������������������������������������������������������������������������������������������������������� 300
Substitutions��������������������������������������������������������������������������������������������������������������������������������������� 301
Build Options�������������������������������������������������������������������������������������������������������������������������������������� 301
Validations������������������������������������������������������������������������������������������������������������������������������������������ 301
Install�������������������������������������������������������������������������������������������������������������������������������������������������� 301
Upgrade���������������������������������������������������������������������������������������������������������������������������������������������� 303
Deinstall���������������������������������������������������������������������������������������������������������������������������������������������� 303
Export������������������������������������������������������������������������������������������������������������������������������������������������� 303
Messages������������������������������������������������������������������������������������������������������������������������������������������� 303

Importing���������������������������������������������������������������������������������������������������������������������� 304
Summary���������������������������������������������������������������������������������������������������������������������� 308

■Chapter 11: Understanding Websheets������������������������������������������������������������� 309
Websheet Structure������������������������������������������������������������������������������������������������������ 309
Navigation�������������������������������������������������������������������������������������������������������������������� 311
Content Navigation����������������������������������������������������������������������������������������������������������������������������� 311
Structural Navigation�������������������������������������������������������������������������������������������������������������������������� 313

Help������������������������������������������������������������������������������������������������������������������������������ 313
Markup Syntax������������������������������������������������������������������������������������������������������������� 315

xiii
■ Contents

User Authentication������������������������������������������������������������������������������������������������������ 316


User Authorization�������������������������������������������������������������������������������������������������������� 318
Sections����������������������������������������������������������������������������������������������������������������������� 323
Text Sections�������������������������������������������������������������������������������������������������������������������������������������� 323
Navigation Sections���������������������������������������������������������������������������������������������������������������������������� 326
Data Sections������������������������������������������������������������������������������������������������������������������������������������� 327
Chart Sections������������������������������������������������������������������������������������������������������������������������������������ 337

Annotations������������������������������������������������������������������������������������������������������������������ 337
Administration�������������������������������������������������������������������������������������������������������������� 338
Summary���������������������������������������������������������������������������������������������������������������������� 338

■Chapter 12: A Websheet Example���������������������������������������������������������������������� 339
Setup���������������������������������������������������������������������������������������������������������������������������� 339
Creating and Configuring a Websheet Application������������������������������������������������������� 340
Adding Content to a Websheet������������������������������������������������������������������������������������� 345
Creating Data Grids����������������������������������������������������������������������������������������������������������������������������� 345
Applying Constraints��������������������������������������������������������������������������������������������������������������������������� 347
Adding Players������������������������������������������������������������������������������������������������������������������������������������ 348
Creating Alternate Default Reports����������������������������������������������������������������������������������������������������� 349
Creating Page Sections���������������������������������������������������������������������������������������������������������������������� 350
SQL Tags��������������������������������������������������������������������������������������������������������������������������������������������� 357
Access Controls������������������������������������������������������������������������������������������������������������ 358
Summary���������������������������������������������������������������������������������������������������������������������� 358

■Chapter 13: Extended Developer Tools�������������������������������������������������������������� 359
Page Locks������������������������������������������������������������������������������������������������������������������� 359
APEX Conflicts������������������������������������������������������������������������������������������������������������������������������������ 360
Locking an APEX Page������������������������������������������������������������������������������������������������������������������������ 360
Unlocking a Page�������������������������������������������������������������������������������������������������������������������������������� 361
Administering Page Locks������������������������������������������������������������������������������������������������������������������ 361

xiv
■ Contents

Application and Page Groups��������������������������������������������������������������������������������������� 362


Application Groups����������������������������������������������������������������������������������������������������������������������������� 362
Page Groups��������������������������������������������������������������������������������������������������������������������������������������� 364

APEX Views and the APEX Dictionary��������������������������������������������������������������������������� 364


The APEX Schema������������������������������������������������������������������������������������������������������������������������������� 365
APEX Views����������������������������������������������������������������������������������������������������������������������������������������� 365
APEX Dictionary���������������������������������������������������������������������������������������������������������������������������������� 368

Searching in APEX�������������������������������������������������������������������������������������������������������� 368


APEX Finder���������������������������������������������������������������������������������������������������������������������������������������� 368
Search Application������������������������������������������������������������������������������������������������������������������������������ 369

Monitoring Your APEX Application�������������������������������������������������������������������������������� 371


Enabling Logging�������������������������������������������������������������������������������������������������������������������������������� 371
Using the Activity Logs����������������������������������������������������������������������������������������������������������������������� 372
Login Attempts������������������������������������������������������������������������������������������������������������������������������������ 373

APEX Advisor���������������������������������������������������������������������������������������������������������������� 373


Build Options���������������������������������������������������������������������������������������������������������������� 375
Understanding the Need��������������������������������������������������������������������������������������������������������������������� 375
Creating a Build Option����������������������������������������������������������������������������������������������������������������������� 376
Configuring Build Options������������������������������������������������������������������������������������������������������������������� 377
Prompting for Build Option Status������������������������������������������������������������������������������������������������������ 377
Applying Build Options����������������������������������������������������������������������������������������������������������������������� 378
Reporting on Build Option Utilization�������������������������������������������������������������������������������������������������� 379
Page-Specific Utilities�������������������������������������������������������������������������������������������������� 379
APEX and Oracle SQL Developer���������������������������������������������������������������������������������� 380
Integration������������������������������������������������������������������������������������������������������������������������������������������ 380
Refactoring Support��������������������������������������������������������������������������������������������������������������������������� 381

Summary���������������������������������������������������������������������������������������������������������������������� 382

xv
■ Contents


■Chapter 14: Managing Workspaces������������������������������������������������������������������� 383
Learning About Your Environment�������������������������������������������������������������������������������� 383
Viewing Instance Information������������������������������������������������������������������������������������������������������������� 384
Checking the APEX Version����������������������������������������������������������������������������������������������������������������� 385

Managing the Service�������������������������������������������������������������������������������������������������� 385


Workspace Preferences���������������������������������������������������������������������������������������������������������������������� 386
Messages������������������������������������������������������������������������������������������������������������������������������������������� 387

Managing Meta Data���������������������������������������������������������������������������������������������������� 388


Developer Activity and Click Count Logs�������������������������������������������������������������������������������������������� 388
Session State�������������������������������������������������������������������������������������������������������������������������������������� 389
Application Cache������������������������������������������������������������������������������������������������������������������������������� 390
Websheet Database Objects��������������������������������������������������������������������������������������������������������������� 390
Application Build Status��������������������������������������������������������������������������������������������������������������������� 391
File Utilization������������������������������������������������������������������������������������������������������������������������������������� 391
Interactive Report Settings����������������������������������������������������������������������������������������������������������������� 392

Managing Users and Groups���������������������������������������������������������������������������������������� 393


Creating One User������������������������������������������������������������������������������������������������������������������������������� 393
Creating Multiple Users���������������������������������������������������������������������������������������������������������������������� 394
Organizing Users into Groups������������������������������������������������������������������������������������������������������������� 396

Viewing Usage Reports and Dashboards��������������������������������������������������������������������� 399


Summary���������������������������������������������������������������������������������������������������������������������� 399

■Chapter 15: Team Development������������������������������������������������������������������������� 401
Team Development Overview��������������������������������������������������������������������������������������� 401
Team Development Interface��������������������������������������������������������������������������������������� 403
APEX Home Page�������������������������������������������������������������������������������������������������������������������������������� 403
Team Development Home Page���������������������������������������������������������������������������������������������������������� 404
Common Design Elements������������������������������������������������������������������������������������������������������������������ 405
Drilldown Functionality����������������������������������������������������������������������������������������������������������������������� 406
Tagging����������������������������������������������������������������������������������������������������������������������������������������������� 408

xvi
■ Contents

Milestones�������������������������������������������������������������������������������������������������������������������� 409
Milestones Report Tab������������������������������������������������������������������������������������������������������������������������ 409
By Owner Tab�������������������������������������������������������������������������������������������������������������������������������������� 410
Features by Milestone Tab������������������������������������������������������������������������������������������������������������������ 410

Features����������������������������������������������������������������������������������������������������������������������� 411
Features Report Tab���������������������������������������������������������������������������������������������������������������������������� 411
History Tab������������������������������������������������������������������������������������������������������������������������������������������ 413
Progress Log Tab�������������������������������������������������������������������������������������������������������������������������������� 413

To-Do Items������������������������������������������������������������������������������������������������������������������ 414


Bugs����������������������������������������������������������������������������������������������������������������������������� 415
Feedback���������������������������������������������������������������������������������������������������������������������� 416
Configuring Feedback������������������������������������������������������������������������������������������������������������������������� 416
Polishing the Feedback Page������������������������������������������������������������������������������������������������������������� 419
Viewing Feedback������������������������������������������������������������������������������������������������������������������������������ 423
Responses to Feedback���������������������������������������������������������������������������������������������������������������������� 423
Communication Between Workspaces����������������������������������������������������������������������������������������������� 423

Team Development Utilities������������������������������������������������������������������������������������������ 424


Team Development Settings��������������������������������������������������������������������������������������������������������������� 424
Release Summary������������������������������������������������������������������������������������������������������������������������������ 425
Enable Files���������������������������������������������������������������������������������������������������������������������������������������� 426
Feature Utilities���������������������������������������������������������������������������������������������������������������������������������� 426
Manage Focus Areas�������������������������������������������������������������������������������������������������������������������������� 427
Update Assignees������������������������������������������������������������������������������������������������������������������������������� 427
View Files������������������������������������������������������������������������������������������������������������������������������������������� 427
Purge Data������������������������������������������������������������������������������������������������������������������������������������������ 427
Manage News������������������������������������������������������������������������������������������������������������������������������������� 428
Manage Links������������������������������������������������������������������������������������������������������������������������������������� 428

User Roles for Team Development������������������������������������������������������������������������������� 429


Summary���������������������������������������������������������������������������������������������������������������������� 429

xvii
■ Contents


■Chapter 16: Dynamic Actions���������������������������������������������������������������������������� 431
Dynamic Action Benefits���������������������������������������������������������������������������������������������� 431
Breaking Down Dynamic Actions��������������������������������������������������������������������������������� 431
Dynamic Actions in the Help Desk Application������������������������������������������������������������� 432
Starting Simple����������������������������������������������������������������������������������������������������������������������������������� 432
Using Page-Level Events�������������������������������������������������������������������������������������������������������������������� 439
Dynamic Actions with Multiple Triggering Elements�������������������������������������������������������������������������� 441
Dynamic Actions Using PL/SQL����������������������������������������������������������������������������������������������������������� 443
Dynamic Actions Using JavaScript����������������������������������������������������������������������������������������������������� 445

Summary���������������������������������������������������������������������������������������������������������������������� 447

■Appendix A: Page Designer Walkthrough and Reference���������������������������������� 449
Page Designer Overview���������������������������������������������������������������������������������������������� 449
Page Designer Toolbar�������������������������������������������������������������������������������������������������� 451
Tree Pane��������������������������������������������������������������������������������������������������������������������� 453
Central Pane����������������������������������������������������������������������������������������������������������������� 454
Grid Layout����������������������������������������������������������������������������������������������������������������������������������������� 455
Messages������������������������������������������������������������������������������������������������������������������������������������������� 457
Page Search��������������������������������������������������������������������������������������������������������������������������������������� 458
Help���������������������������������������������������������������������������������������������������������������������������������������������������� 459

Property Editor������������������������������������������������������������������������������������������������������������� 460


Gallery�������������������������������������������������������������������������������������������������������������������������� 467
Keyboard Shortcuts������������������������������������������������������������������������������������������������������ 467
Summary���������������������������������������������������������������������������������������������������������������������� 468

Index��������������������������������������������������������������������������������������������������������������������� 469

xviii
About the Author

Doug Gault is a Consulting Member of Technical Staff at Oracle


Corporation and has been working with Oracle since 1988, starting with
version 5.1B, SQL*Forms 2.0, and RPT/RPF. He has focused his career on
Oracle’s development technologies, spending the majority of that time
dedicated to web-based technologies, including the OWA Web Toolkit,
PL/SQL Server Pages, WebDB, Oracle Portal, and more recently HTML-DB
and APEX.
His many years of Oracle experience have taken him all over the
world to participate in some truly groundbreaking projects. Doug has
presented and participated in roundtable discussions at a number of
conferences, including Oracle OpenWorld, UKOUG, and ODTUG’s
APEXposed & Kaleidoscope conferences. He holds an Associate’s Degree
in Computer Science and an honorary Master’s Degree from The School of
Hard Knocks, believing there is no replacement for hard-earned experience.
Doug can be found on Twitter as @dgault_apex and on his blog at
douggault.blogspot.com.

xix
About the Technical Reviewer

Warren Capps, president of Illuminations Inc, has worked with Oracle


since 1987 when he worked on version 5.1a. Since 1991, his principal
efforts have been spent in training clients in the use of Oracle products,
concentrating on database server technologies. He is a well-known
presenter at user-group conferences and has written numerous articles
and book reviews for a variety of publications. He also ran an Oracle
bookstore for ten years and is a retired Navy Commander.
When not teaching, Warren has myriad activities to keep him busy.
He is an avid photographer and has run photography workshops in
southern New Mexico. His photography has led him to visit over
25 countries. Additionally, he plays classical guitar, collects coins, and
loves to travel the country with his wife and cat. He is currently a resident
of Austin, Texas.

xxi
Acknowledgments

First, my heart-felt thanks to all the co-authors of the original version of this book: Karen Cannell, Patrick
Cimolini, Martin D’Souza, and Tim St. Hilaire. Warren Capps also needs to be thanked for his technical
review efforts and his input on content and form. If not for these wonderful people, this book may never
have come to be. The opportunity to work with such a talented and distinguished group of individuals has
been a pleasure.
I’d also like to thank a few people who have been driving forces in my life: Kerry Osborne for providing
me with an immense amount of mentorship and encouragement over the years, even after having left his
employ; Cary Millsap for his friendship and helping to solidify in my mind how to think objectively about
technology and to use proof to find the truth; and last but not least, Scott Spendolini for his all-around
support before, during, and after the book. Without these people, I wouldn’t be where I am today.

—Doug Gault

xxiii
Chapter 1

An Introduction to APEX 5.0

Welcome to the wonderful world of Oracle Application Express (APEX). You’re about to learn how to use
a tool that will revolutionize the way you think about and approach writing web-based Oracle systems. It
certainly has done so for me.
Prior to the advent of APEX, developing fully interactive, web-based systems for data that resided within
an Oracle database almost always meant learning a new and often complex language like Java, .NET, or PHP
and then figuring out how to integrate your chosen language seamlessly with that data. Often this also meant
trying to incorporate business rules that were already coded in the form of PL/SQL program units.
In such situations, it could take months or even years just to become proficient enough with your
chosen language to begin to write a functional system. If you’re like many developers, you become frustrated
with the fact that you’ve spent an inordinate amount of time doing what seems to be a relatively easy task.
Fear not! The days of long-winded and complex web-development platforms may be behind you.

What Is APEX?
APEX is a 100% browser-based rapid application development (RAD) tool that helps you to create rich,
interactive, Oracle-based web applications very quickly and with relatively little programming effort.
There are many RAD development tools and platforms on the market. If you’re dealing with data that
resides in an Oracle database, a number of things make APEX distinctive and thus more attractive as a
development platform. First and foremost, APEX is built on and uses as its core languages SQL and PL/SQL.
This is a huge advantage for those of you who have already been working with the Oracle database, because
it means you can immediately draw on what you know. Even if you don’t have an Oracle background, but are
going to be working with an Oracle database, you need to learn about its particular flavor of SQL and will at
some point likely find a need for the PL/SQL procedural language.
PL/SQL program units become even more beneficial when migrating from an Oracle-based system that
already has a significant amount of business logic coded into stored PL/SQL program units. In this instance,
you can almost immediately take advantage of that logic with very little effort or changes to the existing code.
Another great advantage is that APEX is a declarative tool that provides a feature-rich core of
functionality designed to make your job easier. Because APEX takes care of many of the underlying functions
common to all web-based applications, you can focus on the logic specific to your application.
A large share of what you need to accomplish can be done using one of the many built-in wizards
provided as part of the APEX Application Builder. The wizards walk you through the process of defining what
you want your application to do and then store that information as metadata. Once a wizard is complete, you
can edit and enhance the functionality or even replace it with your own custom SQL and PL/SQL routines.
After you become proficient with APEX, you might even find yourself bypassing the wizards altogether and
generating more-complex definitions directly.

1
Chapter 1 ■ An Introduction to APEX 5.0

During the course of this book, you’ll likely discover that you want a few other tools at your disposal,
but, in truth, you could easily develop a very rich application using nothing but your web browser and what
APEX provides for you.

A Brief History of APEX


APEX has been around for quite some time—perhaps even longer than most people know. The first public
release of APEX, or HTML DB, as it was called then, came in 2004, but its history reaches back a long way.

Ancient History
APEX has its roots in technology that has been around for quite a while. In fact, parts of the PL/SQL Web
Toolkit, which is used under the covers by APEX to generate the HTML that is sent to the browser, date back
to as early as 1994.
At that point in time, you could actually write web applications in PL/SQL by hand, and unfortunately
many of us did. This required not only a thorough knowledge of PL/SQL and HTML, but also the patience of
a saint and the determination of a headstrong mule. The end result wasn’t very pretty, and it was definitely
not secure by today’s terms, but it was functional, if somewhat limited.
Not long after, Oracle introduced PL/SQL Server Pages (PSPs). This involved first coding the static
HTML and including special Oracle markup to indicate where dynamic data would go. Once you had the
output looking as you wanted, you then ran it through a program called LOADPSP. This would translate
the raw HTML and the special Oracle markup into a PL/SQL procedure that, again, used the PL/SQL Web
Toolkit to emit the HTML, including the dynamic data you requested. At the time, this was a huge leap
forward. I worked at a company where I built an entire framework using PSP technology and deployed it at
several clients.
Finally, in 1997, WebDB came on the scene. The true grandfather of what is now called APEX, WebDB
was revolutionary in that it was a 100% web-based tool that allowed developers to design web applications.
It was written entirely in PL/SQL, even though Java seemed to be taking over the world. Developers could
point WebDB at their database and generate code that would produce forms, reports, charts, and calendars.
There was no session-state management, and there were no templates; once the code was generated, you
couldn’t go back through the tool.
WebDB allowed a large number of companies that wanted to jump on the web-based bandwagon to do
so without spending vast amounts of time and effort retraining their staff. As a tribute to its success, I know
of a number of companies that still have WebDB systems running in production environments.
Unfortunately, WebDB’s days were numbered. Because it generated code (and if you didn’t like the code
it generated, then too bad for you), it had already begun to fade from favor by the time it was absorbed into
Oracle’s Portal product. However, creator Mike Hichwa didn’t forget the glimpse of greatness that WebDB
had seen.

More Recent History


Around 1999, Oracle CEO Larry Ellison presented Mike Hichwa (VP of Software Development) with the
task of creating an internal calendaring and scheduling system for Oracle Corp. The original remit was to
use WebDB to generate the initial code and then hand-code all the changes from that point forward. Mike,
however, saw this as an opportunity to completely rewrite WebDB into something that could be far more
useful. Thus, with the help of Joel Kallman and Tom Kyte, Oracle Flows was born.

2
Chapter 1 ■ An Introduction to APEX 5.0

Based on the success of the internal calendaring and scheduling system, the team was allowed to
move forward toward making Oracle Flows a product. In 2001, using what was then known as Flow Builder,
Mike and his team began implementing systems for various customers, including one situation where they
managed to replace a Java development project that was going horribly wrong.
By 2003, the team had proven the tool’s power, and they were given permission to release it as a
product. HTML DB 1.5 was released to the public as a no-cost option of Oracle 10gR1.
Since then, various releases have been introduced, each providing improved features and functionality.
The following is a very brief list of the releases and some of the more notable features:
• HTML DB 1.6 (2004) introduced themes, master-detail forms, page groups, page
locking, and some multilingual capabilities.
• HTML DB 2.0 (2005) introduced SQL Workshop, a graphical query builder, a
database object browser, and session-state protection.
• APEX 2.2 (2006) introduced packaged applications, the APEX dictionary views, and
the access control wizard.
• APEX 3.0 (2007) introduced PDF printing with BI Publisher, migration from
Microsoft Access, and page and region caching.
• APEX 3.1 (2008) introduced interactive reports, the runtime-only installation
capability, and improved security.
• APEX 3.2 (2009) introduced a migration helper for Oracle Forms–based systems and
various security enhancements.
• APEX 4.0 (2010) was a huge leap forward, introducing dynamic actions and plug-
ins—declarative ways to introduce server-side logic and extend the core APEX
environment, respectively. Also introduced was the new Team Development
module.
• APEX 4.1 (2011) included a new user-facing data-uploading feature, enhanced error-
handling capabilities, and much-improved support for tabular forms.
• APEX 4.2 (2012) originally introduced some new themes as well as enhancements
to the debugging API, but over its more than two-year life span, patch releases
introduced such changes as HTML 5 charting and deeper security enhancements.

APEX 5.0 and the Future


And so we arrive at the release of APEX 5.0. While the changes introduced with versions 4.0 through
4.2 undoubtedly changed the landscape of APEX development, the changes introduced in version 5.0
have brought APEX to a point where it can rightly be compared with many of the popular desktop-based
development environments.
The original focus of APEX 5.0 was to make development of rich, interactive web applications easier
by providing the developer with a vastly enhanced development environment. However, the development
team has introduced so many new features—indeed, new ways to attack problems—that it will be hard not to
choose APEX as the preferred development platform for Oracle-based applications.
APEX’s new Page Designer Integrated Development Environment (IDE) completely changes the way
developers will interact with page design. Modeled after many of the popular desktop IDEs, developers now
interact with items, placement, attributes, and actions all on one page. A new drag-and-drop page-layout
interface has been introduced that allows developers to easily position regions and items. Group editing

3
Chapter 1 ■ An Introduction to APEX 5.0

allows developers to edit the attributes of several items at once. The only downside to the new Page Designer
is that you may find yourself wanting a bit more screen real estate due to the nature of its layout. However,
with widescreen monitors becoming ubiquitous, this shouldn’t be an issue for most.
Apart from the new Page Designer IDE, one of the most exciting new features of APEX 5.0 is the
Universal Theme. This new application user interface does away with the need for the complex templates
from days gone by and enables developers to build more modern, responsive, and consistent applications
without needing to know the intricate details of HTML, CSS, or APEX template design.
The new Universal Themes (Desktop theme 42 and Mobile theme 51) allow you to adjust a number
of attributes with what is called a Theme Style—a Cascading Style Sheet (CSS) that is added to the base
CSS. This can be done via the new Theme Roller tool, allowing you to visually alter a theme. The Universal
Themes also allow you to easily customize how items on the page are displayed by using Template Options.
After having been in the cards for quite some time, the Flexible Workspace Authentication has finally
been implemented by the APEX team; this allows APEX administrators to define how APEX itself will
authenticate developers. Much like APEX applications, workspaces may now be authenticated against Single
Sign-On servers, LDAP, and so forth.
Interactive Reports are no longer limited to being one-per-page, freeing you from the restriction that
had plagued them since their inception. Interactive Reports also get a few new features. A Pivot View has
been added that allows end users to select the column(s) and provide the function(s) by which to pivot the
report. This was functionality previously available only by either a lot of hand coding or by creating or using
plug-ins. When using the new Universal Theme, Report column headers can now be defined so that they
remain fixed in position while the user scrolls down the page.
Native support for Dialog page types has been introduced, thus allowing any page to be displayed either
normally or as a pop-up dialog. Pages can be defined as either “Modal” or “Non-Modal.” Modal pages do not
allow the end user to interact with the underlying page, whereas Non-Modal pages allow such interaction.
New jQuery Mobile and Tablet themes have been introduced and make use of the newer features of the
latest jQuery Mobile libraries. Panels, pop-ups, and dialogs (among other things) are now all available in the
mobile interface.
An improved charting engine provides enhanced performance for large datasets. Improvements to
accessibility for the visually impaired have been added. A new APEX_AUTHORIZATION package has been
added to aid in the management of authorization within an application. And the list goes on.
As you can see, the APEX core functionality continues to grow with each release. But what you may not
know is that you can help drive the future direction of APEX. By going to the following URL, you can not only
request new features, but also view and vote on features that others have requested. You need an Oracle
Technical Network account, but it’s free and easy to sign up:

https://apex.oracle.com/pls/apex/f?p=55447:1

To get a view of what the APEX team is committed to providing, you can read the most recent Statement
of Direction (SoD). It may take a short time after a release for this to be updated, but it normally contains an
overview of the main functional areas for the next planned release. You can find the SoD at the following URL:

www.oracle.com/technetwork/developer-tools/apex/application-express/apex-sod-087560.html

What You Need to Get Started


The goal of this book is to get you started using APEX, to launch you in a way that enables you to grow
toward mastery of the product. To begin, you need three things: access to an APEX instance, access to a web
browser, and a copy of SQL Developer.

4
Chapter 1 ■ An Introduction to APEX 5.0

Access to an APEX Instance


This is definitely a hands-on book, so to work through the examples and exercises you need access to an
instance of APEX 5.0. There are a number of different ways you can access APEX; depending on your level of
comfort and expertise with Oracle, some may be better for you than others. Here is a description of the three
most common scenarios:
• By far the easiest is to sign up for an account on Oracle’s hosted version of APEX at
https://apex.oracle.com. It’s free for nonproduction applications and is a great
place to get started, because you don’t have to worry about installing either the
database or APEX.
• If you already have an Oracle database installed locally, you can download and
install APEX 5.0 into that instance. Simply go to the Oracle APEX home page at
http://otn.oracle.com/apex and download the latest version of the software.
• If you don’t have an Oracle database already but would like to install one locally,
you can download a free developer’s license version of the database from Oracle
Technology Network (OTN) at http://otn.oracle.com/database. Both Oracle 11g
and 12c run APEX 5.0. Both allow you to install APEX (albeit an earlier version) as an
option during the database install.
Although having a locally accessible instance of the Oracle database gives you more direct access to the
data, it’s definitely not necessary for completing the exercises in this book. All code and instructions have
been written so that they can be completed on Oracle’s hosted instance with no special access required.

■ Note Oracle provides very good documentation on the installation process for both the database and
APEX, so it isn’t covered in detail here. However, if you’re planning to install APEX on an environment in your
organization, you should coordinate with the database administrator responsible for that instance to ensure that
no mishaps occur.

Web Browser
The APEX documentation states that to view or develop APEX applications, you must have a web browser
that supports cookies, JavaScript, HTML 5, and CSS 3. However, although you can deploy to any browser that
supports these things, the list of supported browsers is fairly narrow. Currently, the following browsers are
supported: Internet Explorer 9+, Firefox 35+, Apple’s Safari 7+, and Google Chrome 40+.
Without getting into a religious debate about which web browser is the best on the market, the author’s
preference for development is either Firefox or Chrome due to the number of developer tools and add-ons
that can help you with APEX development. Note that because of the difference in the way each browser
interprets HTML and JavaScript, you must test your application in any and all web browsers that your target
audience might use.

SQL Developer
As mentioned before, all the exercises and scripts in this book can be loaded and run directly within the
APEX interface. However, if you have chosen to install or have access to a local instance of the Oracle
database, a SQL IDE will definitely make your life easier.

5
Chapter 1 ■ An Introduction to APEX 5.0

SQL Developer is a free SQL and PL/SQL IDE provided by Oracle. You can download SQL Developer
from the OTN’s home page at http://www.oracle.com/sqldeveloper.
Using SQL Developer, you can browse database objects, edit row data, develop and test stored PL/SQL
program units, code and test SQL statements, and interactively debug PL/SQL code. SQL Developer also
has many direct integration points with APEX that make reporting in, monitoring, and maintaining APEX
instances and applications easier. This book doesn’t cover those, but it’s definitely worth your time to look
into this tool.

Summary
Oracle Application Express has come a long way from its simple beginnings, and the APEX community is
poised at the beginning of a new cycle of growth. APEX 5.0 provides so much possibility and promise that
it’s hard not to be excited about what the future holds. With that spirit, you’re ready to begin your journey to
discover how APEX can make development easier and more fun.

6
Chapter 2

A Developer’s Overview

You’re probably anxious to get started, but there are a few concepts you should understand before you jump
into APEX development headfirst. This chapter will introduce the fundamental development architecture of
APEX and then walk you through the different areas of the developer interface.
You will delve deeper into the details as you go through the book and put the architecture to work, but
it will help tremendously to know how things are structured ahead of time. This chapter is designed to ease
you in, but it isn’t a complete guided tour of every nook and cranny. Be patient; you’ll get there.

The Anatomy of a Workspace


APEX was designed from the beginning to be a multi-tenant architecture where many different development
environments (called workspaces) can exist in a single APEX instance. For instance, apex.oracle.com,
Oracle’s free hosted instance, holds over 10,000 active workspaces, each of which is a completely separate
environment unable to see or interact with any of the others. You can think of this as Software as a Service
(SaaS) or a cloud-computing architecture, but basically it means each workspace is distinct and segregated
from all others.
In simple terms, each workspace represents a virtual private container in which developers create and
deploy their APEX applications. The development process takes place in the context of a workspace, so it’s
important to know how a workspace is structured. Figure 2-1 uses database entity-relationship diagram
parlance to help explain the makeup of the objects in a workspace.

Figure 2-1. Logical makeup of a workspace

7
Chapter 2 ■ A Developer’s Overview

A workspace may have:


One to many users: These users may one of three types: Administrator, Developer,
or End User.
Zero to many applications: Applications can be added from the list of packaged
applications, imported, or created from scratch.
One to many schemas: Although a workspace must be assigned at least one
schema when it’s created, an Instance Administrator may assign multiple
schemas to a workspace.
There can be many applications and many schemas in a workspace, but an application may only parse
as one (and only one) schema, which can only be set during development. The following sections delve
more deeply into this to give you a full understanding of how these concepts relate.

APEX Users
To log in to an APEX workspace, you must have access to a valid APEX user. A number of different user roles
are available that dictate what you can do when you log in. The roles are as follows:
• Instance Administrators are special users who manage and maintain the overall
APEX instance. They can set instance-level preferences and messages, create and
manage workspaces, monitor space utilization, and perform many other actions
related to the overall APEX installation. Instance Administrators are only able to
log in to the special INTERNAL workspace, which houses the APEX Admin Services
application.
• Workspace Administrators are responsible for managing the details of a specific
workspace and can manage user accounts related to the workspace, monitor
workspace activity, view log files, override developer locks and settings, and so
on. Although it isn’t good practice, the Workspace Administrator can also act as a
Developer, creating and modifying applications.
• Developers are the users who create and edit the applications in the workspace. They
have access to the underlying tables in the schema(s) assigned to the workspace
and may create and modify database objects and stored PL/SQL units. Most people
writing APEX applications only need this level of access.
• End Users are only able to run applications in a workspace. They don’t have direct
access to any of the underlying database objects, nor do they have access to any of
the APEX development modules. End users can’t log directly into a workspace.
With the exception of the APEX Instance Administrator, in a default installation APEX users are specific
and unique to a workspace, meaning you can have users with the same name in multiple workspaces in a
single APEX instance, but each of these users is unique. They can have their own passwords and settings and
aren’t linked together in any way.
APEX 5.0 introduces the ability to use an external repository, such as Single Sign-on or LDAP, as a source
to assign and validate APEX users, meaning that a single user could have access to multiple workspaces.
However, this functionality is not set up by default and requires an Instance Administrator to configure.
When you’re developing, you should get in the habit of logging in as a Developer as opposed to a
Workspace Administrator. Several safeguards are available to help keep developers from stepping on each
other in a workspace. If you log in as a Workspace Administrator, these safeguards are bypassed, and you
may accidently interfere with something someone else is working on. Although this isn’t a problem in a
workspace with only one developer, it’s still good to get into that habit.

8
Chapter 2 ■ A Developer’s Overview

■ Note This book uses the last three types of user. It assumes that APEX has been installed, a workspace
has been created, and you have been given the Workspace Administrator’s login credentials. If you’re using
the hosted instance at apex.oracle.com, then the user name you were given when you signed up has the
credentials of a Workspace Administrator. If, however, you’re using a local instance, either refer to the APEX
documentation or get your Instance Administrator to help you set up a workspace.

Applications, Pages, Regions, and Items


Although a workspace starts off basically empty, you can have many applications that reside in a workspace.
There is no specific rule, but it’s likely that all the applications in a workspace share something: they might
all use the same underlying database objects, target the same user community, or use the same method for
authenticating users.
As you build an application, you add new pages and build out those pages with regions and items.
Figure 2-2 shows the hierarchy of the different types of objects.

Figure 2-2. General application hierarchy

9
Chapter 2 ■ A Developer’s Overview

Applications are basically groups of pages that perform a task (or set of tasks) related to a business
function. During the course of this book, you’ll build one application in a single workspace, but it’s
important to know that in a typical development environment, you’ll probably be working on many
applications across several workspaces.
Pages are the basic building blocks of applications and contain both the user-interface (UI) components
and the programming logic that processes the user’s input. We cover the rendering of the UI versus the
processing of user input later, but for now consider a page to be roughly equivalent to a screen in desktop
UI lingo.
Regions are UI items that serve as content containers. You can have any number of regions on a page,
and regions can be nested in other regions. This gives you the opportunity to create things like dashboards,
where you might nest a data report region and a graph region in a single parent HTML region.
Items are the HTML form elements that are used to present the UI to the user. These include things such
as buttons, select lists, text fields, check boxes, radio groups, and so on. There are two categories of items:
page-level items and application-level items. The difference is that the latter are defined at the application
level and aren’t rendered directly on the page. You can think of these as global variables. Page-level items
are defined on a specific page and are assigned to a region in order to control where and how they display to
the user.
There is obviously a lot more to an application than these simple building blocks, but if you understand
the basic hierarchy between these, you’ll have a jumpstart when it comes to building your first pages and a
solid foundation when it’s time to perform more intricate tasks.

Workspaces, Applications, and Schemas


Although the relationship between workspaces and applications is straightforward, it becomes a bit more
complex when you introduce the relationship with database schemas. Figure 2-3 diagrams this relationship.

Figure 2-3. How schemas relate to workspaces and applications

When a workspace is created, it’s linked with at least one, and possibly many, underlying database
schemas. This provides access to database objects such as tables, views, stored PL/SQL program units, and
so on.
When an application is created, it’s assigned a single “parse as” schema from the list of schemas
associated with the workspace. A “parse as” schema is the Oracle database user in which all SQL queries
and PL/SQL calls run by that application are executed. So, if your application was defined with a “parse as”
schema of DOUG, a query such as

select * from emp

would execute in the database as if it were written

select * from DOUG.emp

10
Chapter 2 ■ A Developer’s Overview

Because APEX applications are portable and may not necessarily be run in the same schema they were
developed in, it’s not good practice to hard code the schema names into your SQL or PL/SQL. Instead, APEX
provides a replacement variable (one of many you’ll be introduced to throughout the course of this book) for
the “parse as” schema. The #OWNER# replacement variable is substituted for the actual “parse as” schema for
the application at runtime. So the statement

select * from #OWNER#.emp

resolves to

select * from DOUG.emp

In the most common implementations, a workspace is created and associated with a single underlying
database schema. The applications developed in that workspace have their “parse as” schema set to the only
schema associated with the workspace and use the database objects belonging to that schema.
Where a workspace has more than one schema assigned to it, things can become a little more complex.
You might be tempted to think that if you associate three schemas with a workspace, any application in that
workspace can automatically access the data in all three schemas. However, you would be mistaken.
Because an application is assigned one—and only one—“parse as” schema, all SQL statements and PL/
SQL calls are executed as that schema. Although the workspace may be associated with multiple schemas,
the application itself isn’t. If you want to access data in a schema other than the application’s “parse as”
schema, you must make sure the correct database-level grants are in place, just as you would when using
any other Oracle tool or development environment.
Take a look at the example shown in Figure 2-4, where two tables you wish to join as part of a SQL
statement are owned by separate schemas.

Figure 2-4. Tables joined across schemas

If your “parse as” schema is DOUG, then you must be specifically granted privileges on the objects in the
JOEY schema to be able to access it. To do this, you sign on to the database as JOEY (or as a DBA) and grant
the appropriate database privileges on JOEY.DEPT to DOUG.
In this example, if you needed to join the two tables together in a select statement, granting the SELECT
privilege on JOEY.DEPT to DOUG would suffice. Then, you could write your select statement as follows:

select e.empno,
e.ename,
d.dept_name,
d.location
from #OWNER#.emp e,
JOEY.dept d
where e.deptno = d.deptno

The #OWNER# substitution variable would be resolved to your “parse as” schema (DOUG), and the join
would work correctly as long as the correct privileges were in place.

11
Chapter 2 ■ A Developer’s Overview

■ Note Because the grants that allow the select from the JOEY schema are put in place at the database
level, it isn’t necessary to associate the JOEY schema to your workspace. You only need to associate a schema
to a workspace if you’ll be using it as the “parse as” schema for an application in that workspace or need to
access the schema objects directly from within the SQL Workshop.

A Final Word on Workspaces


As you have learned, an APEX instance can have many workspaces. But how many workspaces should there
be? The answer isn’t straightforward.
Unless you’re in a very small organization with very few apps, you probably shouldn’t have only one
workspace. On the other hand, you probably shouldn’t create a new workspace for every new application
you code, either.
There are a couple schools of thoughts on this, but I tend to think in terms of application suites. If a
number of applications are performing similar tasks against the same underlying data sets and are aimed at
the same target set of users, then they would probably do well in the same workspace.
The key is to use your judgment and try to keep things easy to develop and maintain. There is nothing
worse than logging in to a workspace to find you have to page through tens or even hundreds of apps to find
the one you want to work on.

A Tour of the APEX Modules


Now that you have a little background on how things are logically architected, it’s time to get a closer look at
the APEX development environment. This section will introduce you to the different sections of the APEX
environment and give you an overview of how things are laid out.
Figure 2-5 shows a hierarchical layout of the APEX menu structure. Later, you will look at each of the
main sections and glimpse what’s under the covers; this is just an introductory tour. You will get a much
deeper look as we work our way through the development processes.
As you can see, the development environment is broken into five main sections:
• The Application Builder is where you create and modify applications and pages, and
it’s where you’ll probably spend most of your time.
• The SQL Workshop is where you deal directly with the underlying database objects
and their related data. Think of it as a web-based version of SQL*PLUS with some
GUI goodness thrown in to make things easier.
• Team Development is the section that lets you enter and track information related to
the development of APEX applications.
• Packaged Apps provides a way to install and manage the myriad of applications
that come with Oracle APEX. Many of these applications can be used out of the
box to solve real business problems. Others are merely sample applications to help
demonstrate the capabilities of APEX.
• Administration is where you can manage the details of your workspace—its defaults,
users, groups, and so on. Be aware that a Workspace Administrator has more options
available to them than a standard developer has.

12
Chapter 2 ■ A Developer’s Overview

Figure 2-5. APEX 5.0 hierarchical menu structure

The Home Page


Once you log in to your workspace, you’re presented with the workspace Home page, as shown in Figure 2-6.
The Home page is your gateway to the rest of the development environment and provides some high-level
information about what’s going on in the workspace.

13
Chapter 2 ■ A Developer’s Overview

Figure 2-6. APEX development Home screen

Along the top is the navigation bar containing the main navigation structure available to you throughout
the developer interface. It gives direct access to many of the sections you will need quick access to while
you’re developing applications. It’s worth noting that each main option of the menu bar is broken down
into two pieces. For instance, if you click directly on the Application Builder item, you’re immediately taken
to the Application Builder home page. However, if you click the small downward-pointing arrow just to the
right, you’re presented with a more detailed drop-down menu that lets you choose your destination a bit
more granularly, as in Figure 2-7

14
Chapter 2 ■ A Developer’s Overview

Figure 2-7. Using the drop-down menus on the menu bar

At the right of the navigation bar is a set of four menu options represented by icons, as shown in
Figure 2-8.

Figure 2-8. Right-hand icons on the navigation bar

First is a search icon that, when clicked, allows you to perform context-sensitive searches. The context
of the search depends on where you are in the Application Builder. For instance, if you’re on the workspace
Home page, your search is across the entire workspace. However, if you’re in the Application Builder or the
Administration section, the search is limited contextually to those specific areas.
Second is the Administration menu. This menu will be available to you whether you are a Workspace
Administrator or a Developer. The difference will be what functionality you have access to. Developers will
have access to monitoring certain areas of the workspace activity and to the dashboards, while Workspace
Administrators will have full access to all functionality including user maintenance and service requests.
Third is the help menu, which provides access to online documentation, the APEX Support Forums, the
APEX section of the Oracle Technical Network site, and an About section.
Last is a link to the profile of the currently logged in user. Here, the user will be able to edit their details,
update their profile picture, and change their password.
At the very bottom of the browser is an information region that displays the currently logged in user, the
current workspace, the language, and the current version of Oracle APEX.

15
Chapter 2 ■ A Developer’s Overview

The rest of the page is dedicated to either giving you a quick link to the four main sections or providing
you with information about what’s going on in the workspace.
The first two regions, from left to right, show an overview of the activity in the workspace. They show the
Top Applications and the Top Users in the workspace. The News & Messages region allows the developers
in a workspace to enter information they want others in the workspace to see. In a new workspace, there
probably won’t be anything in these regions, but as you work your way through the book, you’ll see that start
to change.
Notice that most of the main pages for each section of the development environment adhere to this
dashboard-style home page interface, the notable exception being the Application Builder. Let’s look at that
section first.

Application Builder
The Application Builder is the core of the APEX application-development environment. Whereas you’ll use
the SQL Workshop to manipulate the underlying database objects, you’ll use the Application Builder to do
most of the real work when it comes to coding, testing, and debugging your applications.

The Application Builder Home Page


Clicking the Application Builder menu option takes you to the Application Builder home page. Like most
of the home pages, it’s laid out with the menu bar across the top and regions that hold tasks and quick links
down the right side.
The main difference is that Application Builder home page doesn’t house any dashboard-style
summaries. Instead, this is where you see a list of the different applications contained in your workspace.
(Figure 2-9 provides an example.) It’s possible, depending on your APEX instance settings, that you might
see some sample applications installed by the Workspace Administrator, but don’t be alarmed if you don’t
see any applications at all.

16
Chapter 2 ■ A Developer’s Overview

Figure 2-9. The Application Builder home page

Figure 2-9 shows one application in the workspace, named Sample Master Detail. However, there isn’t
much information about it other than its name and the application ID (118). This is where you begin to see
the beauty of what APEX can do, not only in the developer UI, but also in your applications.
The list of applications you see is actually a style of report called an Interactive Report (IR). IRs allow us
to customize how reports and their contents are displayed. IRs are used throughout the APEX development
interface and can also be used when creating your own applications. They’re extremely powerful tools, and
you’ll use them a lot.
On the right side of the page are three regions that show About information, recently edited
applications, and a link to the Application Migration wizard. You will deal more with these later; for now, we
will drill in to see the details of an application.

The Application Home Page


Clicking any one of the applications listed drills into the Application home page, as shown in Figure 2-10.
This page is very similar to the Application Builder home page, but it shows all the pages in a specific
application. Again, it uses an IR, so you can customize the way you see this data.

17
Chapter 2 ■ A Developer’s Overview

Figure 2-10. The Application home page

Notice the way the page is structured, with page-related tasks and recently edited pages presented along
the right side of the page. This layout will become a familiar theme as you navigate through the interface.
From here, you can click any of the listed pages to edit that page using the Page Designer. You can also
run, export, and import the application, edit the supporting objects or shared components, and access the
application-related utilities.

The Page Designer


The Page Designer is where you’ll be spending most of your time as a developer creating and editing pages,
regions, and items. The Page Designer in APEX 5.0 is a complete departure from previous versions and is now
presented in a way that much more closely resembles traditional Desktop IDE layout. This change has brought
us the ability to manage components and edit their layout and properties from a single-page interface.

18
Chapter 2 ■ A Developer’s Overview

One of the biggest changes is that, due to the single-page interface, alterations to a page must now be
explicitly saved. While this may seem disruptive, it actually brings with it some useful functionality. For
instance, now multiple changes can be made and saved all at once, potentially reducing development time.
Also, unsaved changes can now be easily undone.
Another major time-saving feature is the ability to select multiple components on a page using
Shift+Click (or Cmd+Click on Mac). Once multiple items are selected, you can edit their common
properties in the property editor. This can be useful if, for instance, you want to edit the attributes of all
buttons on a page to set their visual properties to all be the same.
Region and item placement has been enhanced with the introduction of a drag-and-drop interface. All
rendering components can be easily placed or rearranged on the page.
The layout of the new Page Designer is quite in-depth and, if you’re not familiar with it, can potentially
be a bit perplexing. Appendix A at the back of this book will give you a detailed tour of the Page Designer and
its components, laying out the nomenclature that will be used through the rest of this book. Take a moment
to thumb through Appendix A to familiarize yourself with the terms and the placement of the tools.
It is my goal for the rest of this book to take you through the development process in a way that will
help you naturally learn how to use the Page Designer. However, if you’re ever confused by an instruction or
forget what a particular tool is called, referring to Appendix A should help clear things up.

SQL Workshop
The SQL Workshop is a suite of tools that provides developers with the ability to view and manage database
objects in the underlying schema(s) assigned to the workspace. The SQL Workshop home page shown
in Figure 2-11 lets you access each of the underlying tools and gives some high-level information about
recently created objects and commands that that have been run.

19
Chapter 2 ■ A Developer’s Overview

Figure 2-11. The SQL Workshop home page

Because there may be more than one schema assigned to the workspace, a schema-selection dialog
at right allows you to select and set the default schema for all the tools. You may change the schema you’re
working in within each of the tools as well.
The main tools available as part of the SQL Workshop are displayed in the toolbar at the top of the page.
Each of the individual tools deserves its own introduction, so let’s spend some time now looking at what they
are and what they can do. You’ll use this area of APEX more heavily when you create the database objects for
your application.

The Object Browser


If you’ve been working with databases for any length of time, you’ve probably used one of the more popular
GUI tools that allows you to browse and manage database objects in a schema. The APEX Object Browser is
a very similar tool presented through your web browser. Figure 2-12 shows the Object Browser being used to
examine the table EBA_DEMO_MD_DEPT.

20
Chapter 2 ■ A Developer’s Overview

Figure 2-12. The APEX Object Browser

The name Object Browser is somewhat of a misnomer, because the tool can be used not only to browse
the objects in the underlying schema(s), but also to create new objects, browse and edit data, delete objects,
and edit object definitions. Although there are some limitations on the types of objects it can manipulate, it’s
powerful enough to do most of the daily tasks that an application developer needs to tackle.
You choose the object type you want to work with by selecting it from the drop-down list in the upper-
left corner. You can search the selected object type by entering a text string in the search box just below it
and clicking the refresh icon to the right. Clicking the name of an object displays its properties along with
links to drill into more details.
Although the interface for the Object Browser is pretty intuitive, there are some interesting things to note. In
the upper-right corner is a drop-down list that allows you to set the current schema. The list contains all schemas
currently assigned to the workspace. You can switch between them simply by choosing a new one from the list.

The SQL Commands Interface


The SQL Commands interface allows you to interact with the underlying schema(s) using standard SQL
commands or PL/SQL as you would in any other GUI tool or in SQL*Plus. The difference is that you can
save the statements for use at a later time. Figure 2-13 shows a simple SQL statement as executed in the SQL
Commands interface.

21
Chapter 2 ■ A Developer’s Overview

Figure 2-13. The SQL Commands interface

22
Chapter 2 ■ A Developer’s Overview

Although its core function is quite straightforward, the SQL Commands interface is more robust than
it first appears. Beyond the ability to save and retrieve SQL and PL/SQL, it can also run explain plans on
statements and allow you to view your statement history. Therefore, if you ran a script or statement that was
particularly useful, but you forgot to save it, you still have the ability to retrieve it from the history buffer.
The SQL Commands interface also integrates with the Query Builder (described later), allowing you to
load and manipulate saved statements that were built in the Query Builder.

■ Note By default, all SQL statements executed via the SQL Commands interface are automatically
committed. To override this setting and enter into transactional mode, uncheck the Autocommit check box in the
toolbar. Once this is done, you can manually both commit and roll back your SQL statement.
There is no way to turn off Autocommit permanently, so you need to remember to do this any time you want to
enter transactional mode.

SQL Scripts Interface


The SQL Scripts interface allows you to manage and run sets of SQL commands that are saved into script
files. A single script can contain one or more SQL statements or PL/SQL blocks. SQL scripts coded outside
of APEX can be loaded into the SQL script repository and edited or run from there. You can also create SQL
scripts from scratch using the SQL Scripts interface. Figure 2-14 shows the main SQL Scripts interface page.

Figure 2-14. The main SQL Scripts interface page

23
Chapter 2 ■ A Developer’s Overview

In this example, one script, called database_objects.sql, is loaded into the script repository. By
clicking the Edit icon, you can edit the contents of the script, as shown in Figure 2-15. Helpfully, APEX
provides syntax highlighting in the Script Editor. The editor also has a Find and Replace function and
autocomplete, as well as undo and redo capabilities.
You can also download the script to a local file so you can edit it in your favorite local text editor. When
you’re done, simply cut and paste it back into the editor or upload it as a new script file.

Figure 2-15. The SQL Script Editor

24
Chapter 2 ■ A Developer’s Overview

■ Note When you upload a script file to the repository, the name of the script must be unique. You can’t
overwrite an existing script file of the same name with a new version without first deleting the existing script
from the script repository.

Once a script is ready to run, you can click the Run icon in the list (or the Run button in the editor), and
you’re stepped through the Run Script wizard. This allows you to choose whether you want to run the script
immediately or run it in the background. If you choose Run in Background, your script is entered into a
queue, and it is executed when it reaches the front of the queue.
Either way, you’re taken to the Manage Script Results page of the SQL Scripts interface, as shown in
Figure 2-16. This screen allows you to see the status and certain high-level details of the script’s execution. In
the case of scripts that have been submitted in batch mode, you can also see the status of specific scripts in
the queue.

Figure 2-16. The Manage Script Results page

25
Chapter 2 ■ A Developer’s Overview

Clicking the View Results icon shows you the final results of running the script. In Figure 2-17, you can
see that the script had errors, the details of which are displayed in the body of the report. If the script were
successful, no errors would be shown, and the statement results at the bottom of the page would show
zero errors.

Figure 2-17. An example of errors from the SQL Scripts interface

■ Note Although both the SQL Commands and the SQL Scripts interfaces can accept and run standard SQL
statements, the extended commands of SQL*PLUS aren’t valid in these tools.

The SQL Commands interface throws an error when it encounters any SQL*PLUS-specific commands. However,
the SQL Scripts interface warns the user of the existence of SQL*PLUS commands in a script being run and then
ignores them if the user chooses to continue. Because of this, the SQL Commands and SQL Scripts interfaces
can’t perform many of the functions of extended SQL*Plus scripts.

26
Chapter 2 ■ A Developer’s Overview

The Query Builder


Although the Query Builder has been relegated to the Utilities page, it merits discussion specifically because
it’s helpful to beginners. The Query Builder allows you to build SQL select statements using a more
graphical interface, and although it’s not quite drag and drop, it’s fairly intuitive.
When you first enter the Query Builder, you’re presented with a screen that lists all the tables and views
available in the currently active schema. Figure 2-18 shows the initial Query Builder screen.

Figure 2-18. The initial Query Builder screen

From here, you can begin to build your query. To include a table in your select statement, simply click
it in the list to the left. A representation of the table is placed in the blank region of the screen above the
Conditions region. You may add as many tables as you like to your query, and can even include the same
table more than once by clicking it again. Notice that if you include more than one instance of the same
table, the new instance is suffixed with a sequence number differentiating it from the original table.

27
Chapter 2 ■ A Developer’s Overview

Figure 2-19 shows an example graphical representation for the DEMO_ORDERS table and outlines the
different interactive features.

Figure 2-19. The DEMO_ORDERS table as represented in the Query Builder

Taken from top to bottom as they appear in Figure 2-19, these action areas are as follows
• Table Actions displays a dialog allowing you to do one of several things:
• Check All allows you to quickly select or deselect all columns of the object for
inclusion in the query being built.
• Add Parent allows you to select and add a parent table, as defined by foreign-
key relationships, to the Query Builder.
• Add Child allows you to select and add a child table, as defined by foreign-key
relationships, to the Query Builder.
• Show/Hide Columns expands and collapses the object so the column definitions are
shown or hidden.
• Remove deletes the table and any of its related clauses from the select statement.
• Select Column for Join is activated by clicking the blank square next to a column
name. Doing so darkens the square and puts the Query Builder into Table Link
mode. Then you can click another blank square, either in another table or in the
same table, and the Query Builder inserts an EQUALITY where clause between the
two columns in the SQL statement.

28
Random documents with unrelated
content Scribd suggests to you:
XII

THE CHILD AT HOME

There are upon earth many millions of people—most of them


children. Mankind has been continuous upon earth for millions of
years; children have been equally continuous. Children constitute a
permanent class, the largest class in the population. There are men,
there are women, there are children, and the children outnumber
the adults by three to two.

In the order of nature, all things give way before the laws and
processes of reproduction; the individual is sacrificed to the race.
Natural forces, working through the unconscious submission of the
animal, tend steadily to improve a species through its young.

Social forces, working through our conscious system of education,


tend to improve our species through its young. Humanity is
developed age after age through a gradual improvement in its
children; and since we have seen this and learned somewhat to
assist nature by art, humanity develops more quickly and smoothly.

Every generation brings us more close to recognition of this great


basic law, finds us more willing to follow nature's principle and bend
all our energies to the best development of the child. We early
learned to multiply our power and wisdom by transmission through
speech, and, applying that process to the child, we taught him what
we knew, saving to humanity millennial periods of evolution by this
conscious short-cut through education.

Nature's way of teaching is a very crude one—mere wholesale


capital punishment. She kills off the erring without explanation. They
die without knowing what for, and the survivors don't know, either.
We, by education, markedly assist nature, transmitting quick
knowledge from mouth to mouth, as well as slow tendency from
generation to generation. More and more we learn to collect race-
improvement and transmit it to the child, the most swift and easy
method of social progress. To-day, more than ever before, are our
best minds giving attention to this vital problem—how to make
better people. How to make better bodies and better minds, better
tendencies, better habits, better ideas—this is the study of the
modern educator.

Slowly we have learned that the best methods of education are more
in modifying influence than in transmitted facts; that, as the proverb
puts it, "example is better than precept." The modifying influences of
social environment have deeper and surer effect on the human race
than any others, and that effect is strongest on the young.
Therefore, we attach great importance to what we call the "bringing
up" of children, and we are right. The education of the little child,
through the influences of its early environment, is the most
important process of human life.

Whatever progress we make in art and science, in manufacture and


commerce, is of no permanent importance unless it modifies
humanity for the better. That a race of apes should live by
agriculture, manufacture, and commerce is inconceivable. They
would cease to be apes by so living; but, if they could, those
processes would be of no value, the product being only apes. We are
here to grow, to become a higher and better kind of people. Every
process of life is valuable in proportion to its contributing to our
improvement, and the process that most contributes to our
improvement is the most important of human life. That process is
the education of the child, and that education includes all the
influences which reach him, the active efforts of parent and teacher,
the unconscious influence of all associates, and the passive effect of
the physical environment.
All these forces, during the most impressionable years of childhood,
and most of them during the whole period, are centered in the
home. The home is by all means the most active factor in the
education of the child. This we know well. This we believe devoutly.
This we accept without reservation or inquiry, seeing the power of
home influences, and never presuming to question their merit.

In our general contented home-worship we seem to think that a


home—any home—is in itself competent to do all that is necessary
for the right rearing of children. Or, if we discriminate at all, if we
dare admit by referring to "a good home" that there are bad ones—
we then hold all the more firmly that the usual type of "a good
home" is the perfect environment for a child. If this dogma is
questioned, our only alternative is to contrast the state of the child
without a home to that of the child with one. The orphan, the
foundling, the neglected child of the street is contrasted with the
well-fed and comfortably clothed darling of the household, and we
relapse into our profound conviction that the home is all right.

Again the reader is asked to put screws on the feelings and use the
reason for a little while. Let us examine both the child and the
home, with new eyes, seeing eyes, and consider if there is no room
for improvement. And first, to soothe the ruffled spirit and quiet
alarm, let it be here stated in good set terms that the author does
NOT advocate "separating the child from the mother," or depriving it
of the home. Mother and child can never be "separated" in any such
sense as these unreasoning terrors suggest. The child has as much
right to the home as anyone—more, for it was originated for his
good. The point raised is, whether the home, as it now is, is the best
and only environment for children, and, further, whether the home
as an environment for children cannot be improved.

What is a child? The young of the human species. First, a young


animal, whose physical life must be conserved and brought to full
development. Then, a young human, whose psychical life, the
human life, must be similarly cared for.

How does the home stand as regards either branch of development?


In what way is it specifically prepared for the use, enjoyment, and
benefit of a child? First, as to the structure of the thing, the house.
We build houses for ourselves, modifying them somewhat according
to climate, position, and so on. How do we modify them for
children? What is there in the make-up of any ordinary house
designed to please, instruct, educate, and generally benefit a child?
In so far as he shares our own physical needs for shelter and
convenience he is benefited; but, as a child, with his own specific
necessities, desires, and limitations, what has the architect planned
for the child—what have the mason and carpenter built for the child?
Is there anything in the size and proportion, the material, the
internal arrangement, the finish and decoration, to hint of the
existence of children on earth?

The most that we find, in the most favoured houses, is "a sunny
nursery." In one home of a thousand we find one room out of a
dozen planned for children. What sort of an allowance is this for the
largest class of citizens? Suppose our homes had, among the more
expensive ones, one room for the adult family to flock into, and all
the rest was built and arranged for children! We should think
ourselves somewhat neglected in such an arrangement. But we are
not as numerous as our children, nor as important; and, in any case,
the home belongs to the child; he is the cause of its being; it is for
him, hypothetically, that we marry and start a home.

What, then, is the explanation of this lack of special provision for the
real founder of the home? This utter unsuitability of the house to the
child, and the child to the house, finds its crowning expression in our
cities, where house-owners refuse to let their houses to families with
children! What are houses for? What are homes for? For children,
first, last, and always! How, then, have we come to this vanishing
point of absurdity? What paradoxical gulf stretches between these
houses where "no children need apply" and the rest of the houses.
There is no visible difference in their plans and construction. No
houses are built for children; and these particular landlords simply
accent the fact, and try to limit the use of the house to the persons
for whom it was intended—the adults.

What is there in the presence of children in a house to alarm the


owner? "They are so destructive," he will tell you; "they are
mischievous, they are noisy. Other tenants object to them. They
injure the house when old enough to run about, and squall
objectionably when babies." All this is true enough. Most babies are
a source of distress to their immediate neighbours because of their
painful wailing, and most little children continue to cause distress by
their noise in play and shrieks under punishment. Is all this outcry
necessary? Must the poor baby suffer by night and day; must the
small child bang and yell, and must it be punished so frequently?
Why is the process of getting acclimated to the world so difficult and
agonising? Is there really no way that the experience of all the ages
may be turned to account to facilitate the first years of a child's life?

Our behaviour to the child rests on several assumptions which are,


at least, not proven. We assume that he has to be sick. We assume
that he has to be naughty. We assume that life is hard and
unpleasant, anyway, and that, the sooner he learns this and gets
broken into it, the better. There is no more reason why a child
should be sick than a calf or colt. Infancy is tender, and needs care,
but it is not a disease. The Egyptian mother loves her baby, no
doubt, though it goes blind through her ignorance and neglect—she
knows nothing of ophthalmia, and lets the flies crawl over its
helpless face, even while she loves it. We scorn and pity her
ignorance, but we accept the colic, disorders of teething, and all the
train of "preventable diseases" which kill off our babies, precisely as
she accepts ophthalmia.
We have not learned yet how to make a baby the happy, contented,
smoothly developing little animal that he should be. Some of us do
better than others, but the knowledge of one is no gain to the rest,
being confined to one family. Slowly the wider human care, the
larger love, the broader knowledge, of doctor, nurse, and teacher are
penetrating the innermost fortress of the home, and teaching the
mother how to care for the child. The home did not teach her, and
never would. In the untouched homes of ancient Eastern races,
countless generations of mothers transmit the same traditional
mistakes, love in the same blind way, and weep the same loss as
unprofitably as they did ten thousand years ago.

In the homes of civilised races, where the light of social progress is


most fully felt, we see the most improvement; but even here the
pressure of growing knowledge is still combated by the jealous
arrogance of the untaught mother, and the measureless inertia of
the home.

In plain fact, what does the average home offer to the newcomer,
the utterly defenceless baby, the all-important Coming Generation?
See physical conditions first. To what sort of world is the new soul
introduced? To a place built and furnished for several mixed and
conflicting industries; not to a place planned for babies—aired,
lighted, heated, coloured, and kept quiet to suit the young brain and
body; but a building meant for a number of grown people to cook in,
sweep and dust in, wash and iron in, cut and sew in, eat and wash
dishes in, see their friends in, dress, undress, and sleep in; and
incidentally, in the cracks and crevices of all these varied goings on,
to "bring up" children in.

In that very small percentage of families where a nursery is arranged


for children, and a nurse and a nursery-governess do deputy service
for the always alleged "mother's care," we find some provision made
for children; but of what sort? This deputy is inferior to the mother,
save in a certain rule-of-thumb experience which enables her to
"manage children." Her knowledge of infant hygiene is not much
greater, nor of infant psychology. Look, for instance, at the babies of
our richer classes, as we see them continually in the streets and
parks. Our only alternative from the home is the street, we having as
yet no place for our babies. If near a park so much the better, but in
general the sidewalk must serve, for rich or poor.

As one immediate physical condition, examine the dress of these


babies and young children; this among parents of wealth, and,
presumably, intelligence. See the baby in the perambulator so rolled
and bedded in, so tucked and strapped, that he cannot move
anything but perhaps a stiffly projecting arm. Think of an adult
cocooned in this manner, unable to roll, stir, turn, in any way relieve
the pressure or change the attitude. And, when you have considered
the sensations of a tough and patient adult frame, think further of
those of a soft, tender, active, and impatient baby body.

The dress of a baby or little child bears no relation to his immediate


comfort or to the needs of his incessant growth. Among our wisest
parents there is to-day a new custom, happily increasing, of barefoot
freedom, of dirt-proof overalls, of a chance for beautiful,
unconscious growth; but this does not reach the vast majority of
suffering little ones. It does not spread because of the seclusion and
irresponsible dominance of the separate home; and further—
because of the low-grade intelligence of the home-bound mother.

She whose condition of arrested development makes her


unquestioningly submit to the distortion, constriction, weight, and
profusion of fashion in clothing for her own body, is not likely to
show much sense in dressing a child. Beautiful fabrics, rich textures,
expensive adornments, she heaps upon it. She wishes it to look
pretty, according to her barbaric taste; and she disfigures the grave,
sweet beauty of a baby face, the lovely moving curves of the little
body, with heavy masses of stiff cloth, starched frippery, and huge,
nodding, gaily decorated hats that would please an Ashantee
warrior.

If some cartoonist would give us a copy of the Sistine Mother and


Child in the costume of our mothers and children, showing those
immortal cherub faces blinking obliquely from under flopping hat
brims and rich plumes, perhaps we might in sudden shocked
perception see with what coarse irreverence we disfigure our blessed
little ones.

The child does not find in the home any assurance of health, beauty,
or free growth. He, and especially she, must wear the dainty
garments on which our misguided mother love so wastefully lavishes
itself; and must then be restricted in all natural exercise lest they be
torn or soiled. To dress a little child so that he may be perfectly
comfortable, and grow in absolute freedom, has not occurred to the
home-bound mother.

Neither has she learned how to feed it. If the home is the best place
for children, if the home is the best place for the preparation of food,
would it not seem as if in all these long, long years we might have
evolved some system of feeding little children so as to keep them at
least alive—to say nothing of their being healthy?

The animal mother, guided by her unspoiled instinct, does manage


to feed her young, and to teach it how to feed itself. The human
mother, long since cut off from that poor primitive guidance, and
proudly refusing to put knowledge in its place, feeds the baby in
accordance with her revered domestic traditions, and calls in the
doctor to remedy her mistakes. One man, in Buffalo, has recently
saved fifteen hundred babies in a year, lowering the annual death
rate by that amount, by public distribution of directions for preparing
milk. He was not a mother. He was not shut up in a home. He
studied and he taught in the light of public progress, in a growing
world; and succeeded in filtering some of this saving knowledge into
the darkness of fifteen hundred homes.
The average child is not fed properly; and there is nothing in the
home to teach the mother how. She must learn outside, but she is
not willing to. She still believes, and her husband with her, in the
infallible power of "a mother's love" and "a mother's care"; and our
babies are buried by thousands and thousands without our learning
anything by the continual sacrifice. This is owing to the isolation of
the home. If there were any general knowledge, general custom,
association, comparison; if mothers considered their enormous
responsibility as a class, instead of merely as individuals, this could
not be. Knowledge and experience have to be gathered by wide and
prolonged study; they do not come by an infinite repetition of the
same private experiments.

We have to-day the first stirring of this great multitude of separately


concealed experimenters toward that association and exchange of
view, that carefully recorded observation, that reasonable study,
which are necessary for any human advance. Our mothers are
beginning to come out of their isolation into normal human contact;
to take that first step toward wisdom—the acknowledgment of
ignorance; and to study what little is known of this new science,
Child-culture.

But it is only a beginning, very scant and small, and ridiculed


unmercifully by the great slow dead-weight of the majority. The
position of the satirist of modern motherhood is a safe and easy one.
To ally one's self with the great mass of present humanity, and the
far greater mass of the past, of all our hoary and revered traditions,
and to direct this combined weight against the first movement of a
new idea—this is an old game. Humanity has thus resisted every
step of its own progress; but, though it makes that progress difficult
and slow, it cannot wholly prevent it.

If the home and the home-bound mother do not ensure right food or
clothing for the child, what do they offer in safety, and in the
increasing educational influence which early environment must
have? As to safety—the shelter of the home—we have already seen
that even to the adult the home offers no protection from the main
dangers of our time: disease, crime, and fire or other accident. The
child not only shares these common dangers, but is more exposed to
them, owing to more absolute confinement to the home and greater
susceptibility. Whatever we suffer from sewer-gas, carbonic dioxide,
or microbes and bacteria, the child suffers more.

He breathes the dust of our carpets, and eats it if we do not watch


him. "I can't take my eyes off that child one minute," cries the
admiring mamma, "or he'll be sure to put something in his mouth!"
That a perfectly clean place might be prepared for a creeping baby,
where there was nothing whatever he could put in his mouth, has
never occurred to her. The child shares and more than shares every
danger of the home, and furthermore suffers an endless list of
accidents peculiar to his limitations. Even our dull nerves are roused
to some sort of response by the terrible frequency of accidents to
little children.

I have here a number, taken from one newspaper in one city during
one year; not exhaustive daily scrutiny either; merely a casual
collection:

"Mother and Baby Both Badly Burned." A three-year-old baby this—a


match, a little night-dress flaming, struggle, torture, death! "Choked
in Mother's Arms" is the next one; the divine instinct of Maternity
giving a two-year-old child half a filbert to eat. It was remarked in
the item that the "desolate couple" had lost two other little ones
within two months. It did not state whether the two others were
accidentally murdered by a mother's care.

"Child's Game Proved Fatal" is the next. Three-years-old twins were


these; "playing fire engine in the parlour while their mother prepared
the midday meal."
One climbed on the table and lit a newspaper at a gas jet, and set
fire to the other. It is then related "Both children cried out, but their
mother, thinking they were only playing, did not hasten to find what
was the matter." "The child died at 3 P.M." is the conclusion.

"Accidentally Killed His Baby" follows. The fond father, holding his
two-year-old son on his knee, shot and killed him with a revolver
"which he believed to be empty."

"Escaping Gas Kills Baby"—"Boy Has Cent in His Throat"—"Insane


Mother's Crime"—"Drowns her Eight-year-old Daughter"—and here a
doctor says, "It would be an excellent idea for every family to have a
little book giving briefly prompt antidotes for various poisons.
Physicians know that there are scores of cases of accidental
poisoning never heard of outside the family concerned. I've had
several cases of poisoning by an accidental dose of chloroform and
aconite liniment, and one woman gave her child muriatic acid that
was kept for cleaning the marbles."

Another "Mother and Child Burned"—"Child Scratched by a 60-foot


Fall"—(this one was saved by striking several clothes-lines after she
fell out of the window)—"Kitten was Life Preserver"—another fall out
of a window, but the child was holding a kitten, and her head struck
on it—so only the kitten was smashed.

"A Governor's Child badly Hurt"—"will probably prove fatal," this was
a two-story drop over a staircase; and shows that it is not only in
the homes of the poor that these things happen. Another "Baby
Burned" follows—this poor little one was left strapped into its
carriage, and set fire to by an enterprising little brother.

"Tiny Singer Fell Dead" describes a five-year-old boy as singing a


selection from "Cavalleria Rusticana" as a means of entertaining a
party of young friends—and burst a blood-vessel in the brain. Then
there is a story of a grisly murder in which a tiny child testifies as to
seeing her father kill her mother; the child was not hurt—physically.
And then a bit of negative evidence quite striking in its way,
describing "The Mother of Twenty-five Children" and incidentally
stating "of these only three sons and four daughters are now living."
Seven out of twenty-five does not seem a large proportion to survive
the perils of the home.

These are a few, a very few, instances of extreme injury and death.
They are as nothing to the wide-spread similar facts we do not hear
of; and as less than nothing to the list of minor accidents to which
little children are constantly exposed in the shelter of the home. We
bar our windows and gate our stairs in some cases; but our principal
reliance is on an unending watchfulness and a system of rigid
discipline. "Children need constant care!" we maintain; and "A child
must be taught to mind instantly, for its own protection." A child is
not a self-acting poison or explosive. If he were in an absolutely safe
place he might be free for long, bright, blessed hours from the
glaring Argus-eyed watchfulness which is so intense an irritant.
Convicts under sentence of death are in their last hours kept under
surveillance like this, lest they take their own lives. Partly lest the
child injure himself among the many dangers of the home, and
partly lest he injure its frail and costly contents, he grows up under
"constant watching." If this is remitted, he "gets into mischief" very
promptly. "Mischief" is our broad term for the natural interaction of a
child and a home. The inquiry of the young mind, and the activity of
the young body, finding no proper provision made for them,
inevitably fall foul of our complicated utensils, furniture, and
decorations, and what should be a normal exercise becomes
"mischief."

Our chapter of accidents here leads us to the great underlying field


of education. Say that the child lives to grow up, during these wholly
home-bound years; in spite of wrong clothing, wrong feeding, and
the many perils we fatuously call "incident to babyhood" (when they
are only incident to our lack of proper provision for babyhood). If he
battles through his infancy and early childhood successfully, what
has he gained from his early environment in education? What are
the main facts of life, as impressed upon every growing child by his
home surroundings?

The principal fact is eating. This he learns perforce by seeing his


mother spending half her time on that one business; by seeing so
much house-space given to it; by the constant arrival of food
supplies, meat, groceries, milk, ice, and the rest; and excursions to
get them. The instincts of early savagery, which every child has to
grow through, are heavily reinforced by the engrossing food-
processes of the home.

They do not necessarily please him or her, either. The child does not
grow up with a burning ambition to be a cook. Whether the ever-
present kitchen business was run by the mother or by a servant, it
was not run joyously and proudly; nor was it run in such wise as to
really teach the child the principles of hygiene in food-values and
preparation. If the family is a wealthy one the child is not allowed in
the kitchen perhaps, but is the more impressed by the complicated
machinery of the dining-room, and that elaborate cult of special
"manners" used in this sacred service of the body. Thus and thus
must he eat, and thus handle his utensils; and if the years and the
tears spent in acquiring these Eleusinian mysteries make due
impression on the fresh brain tissue, then we may expect to find the
human being more impressed by the art of eating than by any other.

And so we do find him. The children of the kitchen are differently


affected from the children of the dining-room. These last, of our
"upper classes," receive the indelible stamp of the tri-daily ritual, and
go through the rest of life thinking more highly of "table manners"
than of any other line of conduct, for the reason that they were
more incessantly, thoroughly, and importunately taught that code
than any other. To handle a fork properly is insisted upon far more
imperatively than to properly handle a temper.
The principal business of the home being the care of the body, and
this accomplished through these archaic domestic industries, the
unending up-current of young life, which should so steadily purify
and uplift the world, in every generation is steeped anew in this
exaggeration of physical needs and caprices.

Beyond the overwhelming cares of the table the other home


industries involve the care and replenishment of furniture and
clothes. Hour after hour, day after day, the child sees his mother
devoting her entire life to attendance upon these things—the daily
cleaning, the weekly cleaning, the spring and fall cleaning, the
sewing and mending at all times.

These things must be done, by some people, somewhere; but must


they be done by all people, that is by all women, the people who
surround the child, and all the time? Must the child always associate
womanhood with house-service; and assume, necessarily assume,
that the main business of life is to be clean, well-dressed, and eat in
a proper manner?

If the mother is not herself the house-servant—what else is she?


What does the growing brain gather of the true proportions of life
from his dining-room-and-parlour mamma? Her main care, and talk,
is still that of food and clothes; and partly that of "entertainment,"
which means more food and more clothes.

Can we not by one daring burst of effort imagine a home where


there was still the father and mother love, still the comfort,
convenience, and beauty we so enjoy, still the sweet union of the
family group, and yet no kitchen? Perhaps even, in some remote
dream, no dining-room? Where the mother was a wise, strong,
efficient human being, interested in and working for the progress of
humanity; and giving to her baby, in these sweet hours of
companionship, some true sense of what life is for and how it works.
No, we cannot imagine it, most of us. We really cannot. We are so
indelibly kitchen-bred, or dining-room-bred, that mother means
cook, or at least housekeeper, to our minds; and family means
dinner-table.

So grows the child in the home. In the school he learns something of


social values, in the church something, in the street something; from
his father, who is a real factor in society, something; but in the home
he learns by inexorably repeated impressions of every day and hour,
that life, this deep, new, thrilling mystery of life consists mainly of
eating and sleeping, of the making and wearing of clothes. We are
irresistibly reminded of the strange text, "Take no thought of what
ye shall eat or what ye shall drink or wherewithal ye shall be
clothed." A little difficult to follow this command when mother does
nothing else!
XIII

THE GIRL AT HOME

What is the position of the home toward us in youth? We have seen


something of its effect upon the child, the wholly helpless child, who
knows no other place or power. We have seen something of its effect
upon the woman in her life-long confinement there. Between
childhood and maturity comes youth; holding what is left of the
child's pure heart and vivid hopes, and what begins to stir of man's
or woman's power. The gain of a race, if there is a gain, must make
itself felt in youth—more strength, more growth, more beauty, a
larger conscience, a sounder judgment, a more efficient will.

Each new generation must improve upon its parents; else the world
stands still or retrogrades. In this most vivid period of life how does
the home meet the needs of the growing soul? The boy largely
escapes it. He is freer, even in childhood; the more resistant and
combative nature, the greater impatience of pain, makes the young
male far harder to coerce. He sees his father always going out, and
early learns to view the home from a sex-basis, as the proper place
for women and children, and to push incessantly to get away from it.

From boy to boy in the alluring summer evenings we hear the cry,
"Come on out and have some fun!" Vainly we strive and strive anew
to "keep the boys at home." It cannot be done. Fortunately for us it
cannot be done. We dread to have them leave it, and with good
reason, for well we know there is no proper place for children in the
so long unmothered world; but even in danger and temptation they
learn something, and those who struggle through their youth
unscathed make better men than if they had been always softly
shielded in the home.
The world is the real field of action for humanity. So far humanity
has been well-nigh wholly masculine; and the boy, feeling his
humanity, pushes out into his natural field, the world. He learns and
learns, from contact with his kind. He learns about all sorts of
machinery, all manner of trades and businesses. He has companions
above him and below him and beside him, the wide human contact
in which we grow so rapidly. If he is in the city he knows the city, if
he is in the country he knows the country, far more fully than his
sister. A thousand influences reach him that never come to her,
formative influences, good and bad, that modify character. He has
far less of tutelage, espionage, restraint; he has more freedom by
daylight, and he alone has any freedom after dark. All the sweet,
mysterious voices of the night, the rich, soft whisperings of fragrant
summer, when the moon talks and the young soul answers; the
glittering, keen silence of winter nights, when between blue-black
star-pointed space and the level shine of the snow stands but one
living thing—yourself—all this is cut off from the girl. The real
intimacy with nature comes to the soul alone, and the poor, over-
handled girl soul never has it.

In some few cases, isolated and enviable, she may have this
common human privilege, but not enough to count. She must be
guarded in the only place of safety, the home. Guarded from what?
From men. From the womanless men who may be prowling about
while all women stay at home. The home is safe because women are
there. Out of doors is unsafe because women are not there. If
women were there, everywhere, in the world which belongs to them
as much as to men, then everywhere would be safe. We try to make
the women safe in the home, and keep them there; to make the
world safe for women and children has not occurred to us. So the
boy grows, in the world as far as he can reach it, and the girl does
not grow equally, being confined to the home. In very recent years,
within one scant century, we are letting the girls go to school, even
to college. They pour out into the larger field and fill it at once. Their
human faculties have some chance to grow as well as the over-
emphasised feminine ones; and in our schools and colleges youth of
both sexes finds the room, stimulus, and exercise it could not find at
home.

The boy who does not go to college goes to business, to work in


some way. To find an able-bodied intelligent boy in a home between
breakfast and supper would argue a broken leg. But girls we find by
thousands and thousands; "helping mother," if mother does the
work; and if there are servants to do the work, the girl does—what?

What is the occupation of the daughter of the house? Let us


suppose her to be healthy. Let us suppose her to have a fair share of
ability and education. She has no longer the school or the college,
she has only the home. Not that she is physically confined there. She
may go out by daylight, giving careful account of her steps, and visit
other girls in their homes. She may receive visits, both from girls and
boys; and she may go out continually to all manner of
entertainments. Perhaps she is expected to dust the parlour, to
arrange the flowers, to "keep up her music." She has enough to eat,
enough and more than enough to wear; but what exercise has she
for body or brain? Perhaps in games and dances she keeps her body
active—but what sort of occupation is that for a young human
creature of this century, a creature of power? The young woman has
the same race inheritance of ability, the same large brain-growth, as
the man. The physical improvement of our times is reflected in them
too; fine stalwart girls we see, tall, straight, broad-shouldered. She
has had, in specific education, the same mental training as the boy.

How would her brother be content with a day's work of dusting the
parlour and arranging the flowers; of calling and being called on?
Amusement is good, sometimes necessary; best and most necessary
to the tired, unhappy, and overworked. But youth—healthy, happy,
and vigorous, full of the press of unused power and the
accumulating ambition of all the centuries—why should youth waste
its splendour in such unsatisfying ways?

If you ask the father, he will merely say that it is the proper position
for a girl; he is "able to support her," she does not "have to work,"
she can amuse herself, and as for a field for her abilities—she will
find that in her own home when she is married. Ask her mother—
and she will tell you, making a sad confession all unknowingly—"let
her enjoy herself now; she will have care enough later." There is a
tacit agreement that girls shall have all the "good time" possible
while they are girls, that they may have it to remember! Does this
"good time" satisfy the girl? Is she happy in her father's home, just
passing the time till she moves into her husband's?

Sometimes she is. Her education has been strong to make her so.
The home atmosphere of predominant clothes and food has been
about her from the cradle, and she still has clothes and food, and
may elaborate them without limit. She may devote as much time to
the adornment of the table as she wishes; and if her inclination take
her also to the kitchen, perhaps even to the cooking school, that is
more than well. She may also devote herself to the parlour and its
adornment; but most naturally of all to the adornment of her own
young body—all these are proper functions of the home. She may
love and serve her immediate dear ones also, to any extent; that is
the basic principle of it all, that is occupation enough for any girl.
Yes, there is occupation enough as far as filling time goes; but how
if it does not satisfy? How if the girl wants something else to do—
something definite, something developing?

This is deprecated by the family. "Work" is held by all to be a thing


no mortal soul should do unless compelled by want. We speak sadly,
tenderly, of the poor girl whose father died and left her unprovided
for, wherefore "she had to work." We have not learned to see that
some kind of work is necessary to all human creatures to use their
powers; not mere tread-mill repetition of small, useless things, but
such range of action as shall exercise all the faculties. And least of
all have we learned to see that a human soul, to be healthy, must
love and care for more than its own blood relations.

What the girl, as a normal human being, wants is full exercise in


large social relation; things to think about, feel, and do, which do
not in any way concern the home. Race-babyhood may be content
at home—it was first made for babies. But as we grow up into our
modern human range of power, no home can or ought to content us.
We need not, therefore, cease to love it, need not neglect or ignore
it. We simply need something more. That is the great lack which
keeps girlhood unsatisfied; the call of the human soul for its full field
of action, the world. We try to meet this lack by a surfeit of supplies
for lower needs.

Since we first began to force upon our girl baby's astonished and
resisting brain the fact that she was a girl; since we curbed her
liberty by clothing and ornament calculated only to emphasise the
fact of sex, and by restrictions of decorum based upon the same
precocious distinction, we have never relaxed the pressure. As if we
feared that there might be some mistake, that she was not really a
girl but would grow up a boy if we looked the other way, we
diligently strove to enforce and increase her femininity by every
possible means. So by the time her womanhood does come it finds
every encouragement, and the humanhood which should
predominate we have restricted and forbidden. Moreover, whatever
of real humanness she does manifest we persist in regarding as
feminine.

For instance, the girl wants friends, social contact. She cannot satisfy
this want in normal lines of work, in the natural contact of the busy
world, so she tries to meet it on the one plane allowed—in what we
call "Society." Her own life being starved, she seeks to touch other
lives as far and fast as possible. Next to doing things one's self is the
association with others who can do them. So the girl reaches out for
friends. Women friends can give her little; their lives are empty as
her own, their talk is of the same worn themes—their point of view
either the kitchen or the parlour. Therefore she finds most good in
men friends; they are human, they are doing something. All this is
set down to mere feminine "desire to attract"; we expect it, and we
provide for it. Our "social" machinery is largely devoted to "bringing
young people together"; not in any common work, in large human
interests, but in such decorated idleness, with music, perfume, and
dance, as shall best minister to the only forces we are willing to
promote.

Is the girl satisfied? Is it really what she wants, all she wants? If she
were a Circassian slave, perhaps it would do. For the daughter of
free, active, intelligent, modern America it does not do; and
therefore our girls in ever-increasing numbers are leaving home. It is
not that they do not love their homes; not that they do not want
homes of their own in due season; it is the protest of every healthy
human soul against the-home-and-nothing-else.

Our poorer girls are going into mills and shops, our richer ones into
arts and professions, or some educational and philanthropic work.
We oppose this proof of racial growth and vitality by various
economic fallacies about "taking the bread out of other women's
mouths"—and in especial claim that it is "competing with men,"
"lowering wages" and the like. We talk also, in the same breath, or
the next one, about "the God-given right to work"—and know not
what we mean by that great phrase.

To work is not only a right, it is a duty. To work to the full capacity of


one's powers is necessary for human development. It is no benefit
to a human being to keep him, or her, in down-wrapped idleness, it
is a gross injury. If a man could afford to put daughters and wife to
bed and have them fed and washed like babies, would that be a
kindness? "They do not have to walk!" he might say. Yes, they do
have to, else would their muscles weaken and shrink, and beauty
and health disappear. For the health and beauty of the body it must
have full exercise. For the health and beauty of the mind it must
have full exercise. No normal human mind can find full exercise in
dusting the parlour and arranging the flowers; no, nor in twelve
hours of nerve-exhaustion in the kitchen. Exhaustion is not exercise.

"But they are free to study—to read, to improve their minds!" we


protest. Minds are not vats to be filled eternally with more and ever
more supplies. It is use, large, free, sufficient use that the mind
requires, not mere information. Our college girls have vast supplies
of knowledge; how can they use it in the home? Could a college boy
apply his education appropriately to "keeping house"—and, if not,
how can the girl? Full use of one's best faculties—this is health and
happiness for both man and woman.

But how about those other people's wages?—will be urged.


Productive labour adds to the wealth of the world, it does not take
away. If wealth were a fixed quantity, shared carefully among a lot
of struggling beggars, then every new beggar would decrease the
other's share.

To work is to give, not to beg. Every worker adds to the world's


wealth, increases everyone's share. Of course there are people
whose "work" is not of value to anyone; who simply use their power
and skill to get other people's money away from them; the less of
these the better. That is not productive labour. But so long as we see
to it that the work we do is worth more than the pay we get, our
consciences may be clean; we give to the world and rob no one. As
to the immediate facts that may be alleged, "overcrowded labour
market," "over-production," and such bugaboos, these are only facts
as watered stock and stolen franchises are facts; not economic laws,
but criminal practices. A temporary superficial error in economic
conduct need not blind us to permanent basic truth, and the truth
which concerns us here is that a human creature must work for the
health and power and pleasure of it; and that all good work enriches
the world.

So the girl need not stay at home and content her soul with
chocolate drops lest some other girl lose bread. She may butter that
bread and share the confections, by her labour, if it be productive.
And by wise working she may learn to see how unwise and how
unnecessary are the very conditions which now hold her back. At
present she is generally held back. Her father will not allow her to
work. Her mother needs her at home. So she stays a while longer. If
she marries, she passes out of this chapter, becoming, without let or
change, "the lady of the house." If she does not marry, what then?
What has father or mother, sister or brother, to offer to the
unmarried woman? What is the home to her who has no "home of
her own"?

The wife and mother has a real base in her home: distorted and
overgrown though it may have become, away in at the centre lies
the everlasting founder—in the little child. Unnecessary as are the
mother's labours now, they were once necessary, they have a base
of underlying truth. But what real place has a grown woman of
twenty-five and upwards in anyone else's home? She is not a child,
and not a mother. The initial reason for being at home is not there.
What business has she in it? The claim of filial devotion is usually
advanced to meet this question. Her parents need her. And here
comes out in glaring colours the distinction between girl and boy,
between man's and woman's labour.

Whatever of filial gratitude, love, and service is owed to the parent is


equally owed by boy and girl. If there is a difference it should be on
the boy's side, as he is more trouble when little and less assistance
in the house when big. Now, what is the accepted duty of the boy to
the parents, when they are old, feeble, sick, or poor? First, to
maintain them, that is, to provide for them the necessaries of life
and as much more as he can compass. Then, to procure for them
service and nursing, if need be. Also himself to bestow affection and
respect, and such part of his time as he can spare from the labour
required to maintain them. This labour he performs like a civilised
man, by the service of other people in some specialised industry;
and his ability to care for his parents is measured by his ability to
perform that larger service.

What is the accepted duty of the girl to the parents in like case? She
is required to stay at home and wait upon them with her own hands,
serve them personally, nurse them personally, give all her time and
strength to them, and this in the old, old uncivilised way, with the
best of intentions, but a degree of ability measured by the lowest of
averages.

It is the duty of the child to care for the infirm parent—that is not
questioned; but how? Why, in one way, by one child, and in so
different a way by another? The duty is precisely the same; why is
the manner of fulfilling it so different? If the sick and aged mother
has a capable son to support her, he provides for her a house,
clothing, food, a nurse, and a servant. If she has but a daughter,
that daughter can only furnish the nurse and servant in her own
person, skilled or unskilled as the case may be; and both of them
are a charge upon the other relatives or the community for the
necessaries of life. Why does not the equally capable daughter do
more to support her parent when it is necessary? She cannot, if she
is herself the nurse and servant. Why does she have to be herself
the nurse and servant? Because she has been always kept at home
and denied the opportunity to take up some trade or profession by
which she could have at once supported herself, her parents, and
done good service in the world. Because "the home is the place for
women," and in the home is neither social service nor self-support.

There is another and a darker side to this position. The claim of


exclusive personal service from the daughter is maintained by
parents who are not poor, not old, not sick, not feeble; by a father
who is quite able to pay for all the service he requires, and who
prefers to maintain his daughter in idleness for his own antiquated
masculine pride—and by a mother who is quite able to provide for
herself, if she choose to; who is no longer occupied by the care of
little children, who does not even do house-service, but who lives in
idleness herself, and then claims the associate idleness of her
daughter, on grounds past finding out. Perhaps it is that an
honourably independent daughter, capable, respected, well-paid,
valuable to the community, would be an insupportable reproach to
the lady of the house. Perhaps it is a more pathetic reason—the
home-bound, half-developed life, released from the immediate cares,
which, however ill-fulfilled, at least gave sanction to her position,
now seeks to satisfy its growing emptiness by the young life's larger
hope and energy. This may be explanation, but is no justification.

The value and beauty of motherhood depend on the imperative


needs of childhood. The filial service of the child depends on the
imperative needs of the parent. When the girl is twenty-one and the
mother is forty-five, neither position holds. The amount of love and
care needed by either party does not require all day for its
expression. The young, strong, well-educated girl should have her
place and work, equally with her brother. Does not the mother love
her son, though he is in business? Could she not manage to love a
daughter in business, too? It is not love, far less is it wisdom, which
so needlessly immolates a young life on the altar of this ancient
custom of home-worship. The loving mother is not immortal. What is
to become of the unmarried daughter after the mother is gone?

What has the home done to fit her for life. She may be rich enough
to continue to live in it, not to "have to work," but is she, at fifty, still
to find contentment in dusting the parlour and arranging the flowers,
in calling and receiving calls, in entertaining and being entertained?
Where is her business, her trade, her art, her profession, her place
in life? The home is not the whole of life. It is a very minor part of it
—a mere place of preparation for living. To keep the girl at home is
to cut her off from life.

More and more is this impossible. The inherited power of the ages is
developing women to such an extent that by the simple force of
expansion they are cracking the confining walls about them, bursting
out in all directions, rising under the enormous pressure that keeps
them down like mushrooms under a stone. The girl has now enough
of athletic training to strengthen her body, balance her nerves, set
her tingling with the healthy impulse to do. She has enough mental
training to give some background and depth to her mind, with the
habit of thinking somewhat. If she is a college girl, she has had the
inestimable privilege of looking at the home from outside, in which
new light and proportion it has a very different aspect.

The effort is still made by proud and loving fathers, unconscious of


their limitations, to keep her there afterward, and by loving mothers
even more effectually. They play upon the strings of conscience,
duty, and affection. They furnish every pleasant temptation of
physical comfort, ease, the slow corruption of unearned goods. To
oppose this needs a wider range of vision and a greater strength of
character than the daughter of a thousand homes can usually
command.

The school has helped her, but she has not had it long. The college
has helped her more, but that is not a general possession as yet,
and has had still shorter influence. Strong, indeed, is the girl who
can decide within herself where duty lies, and follow that decision
against the combined forces which hold her back. She must claim
the right of every individual soul to its own path in life, its own true
line of work and growth. She must claim the duty of every individual
soul to give to its all-providing society some definite service in
return. She must recognise the needs of the world, of her country,
her city, her place and time in human progress, as well as the needs
of her personal relations and her personal home. And, further, using
the parental claim of gratitude and duty in its own teeth, she must
say: "Because I love you I wish to be worthy of you, to be a human
creature you may be proud of as well as a daughter you are fond of.
Because I owe you care and service when you need it, I must fit
myself now to render that care and service efficiently. Moreover, my
duty to you is not all my duty in the world. Life is not merely an
aggregation of families. I must so live as to meet all my duties, and,
in so doing, I shall better love and serve my parents."

Conscience is strong in women. Children are very violently taught


that they owe all to their parents, and the parents are not slow in
foreclosing the mortgage. But the home is not a debtor's prison—to
girls any more than to boys. This enormous claim of parents calls for
examination.

Do they in truth do all for their children; do their children owe all to
them? Is nothing furnished in the way of safety, sanitation,
education, by that larger home, the state? What could these parents
do, alone, in never so pleasant a home, without the allied forces of
society to maintain that home in peace and prosperity. These
lingering vestiges of a patriarchal cult must be left behind. Ancestor-
worship has had victims enough. Girls are human creatures as well
as boys, and both have duties, imperative duties, quite outside the
home.

One more protest is to be heard: "Most girls marry. Surely they


might stay at home contentedly until they leave it for another." Yes,
most girls marry. All girls ought to—unless there is something wrong
with them. And, being married, they should have homes. But, to
have a home and enjoy it, is one thing; to stay in it—the whole time
—is quite another. It is the same old assumption that woman is a
house-animal; that she has no place in the open, no business in the
world. If the girl had a few years of practical experience in the world
she would be far better able to enjoy and appreciate her own home
when she had one. At present, being so much restricted where she
is, she very often plunges from the frying-pan into the fire, simply
from too much home.

"Why should she have married that fellow!" cries the father; "I gave
her a good home—she had everything she wanted." It does not
enter the mind of this man that a woman is something more than a
rabbit. Even rabbits, well-fed rabbits, will gnaw and dig to get out—
they like to run as well as eat. Also, the girl whose character has
time to "set" a little in some legitimate business associations, instead
of being held in everlasting solution at home, will be able to face the
problems of domestic industry and expense with new eyes.

No men, with practical sense and trained minds, would put up for a
week with the inchoate mass of wasted efforts in the home; and,
when women have the same trained minds and practical sense, they
will not put up with it much longer. For the home's sake, as well as
her own sake, the girl will profit by experience in the working world.

Once she learns the pleasure and power of specialisation, the


benefits of organisation, the advantages of combination, the whole
tremendous enginery of civilised life, she can no more drop back into
her ancestral cradle than her brother could turn into an Arcadian
shepherd, piping prettily to his fleecy charge.
XIV

HOME INFLUENCE ON MEN

In our peculiar and artificial opposition of "the Home" and "the


World," we have roughly ascribed all the virtues to the first, and all
the vices to the second. "The world, the flesh, and the devil" we still
associate, forgetting that home is the very temple of the flesh, and
in no way impervious to the devil. Sin is found at home as generally
as elsewhere—must be, unless women are sinless and men absolved
on entering the sacred door.

There are different sins and virtues, truly, as we have seen in the
chapter on Domestic Ethics. There is less fighting at home, as there
is but one man there. There is less stealing, the goods being more in
common, only sometimes a sly rifling of pockets by the unpaid wife.
A man pays his housekeeper, or his housemaids, because he has to;
and he pays, and pays highly, the purely extortionate women of
pleasure; but sometimes he forgets to pay his wife, and sometimes
she steals. The home has patience, chastity, industry, love. But there
is less justice, less honour, less courage, less truth; it does not
embrace all the virtues. Such as it is, strong for good and also very
weak for some good, possibly even showing some tendencies to evil,
what is its influence on men?

The boy baby feels it first; and that we have touched on. The home
teaches the boy that women were made for service, domestic
service, that the principal cares and labours of life are those which
concern the body, and that his own particular tastes and preferences
are of enormous importance. As fast as he gets out of the home and
into the school, he learns quite other things, getting his exaggerated
infant egotism knocked out of him very suddenly, and, as he gets
out of school and into business, also into politics, he learns still
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

More than just a book-buying platform, we strive to be a bridge


connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.

Join us on a journey of knowledge exploration, passion nurturing, and


personal growth every day!

ebookbell.com

You might also like