Preface
Overview of Development
Overview of Developing Applications With Oracle Database XE
Oracle Database Express Edition
SQL
PL/SQL
Database Objects
Basic Application Development Concepts
Development Tools
Sample HR Account
Other Development Environments
Managing Database Objects
Overview of Managing Objects
Database Objects for Your Application
Managing Database Objects With Object Browser
Viewing Data in Tables With Object Browser
Viewing Information With Object Reports
Using Datatypes
Managing Tables
Ensuring Data Integrity in Tables With Constraints
Column Default Value
NOT NULL Constraint
Check Constraint
Unique Constraint
Primary Key Constraint
Foreign Key Constraint
Creating a Table
Adding a Column To a Table
Modifying a Column In a Table
Dropping a Column From a Table
Adding a Check Constraint
Adding a Unique Constraint
Adding a Primary Key Constraint
Adding a Foreign Key Constraint
Viewing Existing Constraints
Disabling and Enabling a Constraint
Dropping a Constraint
Adding Data to a Table
Modifying Data in a Table
Removing a Row in a Table
Dropping a Table
Managing Indexes
Index Types
Indexes for Use with Constraints
Guidelines for Creating Indexes
Index the Correct Tables and Columns
Limit the Number of Indexes for Each Table
Drop Indexes That Are No Longer Required
Creating an Index
Displaying an Index for a Table
Dropping an Index
Managing Views
Managing Sequences
Managing Synonyms
Using SQL
Overview of SQL
Running SQL Statements
Retrieving Data With Queries
Displaying Data Using the SELECT Statement
Using a Column Alias to Change Headings When Selecting Data
Restricting Data Using the WHERE Clause
Using Regular Expressions When Selecting Data
Sorting Data Using the ORDER BY Clause
Displaying Data From Multiple Tables
Using Bind Variables With the SQL Commands Page
Using Pseudocolumns, Sequences, and SQL Functions
Using ROWNUM, SYSDATE, and USER Pseudocolumns With SQL
Using Arithmetic Operators
Using Numeric Functions
Using Character Functions
Using Date Functions
Using Conversion Functions
Using Aggregate Functions
Using NULL Value Functions
Using Conditional Functions
Manipulating Data With SQL Statements
Adding Data With the INSERT Statement
Updating Data With the UPDATE Statement
Deleting Data With the DELETE Statement
Using Transaction Control Statements
Using Data Definition Language Statements to Manage Database Objects
Creating a Table With SQL
Adding, Altering, and Dropping a Table Column With SQL
Creating and Altering a Constraint With SQL
Renaming a Table With SQL
Dropping a Table With SQL
Creating, Altering, and Dropping an Index With SQL
Creating and Dropping a View With SQL
Creating and Dropping a Sequence With SQL
Creating and Dropping a Synonym With SQL
Using PL/SQL
Overview of PL/SQL
Entering and Running PL/SQL Code
Using the Main Features of PL/SQL
Using the PL/SQL Block Structure
Inputting and Outputting Data with PL/SQL
Using Comments
Declaring Variables and Constants
Using Identifiers in PL/SQL
Assigning Values to a Variable With the Assignment Operator
Using Literals
Declaring and Assigning Variables With the DEFAULT Keyword or NOT NULL Constraint
Assigning Values to a Variable With the PL/SQL SELECT INTO Statement
Using %TYPE and %ROWTYPE Attributes to Declare Identical Datatypes
Using PL/SQL Control Structures
Conditional Control With IF-THEN
Conditional Control With the CASE Statement
Iterative Control With LOOPs
Sequential Control With GOTO
Using Local PL/SQL Procedures and Functions in PL/SQL Blocks
Using Cursors To Retrieve Data
Working With PL/SQL Data Structures
Using Bind Variables With PL/SQL
Using Dynamic SQL in PL/SQL
Handling PL/SQL Errors
Using Procedures, Functions, and Packages
Overview of Procedures, Functions, and Packages
Managing Stored Procedures and Functions
Creating a Procedure or Function With the SQL Commands Page
Creating a Procedure or Function With the Object Browser Page
Viewing Procedures or Functions With the Object Browser Page
Creating Stored Procedures With SQL CREATE PROCEDURE
Creating a Stored Procedure That Uses Parameters
Creating a Stored Procedure With the AUTHID Clause
Creating Stored Functions With the SQL CREATE FUNCTION Statement
Calling Stored Procedures or Functions
Editing Procedures or Functions
Dropping a Procedure or Function
Managing Packages
Writing Packages With PL/SQL Code
Creating Packages in the SQL Commands Page
Creating Packages With the Object Browser Page
Viewing Packages With the Object Browser Page
Creating Packages With the SQL CREATE PACKAGE Statement
Editing Packages
Dropping Packages
Calling Procedures and Functions in Packages
Accessing Variables in Packages
Oracle Provided Packages
Using Triggers
Overview of Triggers
Types of Triggers
Naming Triggers
When Is a Trigger Fired?
Controlling When a Trigger Is Fired
Firing Triggers With the BEORE and AFTER Options
Firing Triggers With the FOR EACH ROW Option
Firing Triggers Based on Conditions (WHEN Clause)
Accessing Column Values in Row Triggers
Detecting the DML Operation That Fired a Trigger
Enabled and Disabled Trigger Modes
Error Conditions and Exceptions in the Trigger Body
Designing Triggers
Managing Triggers in the Database
Creating a Trigger With the SQL Commands Page
Creating a Trigger With the Object Browser Page
Viewing a Trigger With Object Browser
Creating a Trigger With the AFTER and FOR EACH ROW Option
Creating a Trigger With the BEFORE Option and WHEN Clause
Creating a Trigger With an Exception Handler
Creating a Trigger That Fires Once For Each Update
Creating LOGON and LOGOFF Triggers
Modifying Triggers
Dropping Triggers
Disabling Triggers
Enabling Triggers
Compiling Triggers
Working in a Global Environment
Overview of Globalization Support
Setting Up the Globalization Support Environment
Choosing a Locale with the NLS_LANG Environment Variable
Setting NLS Parameters
Language and Territory Parameters
Date and Time Parameters
Calendar Definitions
Numeric and List Parameters
Monetary Parameters
Linguistic Sorting and Searching
Length Semantics
SQL and PL/SQL Programming with Unicode
Locale-Dependent SQL Functions with Optional NLS Parameters
Using SQL Command Line
Overview of SQL Command Line
Using SQL Command Line
Reserved Words
Index