Beruflich Dokumente
Kultur Dokumente
D61530GC10
Edition 1.0
December 2009
D64466
Author Copyright © 2009, Oracle. All rights reserved.
Disclaimer
Pam Gamer
This document contains proprietary information and is protected by copyright and
Technical Contributors other intellectual property laws. You may copy and print this document solely for your
own use in an Oracle training course. The document may not be modified or altered in
and Reviewers any way. Except where your use constitutes "fair use" under copyright law, you may
not use, share, download, upload, copy, print, display, perform, reproduce, publish,
Glenn Maslen license, post, transmit, or distribute this document in whole or in part without the
Duncan Mills express authorization of Oracle.
Grant Ronald The information contained in this document is subject to change without notice. If you
find any problems in the document, please report them in writing to: Oracle University,
500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not
Editors warranted to be error-free.
Raj Kumar Restricted Rights Notice
Amitha Narayan
If this documentation is delivered to the United States Government or anyone using
the documentation on behalf of the United States Government, the following notice is
Publishers applicable:
Trademark Notice
Preface
I Introduction
Objectives I-2
Course Objectives I-3
Course Content I-5
Summary I-10
iii
What You See at Run Time 2-15
Identifying the Data Elements 2-16
Navigating a Forms Application 2-17
Modes of Operation: Enter-Query Mode 2-19
Modes of Operation: Normal Mode 2-20
Retrieving Data 2-21
Performing a Restricted Query 2-22
Using the Query/Where Dialog Box 2-24
Inserting, Updating, and Deleting Records 2-26
Making Changes Permanent 2-28
Displaying Errors 2-29
Summary 2-30
Practice 2: Overview 2-33
iv
4 Creating a Basic Form Module
Objectives 4-2
Designing Form Modules 4-3
Creating a New Form Module 4-4
Setting Form Module Properties 4-5
Changing the Form Module Name and Coordinate System 4-6
Creating a New Data Block 4-8
Using the Wizards to Create a Data Block 4-9
Navigating the Wizards 4-10
Launching the Data Block Wizard 4-11
Data Block Wizard: Type Page 4-12
Data Block Wizard: Table Page 4-13
Launching the Layout Wizard 4-15
Using the Layout Wizard: Canvas and Data Block Pages 4-16
Using the Layout Wizard: Items and Style Pages 4-17
Using the Layout Wizard: Records and Finish Pages 4-18
Data Block Functionality 4-19
Template Forms 4-20
Saving a Form Module 4-21
Compiling a Form Module 4-22
Module Types and Storage Formats 4-23
Deploying a Form Module 4-25
Producing Text Files and Documentation 4-26
Summary 4-27
Practice 4: Overview 4-28
v
Modifying the Layout of a Data Block 5-15
Summary 5-17
Practice 5: Overview 5-18
vi
Controlling the Data of a Text Item: Copy Value from Item 7-15
Controlling the Data of a Text Item: Synchronize with Item 7-16
Altering Navigational Behavior of Text Items 7-17
Enhancing the Relationship Between Text Item and Database 7-18
Adding Functionality to a Text Item 7-19
Adding Functionality to a Text Item: Conceal Data Property 7-20
Adding Functionality to a Text Item: Keyboard Navigable and Enabled 7-21
Adding Functionality to a Text Item: Multi-Line Text Items 7-22
Displaying Helpful Messages: Help Properties 7-23
Summary 7-24
Practice 7: Overview 7-26
vii
Creating a Check Box in the Layout Editor 9-7
Setting Check Box Properties 9-8
Check Box Mapping of Other Values 9-9
What Are List Items? 9-10
Creating a List Item 9-12
Converting an Existing Item to a List Item 9-13
Creating a List Item in the Layout Editor 9-14
Setting List Item Properties 9-15
List Item Mapping of Other Values 9-16
What Are Radio Groups? 9-18
Creating a Radio Group 9-19
Converting an Existing Item to a Radio Group 9-20
Creating a Radio Group in the Layout Editor 9-21
Setting Radio Group Properties 9-22
Setting Radio Button Properties 9-23
Radio Group Mapping of Other Values 9-24
Summary 9-25
Practice 9: Overview 9-26
viii
What Are Bean Area Items? 10-26
Creating a Bean Area Item 10-27
Setting Bean Area Item Properties 10-28
Interacting with the JavaBean at Run Time 10-29
Summary 10-30
Practice 10: Overview 10-31
ix
Summary 12-21
Practice 12: Overview 12-22
13 Introduction to Triggers
Objectives 13-2
Trigger: Overview 13-3
Grouping Triggers into Categories 13-4
Trigger Components 13-6
Trigger Type 13-7
Trigger Types 13-8
Trigger Code 13-9
Trigger Scope 13-10
Trigger Scope: Example 13-11
Specifying Execution Hierarchy 13-12
Summary 13-14
14 Producing Triggers
Objectives 14-2
Creating Triggers in Forms Builder 14-3
Creating a Trigger: Selecting the Trigger Scope 14-4
Creating a Trigger: Selecting the Trigger Type 14-5
Creating a Trigger: Defining the Trigger Code 14-6
Setting Trigger Properties 14-7
PL/SQL Editor: Features 14-8
Database Trigger Editor 14-10
Writing Trigger Code 14-11
Using Variables in Triggers 14-13
Using Forms Builder Variables 14-14
Adding Functionality with Built-in Subprograms 14-16
Limits of Use 14-18
Using Built-in Definitions 14-19
Useful Built-Ins 14-21
Using the When-Button-Pressed Trigger 14-23
Using the When-Window-Closed Trigger 14-24
Summary 14-25
Practice 14: Overview 14-26
15 Debugging Triggers
Objectives 15-2
Debugging Process 15-3
Debug Console 15-4
x
Debug Console: Stack Panel 15-5
Debug Console: Variables Panel 15-6
Debug Console: Watch Panel 15-7
Debug Console: Form Values Panel 15-8
Debug Console: PL/SQL Packages Panel 15-9
Debug Console: Global/System Variables Panel 15-10
Debug Console: Breakpoints Panel 15-11
Debug Console: Breakpoints Panel 15-12
Setting Breakpoints in Client Code 15-13
Setting Breakpoints in Stored Code 15-14
Debugging Tips 15-15
Running a Form in Debug Mode 15-16
Stepping Through Code 15-17
Debug Example Used in Demonstration 15-18
Remote Debugging 15-20
Summary 15-22
Practice 15: Overview 15-23
xi
Errors and Built-Ins 17-7
Controlling System Messages 17-9
Suppressing Messages 17-11
FORM_TRIGGER_FAILURE Exception 17-13
Triggers for Intercepting System Messages 17-15
Handling Informative Messages 17-17
Setting Alert Properties 17-19
Planning Alerts: How Many Do You Need? 17-21
Controlling Alerts at Run Time 17-22
Using the SHOW_ALERT Function 17-24
Directing Errors to an Alert 17-26
Handling Errors Raised by the Oracle Database Server 17-27
Trapping Oracle Database Server Errors 17-29
Summary 17-30
Practice 17: Overview 17-33
18 Query Triggers
Objectives 18-2
Query Processing: Overview 18-3
SELECT Statements Issued During Query Processing 18-5
Using a WHERE Clause 18-7
Setting the ONETIME_WHERE Property 18-8
Using an ORDER BY Clause 18-9
Writing Query Triggers: Pre-Query Trigger 18-10
Writing Query Triggers: Post-Query Trigger 18-11
Writing Query Triggers: Using SELECT Statements in Triggers 18-12
Query Array Processing 18-13
Coding Triggers for Enter-Query Mode 18-15
Determining the Current Mode 18-17
Overriding Default Query Processing 18-19
Obtaining Query Information at Run Time 18-21
Summary 18-23
Practice 18: Overview 18-25
19 Validation
Objectives 19-2
Validation Process 19-3
Using Object Properties to Control Validation 19-5
Using LOVs for Validation 19-7
Using Triggers to Control Validation 19-9
xii
Example: Validating User Input 19-11
Using Client-Side Validation 19-13
Using a PJC 19-15
Tracking Validation Status 19-16
Using Built-Ins to Control When Validation Occurs 19-18
Summary 19-20
Practice 19: Overview 19-21
20 Navigation
Objectives 20-2
Navigation: Overview 20-3
Internal Navigation 20-5
Using Object Properties to Control Navigation 20-7
Using the Mouse Navigate Property 20-9
Navigation Triggers Behavior 20-10
Using When-New-<object>-Instance Triggers 20-12
Initializing Forms Object Instances 20-13
Using Pre- and Post-Triggers 20-15
Avoiding the Navigation Trap 20-17
Using Navigation Built-ins in Triggers 20-18
Calling Built-ins from Navigational Triggers 20-19
Summary 20-20
Practice 20: Overview 20-21
21 Transaction Processing
Objectives 21-2
Transaction Processing: Overview 21-3
Commit Sequence of Events 21-6
Characteristics of Commit Triggers 21-8
Common Uses for Commit Triggers 21-10
Life of an Update 21-12
Performing Delete Validation 21-14
Assigning Sequence Numbers to Records 21-16
Keeping an Audit Trail 21-18
Testing the Results of Trigger DML 21-19
DML Statements Issued During Commit Processing 21-21
Overriding Default Transaction Processing 21-23
Running Against Data Sources Other than Oracle 21-25
Getting and Setting the Commit Status 21-27
Array Processing 21-31
Effect of Array DML on Transactional Triggers 21-32
xiii
Implementing Array DML 21-33
Summary 21-34
Practice 21: Overview 21-36
xiv
Writing Code for PL/SQL Libraries 23-25
Creating Library Program Units 23-26
Attaching Libraries 23-27
Referencing Attached Library Program Units 23-28
Summary 23-30
Practice 23: Overview 23-32
xv
Linking by Parameter Lists: The Calling Form 25-21
Linking by Global Record Groups 25-23
Linking by Package Variables in Shared PL/SQL Library 25-24
Example of Linking by Shared PL/SQL Variables 25-25
Summary 25-26
Practice 25: Overview 25-28
xvi
Appendix E: Oracle Object Features
Oracle Scalar Data Types E-2
Object Types E-3
Object Tables E-5
Object Columns E-6
Object Views E-7
Using INSTEAD-OF Triggers E-9
Defining INSTEAD-OF Triggers E-10
References to Objects E-11
Oracle Type Wizard E-13
Displaying Object Types in the Object Navigator E-14
Displaying Object Tables and Columns in the Object Navigator E-15
Displaying Object Views in the Object Navigator E-16
Displaying Object REFs in the Object Navigator E-17
xvii