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

PDF Beginning Oracle Application Express 5 3rd Edition Doug Gault download

The document promotes the ebook 'Beginning Oracle Application Express 5, 3rd Edition' by Doug Gault, available for download on ebookgate.com, along with other related titles. It outlines the contents of the book, which covers various aspects of Oracle Application Express, including development, security, and application deployment. The document also includes copyright information and details about the authors and contributors.

Uploaded by

sullipattspz
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)
11 views

PDF Beginning Oracle Application Express 5 3rd Edition Doug Gault download

The document promotes the ebook 'Beginning Oracle Application Express 5, 3rd Edition' by Doug Gault, available for download on ebookgate.com, along with other related titles. It outlines the contents of the book, which covers various aspects of Oracle Application Express, including development, security, and application deployment. The document also includes copyright information and details about the authors and contributors.

Uploaded by

sullipattspz
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/ 83

Get the full ebook with Bonus Features for a Better Reading Experience on ebookgate.

com

Beginning Oracle Application Express 5 3rd Edition


Doug Gault

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

OR CLICK HERE

DOWLOAD NOW

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


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

Expert Oracle Application Express 2nd Edition Doug Gault

https://ebookgate.com/product/expert-oracle-application-express-2nd-
edition-doug-gault/

ebookgate.com

Beginning Oracle Application Express Rick Greenwald

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

ebookgate.com

Agile Oracle Application Express Patrick Cimolini

https://ebookgate.com/product/agile-oracle-application-express-
patrick-cimolini/

ebookgate.com

Expert Oracle Application Express 1st Edition Dietmar Aust

https://ebookgate.com/product/expert-oracle-application-express-1st-
edition-dietmar-aust/

ebookgate.com
Expert Oracle Application Express 1st Edition John Edward
Scott

https://ebookgate.com/product/expert-oracle-application-express-1st-
edition-john-edward-scott/

ebookgate.com

Beginning Oracle SQL 3rd Edition For Oracle Database 12c


Lex Dehaan

https://ebookgate.com/product/beginning-oracle-sql-3rd-edition-for-
oracle-database-12c-lex-dehaan/

ebookgate.com

Beginning Oracle Programming 1st Edition Sean Dillon

https://ebookgate.com/product/beginning-oracle-programming-1st-
edition-sean-dillon/

ebookgate.com

Oracle Application Server Portal Handbook 1st Edition


Kevin Laahs

https://ebookgate.com/product/oracle-application-server-portal-
handbook-1st-edition-kevin-laahs/

ebookgate.com

Beginning iOS 4 Application Development 1st Edition Wei-


Meng Lee

https://ebookgate.com/product/beginning-ios-4-application-
development-1st-edition-wei-meng-lee/

ebookgate.com
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
orders-ny@springer-sbm.com, 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 rights@apress.com, 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
Another Random Document on
Scribd Without Any Related Topics
languages. And it is not only history and the languages; it is
literature in general from which Émile is excluded by Rousseau. No
book shall be put into his hands, not even the Fables of La Fontaine.
It is well known with what resolution Rousseau criticises The Crow
and the Fox.

318. Education of the Senses.—The grand preoccupation of


Rousseau is the exercise and development of the senses of his pupil.
The whole theory of object lessons, and even all the exaggerations
of what is now called the intuitive method, are contained in germ in
the Émile:—
“The first faculties which are formed and perfected in us are the
senses. These, then, are the first which should be cultivated; but
these are the very ones that we forget or that we neglect the most.”
Rousseau does not consider the senses as wholly formed by
nature; but he makes a special search for the means of forming
them and of perfecting them through education.
“To call into exercise the senses, is, so to speak, to learn to feel;
for we can neither touch, nor see, nor hear, except as we have been
taught.”
Only, Rousseau is wrong in sacrificing everything to this education
of the senses. He sharply criticises this favorite maxim of Locke, “We
must reason with children.” Rousseau retards the education of the
judgment and the reason, and declares that “he would as soon
require that a child be five feet high as that he reason at the age of
eight.”

319. The Third Book of the Émile.—From the twelfth to the fifteenth
year is the length of time that Rousseau has devoted to study and to
intellectual development proper. It is necessary that the robust
animal, “the roe-buck,” as he calls Émile, after a negative and
temporizing education of twelve years, become in three years an
enlightened intelligence. As the period is short, Rousseau disposes of
the time for instruction with a miser’s hand. Moreover, Émile is very
poorly prepared for the rapid studies which are to be imposed on
him. Not having acquired in his earlier years the habit of thinking,
having lived a purely physical existence, he will have great difficulty
in bringing to life, within a few months, his intellectual faculties.
But without dwelling on the unfavorable conditions of Émile’s
intellectual education, let us see in what it will consist.

320. Choice in the Things to be taught.—The principle which guides


Rousseau in the choice of Émile’s studies is no other than the
principle of utility:—
“There is a choice in the things which ought to be taught as well
as in the time fit for learning them. Of the knowledges within our
reach, some are false, others are useless, and still others serve to
nourish the pride of him who has them. Only the small number of
those which really contribute to our good are worthy the care of a
wise man, and consequently of a child whom we wish to render
such. It is not a question of knowing what is, but only what is
useful.”

321. Rousseau and the Abbé de Saint Pierre.—Among educators, some


wish to teach everything, while others demand a choice, and would
retain only what is necessary. The Abbé de Saint Pierre follows the
first tendency. He would have the scholar learn everything at
college; a little medicine towards the seventh or eighth year, and in
the other classes, arithmetic and blazonry, jurisprudence, German,
Italian, dancing, declamation, politics, ethics, astronomy, anatomy,
chemistry, without counting drawing and the violin, and twenty other
things besides. Rousseau is wiser. He is dismayed at such an
accumulation, at such an obstruction of studies, and so yields too
much to the opposite tendency, and restricts beyond measure the
list of necessary studies.

322. Émile’s Studies.—These, in fact, are the studies to which Émile


is limited: first, the physical sciences, and, at the head of the list,
astronomy, then geography, geography taught without maps and by
means of travel:—
“You are looking for globes, spheres, maps. What machines! Why
all these representations? Why not begin by showing him the object
itself?”
Here, as in other places, Rousseau prefers what would be best,
but what is impossible, to that which is worth less, but which alone
is practicable.
But Rousseau does not wish that his pupil, like the pupil of
Rabelais, become an “abyss of knowledge.”
“When I see a man, enamored of knowledge, allow himself to
yield to its charms, and run from one kind to another without
knowing where to stop, I think I see a child on the sea-shore
collecting shells, beginning by loading himself with them; then,
tempted by those he still sees, throwing them aside, picking them
up, until, weighed down by their number, and no longer knowing
which to choose, he ends by rejecting everything, and returns
empty-handed.”
No account is made of grammar and the ancient languages in the
plan of Émile’s studies. Graver still, history is proscribed. This
rejection of historical studies, moreover, is systematically done.
Rousseau has placed Émile in the country, and has made him an
orphan, the better to isolate him; to teach him history would be to
throw him back into society that he abominates.

323. No Books save Robinson Crusoe.—One of the consequences of


an education that is natural and negative is the suppression of
books. Always going to extremes, Rousseau is not content to criticise
the abuse of books. He determines that up to his fifth year Émile
shall not know what a book is:—
“I hate books,” he exclaims; “they teach us merely to speak of
things that we do not know.”
Besides the fact that this raving is rather ridiculous in the case of a
man who is a writer by profession, it is evident that Rousseau is
roving at random when he condemns the use of books in instruction.
One book, however, one single book, has found favor in his sight.
Robinson Crusoe will constitute by itself for a long time the whole of
Émile’s library. We understand without difficulty Rousseau’s kindly
feeling for a work which, under the form of a romance, is, like the
Émile, a treatise on natural education. Émile and Robinson strongly
resemble each other, since they are self-sufficient and dispense with
society.

324. Excellent Precepts on Method.—At least in the general method


which he commends, Rousseau makes amends for the errors in his
plan of study:—
“Do not treat the child to discourses which he cannot understand.
No descriptions, no eloquence, no figures of speech. Be content to
present to him appropriate objects. Let us transform our sensations
into ideas. But let us not jump at once from sensible objects to
intellectual objects. Let us always proceed slowly from one sensible
notion to another. In general, let us never substitute the sign for the
thing, except when it is impossible for us to show the thing.”
“I have no love whatever for explanations and talk. Things! things!
I shall never tire of saying that we ascribe too much importance to
words. With our babbling education we make only babblers.”
But the whole would bear quoting. Almost all of Rousseau’s
recommendations, in the way of method, contain an element of
truth, and need only to be modified in order to become excellent.

325. Exclusive Motives of Action.—A great question in the education


of children is to know to what motive we shall address ourselves.
Here again, Rousseau is exclusive and absolute. Up to the age of
twelve, Émile will have been guided by necessity; he will have been
made dependent on things, not on men. It is through the possible
and the impossible that he will have been conducted, by treating
him, not as a sensible and intelligent being, but as a force of nature
against which other forces are made to act. Not till the age of twelve
must this system be changed. Émile has now acquired some
judgment; and it is upon an intellectual motive that one ought now
to count in regulating his conduct. This motive is utility. The feeling
of emulation cannot be employed in a solitary education. Finally, at
the age of fifteen, it will be possible to appeal to the heart, to
feeling, and to recommend to the young man the acts we set before
him, no longer as necessary or useful, but as noble, good, and
generous. The error of Rousseau is in cutting up the life of man to
his twentieth year into three sharply defined parts, into three
moments, each subordinated to a single governing principle. The
truth is that at every age an appeal must be made to all the motives
that act on our will, that at every age, necessity, interest, sentiment,
and finally, the idea of duty, an idea too often overlooked by
Rousseau, as all else that is derived from reason,—all these motives
can effectively intervene, in different degrees, in the education of
man.

326. Émile learns a Trade.—At the age of fifteen, Émile will know
nothing of history, nothing of humanity, nothing of art and literature,
nothing of God; but he will know a trade, a manual trade. By this
means, he will be sheltered from need in advance, in case a
revolution should strip him of his fortune.
“We are approaching,” says Rousseau, with an astonishing
perspicacity, “a century of revolutions. Who can give you assurance
of what will then become of you? I hold it to be impossible for the
great monarchies of Europe to last much longer. They have all had
their day of glory, and every State that dazzles is in its decline.”
We have previously noticed, in studying analogous ideas in the
case of Locke, for what other reasons Rousseau made of Émile an
apprentice to a cabinet-maker or a carpenter.

327. Émile at the Age of Fifteen.—Rousseau takes comfort in the


contemplation of his work, and he pauses from time to time in his
analyses and deductions, to trace the portrait of his pupil. This is
how he represents him at the age of fifteen:—
“Émile has but little knowledge, but that which he has is really his
own; he knows nothing by halves. In the small number of things
that he knows, and knows well, the most important is that there are
many things which he does not know, but which he can some day
learn; that there are many more things which other men know, but
which he will never know; and that there is an infinity of other things
which no man will ever know. He has a universal mind, not through
actual knowledge, but through the ability to acquire it. He has a
mind that is open, intelligent, prepared for everything, and, as
Montaigne says, if not instructed, at least capable of being
instructed. It is sufficient for me that he knows how to find the of
what good is it? with reference to all that he does, and the why? of
all that he believes. Once more, my object is not at all to give him
knowledge, but to teach him how to acquire it as he may need it, to
make him estimate it at its exact worth, and to make him love truth
above everything else. With this method, progress is slow; but there
are no false steps, and no danger of being obliged to retrace one’s
course.”
All this is well; but it is necessary to add that even Émile has
faults, great faults. To mention but one of them, but one which
dominates all the others, he sees things only from the point of view
of utility, and he would not hesitate, for example, “to give the
Academy of Sciences for the smallest bit of pastry.”

328. Education of the Sensibilities.—It is true that Rousseau finally


decides to make of Émile an affectionate and reasonable being. “We
have formed,” he says, “his body, his senses, his judgment; it
remains to give him a heart.” Rousseau, who proceeds like a
magician, by wave of wand and clever tricks, flatters himself that
within a day’s time Émile is going to become the most affectionate,
the most moral, and the most religious of men.

É
329. The Fourth Book of the Émile.—The development of the
affectionate sentiments, the culture of the moral sentiment, and that
of the religious sentiment, such is the triple subject of the fourth
book,—vast and exalted questions that lend themselves to eloquence
in such a way that the fourth book of the Émile is perhaps the most
brilliant of the whole work.

330. Genesis of the Affectionate Sentiments.—Here Rousseau is


wholly in the land of chimeras. Émile, who lives in isolation, who has
neither family, friends, nor companions, is necessarily condemned to
selfishness, and everything Rousseau can do to warm his heart will
be useless. Do we wish to develop the feelings of tenderness and
affection? Let us begin by placing the child under family or social
influences which alone can furnish his affections the occasion for
development. For fifteen years Rousseau leaves the heart of Émile
unoccupied. What an illusion to think he will be able to fill it all at
once! When we suppress the mother in the education of a child, all
the means that we can invent to excite in his soul emotions of
gentleness and affection are but palliatives. Rousseau made the
mistake of thinking that a child can be taught to love as he is taught
to read and write, and that lessons could be given to Émile in feeling
just as lessons are given to him in geometry.

331. Moral Education.—Rousseau is more worthy of being followed


when he demands that the moral notions of right and wrong have
their first source in the feelings of sympathy and social benevolence,
on the supposition that according to his system he can inspire Émile
with such feelings.
“We enter, finally, the domain of morals,” he says. “If this were the
place for it, I would show how from the first emotions of the heart
arise the first utterances of the conscience, and how, from the first
feelings of love and hate arise the first notions of good and evil. I
would make it appear that justice and goodness are not merely
abstract terms, conceived by the understanding, but real affections
of the soul enlightened by the reason.”
Yes; let the child be made to make his way gradually towards a
severe morality, sanctioned by the reason, in having him pass
through the gentle emotions of the heart. Nothing can be better. But
this is to be done on one condition: this is, that we shall not stop on
the way, and that the vague inspirations of the sensibilities shall be
succeeded by the exact prescriptions of the reason. Now Rousseau,
as we know, was never willing to admit that virtue was anything else
than an affair of the heart. His ethics is wholly an ethics of
sentiment.

332. Religious Education.—We know the reasons which determined


Rousseau to delay till the sixteenth or eighteenth year the revelation
of religion. It is that the child, with his sensitive imagination, is
necessarily an idolater. If we speak to him of God, he can form but a
superstitious idea of him. “Now,” says Rousseau, pithily, “when the
imagination has once seen God, it is very rare that the
understanding conceives him.” In other terms, once plunged in
superstition, the mind of the child can never extricate itself from it.
We must then wait, in the interest of religion itself, till the child have
sufficient maturity of reason and sufficient power of thought to seize
in its truth, divested of every veil of sense, the idea of God, whose
existence is announced to him for the first time.
It is difficult to justify Rousseau. First, is it not to be feared that
the child, if he has reached his eighteenth year in ignorance of God,
may find it wholly natural to be ignorant of him still, and that he
reason and dispute at random with his teacher, and that he doubt
instead of believe? And if he allows himself to be convinced, is it not
at least evident that the religious idea, tardily inculcated, will have
no profound hold on his mind? On the other hand, will the child,
with his instinctive curiosity, wait till his eighteenth year to inquire
the cause of the universe? Will he not form the notion of a God in
his own way?
“One might have read, a few years ago,” says Villemain, “the
account, or rather the psychological confession, of a writer
(Sentenis), a German philosopher, whom his father had submitted to
É
the experiment advised by the author of Émile. Left alone by the loss
of a tenderly loved wife, this father, a learned and thoughtful man,
had taken his infant son to a retired place in the country; and not
allowing him communication with any one, he had cultivated the
child’s intelligence through the sight of the natural objects placed
near him, and by the study of the languages, almost without books,
and in carefully concealing from him all idea of God. The child had
reached his tenth year without having either read or heard that
great name. But then his mind found what had been denied it. The
sun which he saw rise each morning seemed the all-powerful
benefactor of whom he felt the need. He soon formed the habit of
going at dawn to the garden to pay homage to that god that he had
made for himself. His father surprised him one day, and showed him
his error by teaching him that all the fixed stars are so many suns
distributed in space. But such was then the disappointment and the
grief of the child deprived of his worship, that the father, overcome,
acknowledged to him that there was a God, the Creator of the
heavens and the earth.”[175]

333. The Savoyard Vicar’s Profession of Faith.—Rousseau has at


least attempted to retrieve, by stately language and an impassioned
demonstration of the existence of God, the delay which he has
spontaneously imposed on his pupil.
The Savoyard Vicar’s Profession of Faith is an eloquent catechism
on natural religion, and the honest expression of a sincere and
profound deism. The religion of nature is evidently the only one
which, in Rousseau’s system, can be taught, and ought to be taught,
to the child, since the child is exactly the pupil of nature. If Émile
wishes to go beyond this, if he needs a positive religion, this shall be
for himself to choose.

334. Sophie and the Education of Women.—The weakest part of the


Émile is that which treats of the education of woman. This is not
merely because Rousseau, with his decided leaning towards the
romantic, leads Émile and his companion into odd and extraordinary
adventures, but it is especially because he misconceives the proper
dignity of woman. Sophie, the perfect woman, has been educated
only to complete the happiness of Émile. Her education is wholly
relative to her destiny as a wife.
“The whole education of women should be relative to men; to
please them, to be useful to them, to make themselves honored and
loved by them, to educate the young, to care for the older, to advise
them, to console them, to make life agreeable and sweet to them,—
these are the duties of women in every age.”
“Sophie,” says Gréard, “has but virtues of the second order, virtues
of conjugal education.” It has been said that marriage is a second
birth for man, that he rises or falls according to the choice which he
makes. For woman, according to the theory of Rousseau, it is the
true advent into life. According to the expressive formula of Michelet,
who, in a sentence, has given a marvellous summary of the doctrine,
but in attaching to it a sense which poetizes it, “the husband creates
the wife.” Sophie, up to the day of her marriage, did not exist. She
had learned nothing and read nothing “except a Barême and a
Télémaque which have chanced to fall into her hands.” She has been
definitely admonished, “that were men sensible, every lettered girl
will remain a girl.” It is Émile alone who is to instruct her, and he will
instruct her and mould her into his own ideal, and in conformity to
his individual interest.
While it was only in his youth that he received the first principles
of the religious feeling, Sophie must be penetrated with it from
infancy, in order that she may early form the habit of submission. He
commands and she obeys, the first duty of the wife being meekness.
If, during her youth, she has freely attended banquets, amusements,
balls, the theatre, it is not so much to be initiated into the vain
pleasures of the world, under the tutelage of a vigilant mother, as to
belong, once married, more fully to her home and to her husband.
She is nothing except as she is by his side, or as dependent on him,
or as acting through him. Strange and brutal paradox, which
Rousseau, it is true, corrects and repairs in detail, at every moment
by the most happy and charming inconsistencies.
Sophie, briefly, is an incomplete person whom Rousseau is not
careful enough to educate for herself.
In her subordinate and inferior position, the cares of the
household occupy the largest place. She cuts and makes her own
dresses:—
“What Sophie knows best, and what was taught her with most
care, is the work of her sex. There is no needle-work which she does
not know how to make.”
It is not forbidden her, but is even recommended that she
introduce a certain coquetry into her employments:—
“The work she loves the best is lace-making, because there is no
other that gives her a more agreeable attitude, and in which the
fingers are used with more grace and deftness.”
She carries daintiness a little too far:—
“She does not love cooking; its details have some disgust for her.
She would sooner let the whole dinner go into the fire than to soil
her cuffs.”
Truly this is fine housewifery! We feel that we have here to do
with a character in a romance who has no need to dine. Sophie
would not have been well received at Saint Cyr, where Madame de
Maintenon so severely scolded the girls who were too fastidious,
“fearing smoke, dust, and disagreeable odors, even to making
complaints and grimaces on their account as though all were lost.”

335. General Conclusion.—In order to form a just estimate of the


Émile, it is necessary to put aside the impressions left by the reading
of the last pages. We must consider as a whole, and without taking
details into account, that work, which, notwithstanding all, is very
admirable and profound. It is injured by analysis. To esteem the
Émile at its real worth, it must be read entire. In reading it, in fact,
we are warmed by contact with the passion which Rousseau puts
into whatever he writes. We pardon his errors and chimeras by
reason of the grand sentiments and the grand truths which we meet
at every step. We must also take into account the time when
Rousseau lived, and the conditions under which he wrote. We have
not a doubt that had it been written thirty years later, in the dawn of
the Revolution, for a people who were free, or who desired to be
free, the Émile would have been wholly different from what it is. Had
he been working for a republican society, or for a society that wished
to become such, Rousseau would not have thrown himself, out of
hatred for the reality, into the absurdities of an over-specialized and
exceptional education. We can judge of what he would have done as
legislator of public instruction in the time of the Revolution, by what
he wrote in his Considerations on the Government of Poland:—
“National education belongs only to people who are free.... It is
education which is to give to men the national mould, and so to
direct their opinions and their tastes that they will become patriots
by inclination, by passion, and by necessity” (we would only add, by
duty). “A child, in opening his eyes, ought to see his country and
nothing but his country. Every true republican, along with his
mother’s milk, will imbibe love of country, that is, of law and liberty.
This love constitutes his whole existence. He sees but his country, he
lives but for her. So soon as he is alone, he is nothing; so soon as
there is no more of country, he is no more.... While learning to read,
I would have a child of Poland read what relates to his country; at
the age of ten, I would have him know all its productions; at twelve,
all its provinces, all its roads, all its cities; at fifteen, the whole of its
history; and at sixteen, all its laws; and there should not be in all
Poland a notable deed or an illustrious man, of which his memory
and his heart were not full.”

336. Influence of the Émile.—That which proves better than any


commentary can the high standing of the Émile, is the success which
it has obtained, the influence which it has exerted, both in France
and abroad, and the durable renown attested by so many works
designed, either to contradict it, to correct it, or to approve it and to
disseminate its doctrines. During the twenty-five years that followed
the publication of the Émile, there appeared in the French language
twice as many books on education as during the first sixty years of
the century. Rousseau, besides all that he said personally which was
just and new, had the merit of stimulating minds and of preparing
through his impulsion the rich educational harvest of this last one
hundred years.
To be convinced of this, it suffices to read this judgment of Kant:—
“The first impression which a reader who does not read for vanity
or for killing time derives from the writings of Rousseau, is that this
writer unites to an admirable penetration of genius a noble
inspiration and a soul full of sensibility, such as has never been met
with in any other writer, in any other time, or in any other country.
The impression which immediately follows this, is that of
astonishment caused by the extraordinary and paradoxical thoughts
which he develops.... I ought to read and re-read Rousseau, till the
beauty of his style no more affects me. It is only then that I can
adjust my reason to judge of him.”

[337. Analytical Summary.—1. The study of the Émile exhibits,


in a very striking manner, the contrast between the respective
agencies of art and nature in the work of education, and also
the power of sentiment as a motor to ideas.
2. What Monsieur Compayré has happily called Rousseau’s
“misuse of the principle of nature” marks a recoil against the
artificial and fictitious state of society and opinion in France in
the eighteenth century. In politics, in religion, and in
philosophy, there was the domination of authority, and but a
small margin was left for the exercise of freedom, versatility,
and individual initiative; while education was administered
rather as a process of manufacture, than of regulated growth.
3. The conception that the child, by his very constitution, is
predetermined, like plants and animals, to a progressive
development quite independent of artificial aid, easily
degenerates into the hypothesis that the typical education is a
process of spontaneous growth.
4. The error in this hypothesis is that of exaggeration or of
disproportion. Education is neither a work of nature alone, nor
of art alone, but is a natural process, supplemented, controlled,
and perfected by human art. What education would become
when abandoned wholly to “nature” may be seen in the state
of a perfected fruit which has been allowed to revert to its
primitive or natural condition.
5. Man is distinguished from all other creatures by the fact
that he is not the victim of his environment, but is endowed
with the power to control his environment, almost to re-create
it, and so to rise superior to it. This ability gives rise to human
art, which is a coördinate factor with nature in the work of
education.
6. This convenient fiction of “Nature,” conceived as an
infallible and incomparable guide in education, has introduced
countless errors into educational theory; and Miss E. R. Sill is
amply justified in saying that “probably nine-tenths of the
popular sophistries on the subject of education, would be
cleared away by clarifying the word Nature.”[176]
7. In spite of its paradoxes, its exaggerations, its
overwrought sentiment, and florid declamation, the Émile, in
its general spirit, is a work of incomparable power and of
perennial value.]
F O OT N OT E S :
[169] Dom Joseph Cajet, Les Plagiats de J. J. R. de Genève sur
l’éducation, 1768.
[170] Œuvres diverses, Tome I. p. 12.
[171] De l’éducation des enfants, La Haye, 1722; Pensées libres
sur les instructions publiques des bas collèges, Amsterdam, 1727.
[172] Spectacle de la nature, Paris, 1732, Vol. VI. Entretien sur
l’éducation.
[173] Lettre critique sur l’éducation, Paris, 1751.
[174] Projet pour l’éducation de M. de Ste-Marie.
[175] Report of Villemain on the work of the Père Girard (1844).
[176] Atlantic Monthly, February, 1883, p. 178.
C H A P T E R X I V.

T H E P H I L O S O P H E R S O F T H E E I G H T E E N T H C E N T U R Y.—
C O N D I L L A C , D I D E R O T, H E L V E T I U S , A N D K A N T.

THE PHILOSOPHERS OF THE EIGHTEENTH CENTURY; CONDILLAC (1715-1780); ABUSE OF THE


PHILOSOPHIC SPIRIT; MUST WE REASON WITH CHILDREN? PRELIMINARY LESSONS; THE ART OF
THINKING; OTHER PARTS OF THE COURSE OF STUDY; PERSONAL REFLECTION; EXCESSES OF
DEVOTION CRITICISED; DIDEROT (1713-1784); HIS PEDAGOGICAL WORKS; HIS QUALITIES AS AN
EDUCATOR; NECESSITY OF INSTRUCTION; IDEA OF A SYSTEM OF PUBLIC INSTRUCTION; CRITICISM
OF FRENCH COLLEGES; PROPOSED REFORMS; PREFERENCE FOR THE SCIENCES; INCOMPLETE VIEWS
ON THE PROVINCE OF LETTERS; OPINION OF MARMONTEL; OTHER NOVELTIES OF DIDEROT’S PLAN;
HELVETIUS (1715-1771); PARADOXES OF THE TREATISE ON MAN; REFUTATION OF HELVETIUS BY
DIDEROT; INSTRUCTION SECULARIZED; THE ENCYCLOPÆDISTS; KANT (1724-1804); HIGH
CONCEPTION OF EDUCATION; PSYCHOLOGICAL OPTIMISM; RESPECT FOR THE LIBERTY OF THE
CHILD; CULTURE OF THE FACULTIES; STORIES INTERDICTED; DIFFERENT KINDS OF PUNISHMENT;
RELIGIOUS EDUCATION; ANALYTICAL SUMMARY.

338. The Philosophers of the Eighteenth Century.—If there has been


considerable progress made in education in the eighteenth century,
it is due, in great part, to the efforts of the philosophers of that age.
It is no longer alone the men who are actually engaged in the
schools that are preoccupied with education; but nearly all the
illustrious thinkers of the eighteenth century have discussed these
great questions with more or less thoroughness. The subject is far
from being exhausted by the study of Rousseau. Besides the
educational current set in movement by the Émile, the other
philosophers of that period, in their isolated and independent march,
left original routes which it remains to follow. From out their errors
and conceptions of systems there emerge some new outlooks and
some definite truths.

339. Condillac (1715-1780).—An acute and ingenious psychologist,


a competitor and rival of Locke in philosophy, Condillac is far from
having the same authority in matters pertaining to education; but
still there is profit to be derived from the reading of his Course of
Study, which includes not less than thirteen volumes. This important
work is a collection of the lessons which he had composed for the
education of the infant Ferdinand, the grandson of Louis XV., and
heir of the dukedom of Parma, whose preceptor he became in 1757.

340. Abuse of the Philosophic Spirit.—It is certainly a matter of


congratulation that the philosophical spirit is entering more and
more largely into the theories of education, and there would be only
words of commendation for Condillac had he restricted himself to
this excellent declaration, that pedagogy is nothing if it is not a
deduction from psychology. But he does not stop there, but with an
indiscretion that is to be regretted, he arbitrarily transports into
education certain philosophical principles which it is not proper to
apply to the art of educating men, whatever may be their theoretical
truth; thus Condillac, having established the natural order of the
development of the sciences and the arts in the history of humanity,
presumes to impose the same law of progress upon the child.
“The method which I have followed does not resemble the usual
manner of teaching; but it is the very way in which men were led to
create the arts and the sciences.”[177]
In other terms, the child must do over again, on his own account,
“that which the race has done.” He must be compelled to follow,
step by step, in its long gropings, the slow progress made by the
race.[178]
There is, doubtless, an element of truth in the error of Condillac.
The sciences and the arts began with the observation of particulars,
and thence slowly rose to general principles; and to-day no one
thinks of denying the necessity of proceeding in the same manner in
education, so far as this is possible. It is well at the first to present
facts to the child, and to lead him step by step, from observation to
observation, to the law which governs them and includes them; but
there is a wide distance between the discreet use of the inductive
and experimental method, and the exaggerations of Condillac. No
one should seriously think of absolutely suppressing the synthetic
method of exposition, which, taking advantage of the work
accomplished through the centuries, teaches at the outset the truths
that have been already acquired. It would be absurd to compel the
child painfully to recommence the toil of the race.[179]
Graver still, Condillac, led astray by his love for philosophizing,
presumes to initiate the child, from the very beginning of his studies,
into psychological analysis.
“The first thing to be done is to make the child acquainted with
the faculties of his soul, and to make him feel the need of making
use of them.”
In other terms, the analysis of the soul shall be the first object
proposed to the reflection of the child. It is not proposed to make
him attentive, but to teach him what attention is.
How can one seriously think of making of the child a little
psychologist, and of choosing as the first element of his education
the very science that is the most difficult of all, the one which can be
but the coronation of his studies?

341. Must we reason with Children?—Rousseau had sharply


criticised the famous maxim of Locke: “We must reason with
children.” Condillac tries to restore it to credit, and for this purpose
he invokes the pretended demonstrations of a superficial and inexact
psychology.
“It has been proved,” he says, “that the faculty of reasoning
begins as soon as the senses commence to develop; and we have
the early use of our senses only because we early began to reason.”
Strange assertions, which are disproved by the most elementary
observation of the facts in the case. Condillac here allows himself to
be imposed upon by his sensational psychology, the tendency of
which is to efface the peculiar character of the different intellectual
faculties, to derive them all from the senses, and, consequently, to
suppress the distance which separates a simple sensation from the
subtile, reflective, and abstract process which is called reasoning. It
cannot be admitted for a single instant that the faculties of the
understanding are, as he says, “the same in the child as in the
mature man.” There is, doubtless, in the child a beginning of
reasoning, a sort of instinctive logic; but this infantile reasoning can
be applied only to familiar objects, such as are sensible and
concrete. It were absurd to employ it on general and abstract ideas.

342. Preliminary Lessons.—We shall quote, without comment, the


first subjects of instruction which, under the title of Leçons
préliminaires, Condillac proposes to his pupil: 1. the nature of ideas;
2. the operations of the soul; 3. the habits; 4. the difference
between the soul and the body; 5. the knowledge of God.
How are we to conceive that Condillac had the pretension to place
these high philosophical speculations within the reach of a child of
seven years who has not yet studied the grammar of his native
language! How much better some fables or historical narratives
would answer his purpose!
But Condillac does not stop there. When his pupil has a systematic
knowledge of the operations of the soul, when he has
comprehended the genesis of ideas; in a word, when, towards the
age of eight or ten, he is as proficient in philosophy as his master,
and almost as capable of writing the Treatise on Sensations, what do
you think he is invited to study? Something which very much
resembles the philosophy of history:—
“After having made him reflect on his own infancy, I thought that
the infancy of the world would be the most interesting subject for
him, and the easiest to study.”
343. The Art of Thinking.—It is only when he judges that the mind
of his pupil is sufficiently prepared by psychological analysis and by
general reflections on the progress of humanity, that Condillac
decides to have him enter upon the ordinary course of study. Here
the spirit of system disappears, and gives place to more judicious
and more practical ideas. Thus Condillac thinks that “the study of
grammar would be more wearisome than useful if it come too early.”
Would that he had applied this principle to psychology! Before
studying grammar, then, Condillac’s pupil reads the poets,—the
French poets, of course,—and preferably the dramatic authors,
Racine especially, whom he reads for the twelfth time. The real
knowledge of the language precedes the abstract study of the rules.
Condillac himself composed a grammar entitled the Art of Speaking.
In this he imitates the authors of Port Royal, “who,” he says, “were
the first to write elementary books on an intelligent plan.” After the
Art of Speaking he calls the attention of his pupil to three other
treatises in succession,—the Art of Writing, or rhetoric, the Art of
Reasoning, or logic, and the Art of Thinking. We shall not attempt an
analysis of these works, which have gone out of date,
notwithstanding the value of certain portions of them. The general
characteristic of these treatises on intellectual education is that the
author is pre-occupied with the relations of ideas more than with the
exterior elegancies of style, with the development of thought more
than with the beauties of language:—
“Especially must the intelligence be nourished, even as the body is
nourished. We must present to it knowledge, which is the
wholesome aliment of spirit, opinions and errors being aliment that
is poisonous. It is also necessary that the intelligence be active, for
the thought remains imbecile as long as, passive rather than active,
it moves at random.”

344. Other Parts of the Course of Study.—It seems that Condillac is


in pursuit of but one single purpose,—to make of his pupil a thinking
being. The study of Latin is postponed till the time when the
intelligence, being completely formed, will find in the study of that
language only the difficulty of learning words. Condillac has but little
taste for the study of the ancient languages. He relegates the study
of Latin to the second place, and omits Greek entirely. But he
accords a great importance to historical studies.
“After having learned to think, the Prince made the study of
history his principal object for six years.”
Twelve volumes of the Course of Study have transmitted to us
Condillac’s lessons in history. In this he does not take delight, as
Rollin does, in long narrations; but he analyzes, multiplies his
reflections, and abridges facts; he philosophizes more than he
recites the facts of history.

345. Personal Reflection.—What we have said of Condillac’s Course


of Study suffices to justify the judgment expressed of his pedagogy
by one of his disciples, Gérando, when he wrote: “He who had so
thoroughly studied the manner in which ideas are formed in the
human mind, had but little skill in calling them into being in the
intelligence of his pupil.”
But we would judge our author unjustly if, after the criticisms we
have made of him, we were not to accord him the praise he
deserves, especially for having comprehended, as he has done, the
value of personal reflection, and the superiority of judgment over
memory. A few quotations will rehabilitate the pedagogy of Condillac
in the minds of our readers.
Above all else there must be an exercise in personal reflection:—
“I grant that the education which cultivates only the memory may
make prodigies, and that it has done so; but these prodigies last
only during the time of infancy.... He who knows only by heart,
knows nothing.... He who has not learned to reflect has not been
instructed, or, what is still worse, has been poorly instructed.”
“True knowledge is in the reflection, which has acquired it, much
more than in the memory, which holds it in keeping; and the things
which we are capable of recovering are better known than those of
which we have a recollection. It does not suffice, then, to give a
child knowledge. It is necessary that he instruct himself by seeking
knowledge on his own account, and the essential point is to guide
him properly. If he is led in an orderly way, he will acquire exact
ideas, and will seize their succession and relation. Then, able to call
them up for review, he will be able to compare them with others
that are more remote, and to make a final choice of those which he
wishes to study. Reflection can always recover the things it has
known, because it knows how it originally found them; but the
memory does not so recover the things it has learned, because it
does not know how it learns.”
This is why Condillac places far above the education we receive,
the education that we give ourselves:—
“Henceforth, Sir, it remains for you alone to instruct yourself.
Perhaps you imagine you have finished; but it is I who have finished.
You are to begin anew!”

346. Excessive Devotion Criticised.—What beautiful lessons Condillac


also addresses to his pupil to induce him to enfranchise himself from
ecclesiastical tutelage! Written by an abbot, the eloquent page we
are about to read proves how the lay spirit tended to pronounce
itself in the eighteenth century.
“You cannot be too pious, Sir; but if your piety is not enlightened,
you will so far forget your duties as to be engrossed in the little
things of devotion. Because prayer is necessary, you will think you
ought always to be praying, not considering that true devotion
consists first of all in fulfilling the duties of your station in life: it will
not be your fault that you do not live in your heart as in a cloister.
Hypocrites will swarm around you, the monks will issue from their
cells. The priests will abandon the service of the altar in order to be
edified with the sight of your holy works. Blind prince! you will not
perceive how their conduct is in contradiction with their language.
You will not even observe that the men who praise you for always
being at the foot of the altar, themselves forget that it is their own
duty to be there. You will unconsciously take their place and leave to
them your own. You will be continually at prayer, and you will believe
that you assure your salvation. They will cease to pray, and you will
believe that they assure their salvation. Strange contradiction, which
turns aside ministers from the Church to give bad ministers to the
State.”[180]

347. Diderot (1713-1784).—To him who knows nothing of Diderot


save his works of imagination, often so licentious, it will doubtless be
a surprise to see the name of this fantastic writer inscribed in the
catalogue of educators. But this astonishment will disappear if we
will take the trouble to recollect with what versatility this mighty
spirit could vary the subject of his reflections, and pass from the gay
to the solemn, and especially with what ardor, in conjunction with
D’Alembert, he was the principal founder of the Encyclopédie, and
the indefatigable contributor to it.

348. His Pedagogical Works.—But there is no room for doubt.


Diderot has written at least two treatises that belong to the history
of education: first, about 1773, The Systematic Refutation of the
Book of Helvetius on Man, an incisive and eloquent criticism of the
paradoxes and errors of Helvetius; and, in the second place, about
1776, a complete scheme of education, composed at the request of
Catherine II., under the title, Plan of a University.[181]

349. His Merits as an Educator.—Doubtless Diderot did not have


sufficient gravity of character or sufficiently definite ideas to be a
perfect educator; but, by way of compensation, the natural and
acquired qualities of his mind made him worthy of the confidence
placed in him by Catherine II. in entrusting him with the
organization, at least in theory, of the instruction of the Russian
people. First of all, he had the merit of being a universal thinker,
“sufficiently versed in all the sciences to know their value, and not
sufficiently profound in any one to give it a preference inspired by
predilection.” Engaged in the scientific movement, of which the
Encyclopédie was the centre, he at the same time cherished an
enthusiastic passion for letters. He worshipped Shakespeare and
modern poetry, but he was not less enamored of classical antiquity,
and for several years, he says, “he thought it as much a religious
duty to read a song of Homer as a good priest would to recite his
breviary.”

350. Necessity of Instruction.—Diderot, and this is to his praise, is


distinguished from the most of his contemporaries, and especially
from Rousseau, by his ardent faith in the moral efficacy of
instruction:—
“Far from corrupting,” he exclaims, “instruction sweetens
character, throws light on duty, makes vice less gross, and either
chokes it or conceals it.... I dare assert that purity of morals has
followed the progress of dress, from the skin of animals to fabrics of
silk.”
Hence he decides on the necessity of instruction for all:—
“From the prime minister to the lowest peasant, it is good for
every one to know how to read, write, and count.”
And he proposes to all people the example of Germany, with her
strongly organized system of primary instruction. He demands
schools open to all children, “schools of reading, writing, arithmetic,
and religion,” in which will be studied both a moral and a political
catechism. Attendance on these schools shall be obligatory, and to
make compulsion possible, Diderot demands gratuity. He goes even
farther, and would have the child fed at school, and with his books
would have him find bread.

351. The Conception of Public Instruction.—Like all who sincerely


desire a strong organization of instruction, Diderot assigns the
direction of it to the State. His ideal of a Russian university bears a
strong resemblance to the French University of 1808. He would have
at its head a politician, a statesman, to whom should be submitted
all the affairs of public instruction. He even went so far as to entrust
to this general master of the university the duty of presiding over the
examinations, of appointing the presidents of colleges, of excluding
bad pupils, and of deposing professors and tutors.

352. Criticism of French Colleges.—Secondary instruction, what was


then called the Faculty of Arts, is the principal object of Diderot’s
reflections. He criticises the traditional system with extreme severity,
and his charge, thought sometimes unjust, deserves to be quoted:—
“It is in the Faculty of Arts that there are still taught to-day, under
the name of belles-lettres, two dead languages which are of use only
to a small number of citizens; it is there that they are studied for six
or seven years without being learned; under the name of rhetoric,
the art of speaking is taught before the art of thinking, and that of
speaking elegantly before having ideas; under the name of logic, the
head is filled with the subtilties of Aristotle, and of his very sublime
and very useless theory of the syllogism, and there is spread over a
hundred obscure pages what might have been clearly stated in four;
under the name of ethics, I do not know what is said, but I know
that there is not a word said either of the qualities of mind or heart;
under the name of metaphysics, there are discussed theses as
trifling as they are knotty, the first elements of scepticism and
bigotry, and the germ of the unfortunate gift of replying to
everything; under the name of physics, there is endless dispute
about the elements of matter and the system of the world; but not a
word on natural history, not a word on real chemistry, very little on
the movement and fall of bodies; very few experiments, less still of
anatomy, and nothing of geography.”[182]

353. Proposed Reforms.—After such a spirited criticism, it was


Diderot’s duty to propose earnest and radical reforms; but all of
those which he suggests are not equally commendable.
Let us first note the idea revived in our day by Auguste Comte and
the school of positivists, of a connection and a subordination of the
sciences, classified in a certain order, according as they presuppose
the science which has preceded, or as they facilitate the study of the
science which follows, and also according to the measure of their
utility.[183] It is according to this last principle in particular, that
Diderot distributes the work of the school, after having called
attention to the fact that the order of the sciences, as determined by
the needs of the school, is not their logical order:—
“The natural connection of one science with the others designates
for it a place, and the principle of utility, more or less general,
determines for it another place.”
But Diderot forgets that we must take into account, not alone the
principle of utility in the distribution of studies, but that the essential
thing of all others is to adapt the order of studies to the progress of
the child in age and aptitudes.

354. Preferences for the Sciences.—Although equally enamored of


letters and the sciences, Diderot did not know how to hold a just
balance between a literary and a scientific education. Anticipating
Condorcet and Auguste Comte, he displaces the centre of
instruction, and gives a preponderance to the sciences. Of the eight
classes comprised in his Faculty of Arts, the first five are devoted to
the mathematics, to mechanics, to astronomy, to physics, and to
chemistry. Grammar and the ancient languages are relegated to the
last three years, which nearly correspond to what are called in our
colleges the “second” and “rhetoric.”[184]
The charge that must be brought against Diderot in this place, is
not merely that he puts an unreasonable restriction on literary
studies, but also that he makes a bad distribution of scientific studies
in placing the mathematics before physics. It is useless for him to
assert that “it is easier to learn geometry than to learn to read.” He
does not convince us of this. It is a grave error to begin by keeping
the child’s attention on numerical abstractions, by leaving his senses
unemployed, by postponing so long the study of natural history and
experimental physics, those sciences expressly adapted to children,
because, as Diderot himself expresses it, “they involve a continuous
exercise of sight, smell, taste, and memory.”
To excuse Diderot’s error, it does not suffice to state that his pupil
does not enter the Faculty of Arts till his twelfth year. Till that period,
he will learn only reading, writing, and orthography. There is ground
for thinking that these first years will be rather poorly employed; but
besides this, it is evident that even at the age of twelve the mind is
not sufficiently mature to be plunged into the cold deductions of
mathematics.

355. Incomplete Views as to the Scope of Literary Studies.—Diderot’s


attitude with respect to classical studies is a matter of surprise. On
the one hand, he postpones their study till the pupil’s nineteenth and
twentieth year. On the other, with what enthusiasm this eloquent
scholar speaks of the ancients, particularly of Homer!
“Homer is the master to whom I am indebted for whatever merit I
have, if indeed I have any at all. It is difficult to attain to excellence
in taste without a knowledge of the Greek and Latin languages. I
early drew my intellectual nourishment from Homer, Virgil, Horace,
Terence, Anacreon, Plato, and Euripides on the one hand, and from
Moses and the Prophets on the other.”
How are we to explain this contradiction of an inconsistent and
ungrateful humanist who extols the humanities to the skies, and at
the same time puts such restrictions on the teaching of them as
almost to annihilate them? The reason for this is, that, in his opinion,
the belles-lettres are useful only for the training of orators and
poets, but are not serviceable in the general development of the
mind. Consequently, being fancy studies, so to speak, they are fit
only for a small minority of pupils, and have no right to the first
place in a common education, destined for men in general. Diderot is
not able to discern what, in pedagogy, is their true title to nobility,—
that they are an admirable instrument of intellectual gymnastics, and
the surest and also the most convenient means of acquiring those
qualities of justness, of precision, and of clearness, which are
needed by all conditions of men, and are applicable to all the special
employments of life.[185]
Welcome to Our Bookstore - The Ultimate Destination for Book Lovers
Are you passionate about books and eager to explore new worlds of
knowledge? At our website, we offer a vast collection of books that
cater to every interest and age group. From classic literature to
specialized publications, self-help books, and children’s stories, we
have it all! Each book is a gateway to new adventures, helping you
expand your knowledge and nourish your soul
Experience Convenient and Enjoyable Book Shopping Our website is more
than just an online bookstore—it’s a bridge connecting readers to the
timeless values of culture and wisdom. With a sleek and user-friendly
interface and a smart search system, you can find your favorite books
quickly and easily. Enjoy special promotions, fast home delivery, and
a seamless shopping experience that saves you time and enhances your
love for reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!

ebookgate.com

You might also like