Training - Forms 6i
Training - Forms 6i
Training - Forms 6i
Presenter :
The only thing more powerful than a great idea,
is a great idea powerfully executed.
- William Blake
Oracle Forms 6i
Objectives
After you complete this lesson, you should be able to Describe the following :
Productivity enhancements
Web deployment of applications
Scalability
Openness
Productivity
Oracle Developer employs :
Rapid application design (RAD) techniques.
Object orientation.
Built-in computer-based training.
A unified client-server architecture.
Web Deployment
Oracle Developer takes advantage of the ease and accessibility of the Web.
Scalability
Oracle Developer's flexible multi-tier architecture supports :
Oracle7 and Oracle8 application servers or
Third-party application servers
Openness
Oracle Developer offers integration with :
Oracle databases.
Rdb, SQL Server, Informix, Sybase, and DB/2.
Database access is provided through:
ODBC database drivers.
Oracle Gateways.
Project Builder
It helps you to :
Organize and maintain the many different files that make up an application.
Form Builder
It is a development tool for :
Building applications that accesses information stored in a database.
can also call reports and graphics.
They
Graphics Builder
It enables you to :
Produce interactive graphical displays .
Report Builder
It enables you to :
Develop production-quality reports in a Client/Server and Web environment.
To deploying reports on the Web use :
Reports Server
Reports Web CGI or Reports Cartridge.
Procedure Builder
It is a unified environment for :
Developing and maintaining C/S application code.
Query Builder
Displays :
Your tables graphically. Providing visual assistance as you use the point-and-click
interface to create a single query.
Schema Builder
Schema Builder is a graphical tool that enables you to :
Create,
Copy,
Modify,
Recap
Review Questions
Recap
Creating an Effective Form
Guidelines for building forms
Designing messages
Review Questions
2
Oracle Form Module
T rig g e rs
B lo c k s
T r ig g e rs
Ite m s
R e la tio n s
T rig g e rs
C a n v a s -v ie w s
W in d o w s
A le r ts
E d ito rs
R e c o rd G ro u p s
LO Vs
P r o g r a m m in g O b je c ts
Programming Objects
P r o g r a m m in g O b je c ts
V is u a l A ttr ib u te s
P r o p e r t y C la s s e s
T r ig g e rs
O b je c t G r o u p s
O b je c t G r o u p C h ild r e n
P a r a m e te rs
P r o g r a m U n its
S p e c ific a tio n
R e fe re n c e s
A tta c h e d L ib r a r ie s
R e fe re n c e d b y
Control Block
Data Block
Querying a Form
Records
Fetched
Table
Records Buffered
Block Display
SELECT statement
Work File
Retrieving Data
Restricted Query
Unrestricted Query
A
1
2
3
4
1
2
3
4
A
1
2
3
4
D
1
2
3
4
Database
Recap
The Form Module Objects
The Programming Objects
Review Questions
3
Master / Detail Relationships
A master block
A detail block.
It reflects a primary key to foreign key relationship between the tables on which
the blocks are based.
Master Deletes
Coordination
Properties
Master Deletes Properties:
Non-Isolated
Isolated
Cascading
Coordination Properties:
Immediate
Deferred with Auto-Query
Deferred with No Auto-query
Recap
Review Questions
Hands-On-Exercise 1, 2
4
The Layout Editor and The Property Window
ToolBar
Ruler
ToolPalette
Notes
Notes
Notes
Find field
Property Value
Property Name
Notes
Recap
The layout editor
Creating Items
The property window
Review Questions
5
Defining Block Items
Defining Buttons
Buttons are interface items that operators select to execute commands or
initiate actions.
on or off,
true or false.
Check Box
The display state of a check box is always either checked or unchecked.
Recap
Defining Buttons
Defining Check Boxes
Defining Display Items
Defining List Items
Defining Radio Groups
Defining Text Items
Review Questions
Review Questions
Hands-On-Exercise 3, 4, 5
6
Using PL/SQL in Forms
Variables
Local Variables
Global Variables
System Variables
Global Variables
Global variables are not formally declared the way PL/SQL local variables are.
Initialize a global variable the first time you assign a value to it.
GLOBAL.my_var:= TO_CHAR(:order.total * .85);
To destroy a global variable and release its memory, use the ERASE built-in
procedure:
Erase('GLOBAL.my_var');
System Variables
Oracle Forms provides built-in system variables that keep track of runtime
status conditions during an Oracle Forms Runform session. You can read the
values of these variables in any form trigger or user-named subprogram.
Some examples of System Variables:
FORM_STATUS
BLOCK_STATUS
RECORD_STATUS
CURRENT_FORM
CURRENT_BLOCK
CURRENT_ITEM
CURRENT_DATETIME
New
Insert
Query
Changed
Recap
Review Questions
Review Questions
7
Writing Program Units
User-named Subprograms
It is a named PL/SQL function or procedure written in a form, menu, or
library module.
It can be reused without having to enter it in multiple triggers.
Creating Packages
Package organize your procedures and functions to form a suitcase of
PL/SQL objects.
Packages can contain variables that are persistent for a user's entire
session.
Recap
User-named Subprograms
Creating a User-named Subprogram
Calling User-Named Subprograms
Creating Packages
8
Triggers
Triggers
D2K applications are event driven
A trigger is a block of PL/SQL code you write to customize your
application.
You use triggers to respond to runtime events with appropriate
processing.
Triggers ...
Triggers can be attached to any object in the form:
an item
a block
the form itself.
The object to which a trigger is attached defines the scope of the trigger
Types of events
Oracle Forms recognizes a predefined set of runtime events, each of which
has a corresponding built-in trigger.
T y p e s o f E v e n ts
In te rfa c e
I n t e rn a l P r o c e s s in g
Trigger Categories
Block processing
GUI events
Master-Detail
Message handling
Navigational
Query time
Transactional
Validation
Notes
Notes
User-Named Triggers
A user-named trigger is one that has a unique, user-supplied name.
To call a user-named trigger, use the EXECUTE_TRIGGER built-in procedure.
execute_trigger('user_trigger');
When-Create-Record
When-Clear-Block
When-Database-Record
When-Remove-Record
Master/Detail Triggers
On-Check-Delete-Master
On-Clear-Details
On-Populate-Details
Navigational Triggers
Navigational triggers fire in response to navigational events.
Navigational triggers can be sub-divided into two categories:
Pre- and Post- triggers,
When-New-Instance triggers.
Pre-Form
Pre-Block
Pre-Record
Pre-Text-Item
Post-Text-Item
Post-Record
Post-Block
Post-Form
When-New-Instance Triggers
When-New-Instance triggers fire at the end of a navigational sequence that
places the input focus in a different item.
When-New-Form-Instance
When-New-Block-Instance
When-New-Record-Instance
When-New-Item-Instance
Query-Time Triggers
Pre-Query
Post-Query
Transactional Triggers
On-Delete On-Insert
On-Lock On-Logon
On-Logout
On-Update
Post-Delete Post-Forms-Commit
Post-Insert
Post-Update
Post-Database-Commit
Pre-Commit Pre-Delete
Pre-Insert Pre-Update
Validation Triggers
Validation triggers fire when Oracle Forms validates data in an item or
record.
When-Validate-Item
When-Validate-Record
Recap
Types of events
Using Triggers in Forms
Trigger Categories Based on Trigger Functions
Built-In Subprograms
User-Named Triggers
Review Questions
Review Questions
Hands-On-Exercise 6, 7
Hands-On-Exercise 8, 9
Hands-On-Exercise 10, 11
Hands-On-Exercise 12
9
Alerts and Editors
Alerts
An alert is a modal window that displays a message notifying the operator
of some application condition.
There are three styles of alerts:
Stop
Caution
Note.
Displaying an Alert
To display an alert, your application must execute the SHOW_ALERT built-in
subprogram from a trigger or user-named subprogram.
SHOW_ALERT is a function that returns a numeric constant.
Show_Alert(alert_name)
Return NUMBER;
Notes
Notes
Editors
There are three editors that can be used at runtime :
the default editor
a system editor
a user-named editor.
User-Named Editor
A user-named editor has the same text editing functionality as the default
editor
A user-named editor can be displayed programmatically with the built-in
procedure SHOW_EDITOR.
EDIT_TEXTITEM
SHOW_EDITOR
Displaying Editors
The EDIT_TEXTITEM procedure invokes the editor associated with the
current text item in the form.
The SHOW_EDITOR procedure displays a user-named editor at the
specified display coordinates.
Recap
Alerts
Creating and Displaying an Alert
Changing the Alert Message at Runtime
Editors
Using the Default Editor, User-Named Editor, System Editor
Displaying Editors at Runtime
Using EDIT_TEXTITEM and SHOW_EDITOR
Review Questions
Review Questions
Hands-On-Exercise 13
10
LOVs
The LOV is the interface object that allows operators to view, scroll, and
select records in the underlying record group.
LOV Properties
(x,y)
Width
Automatic Select
height
Return
Value
Automatic skip
Automatic
Display
Notes
LOV
Text Item
LOV
Query-based Record
Group
Database
Notes
SHOW_LOV
Example to call the SHOW_LOV function :
When-Button-Pressed Trigger:
DECLARE
dummy BOOLEAN;
BEGIN
dummy := show_LOV('my_lov',15,10);
END;
Reusing an LOV
Text Item
Text Item
Text Item
LOV
Select some of the field values
Supporting Data Record Group
Recap
Review Questions
Hands-On-Exercise 14
11
Canvas-Views and Windows
Canvas-Views
Canvas-views are the background objects on which you place the interface
items and boilerplate objects
Canvas View
The canvas-view is displayed in the window
Types of canvas-views :
Content
Stacked
Horizontal / Vertical Toolbar
Canvas-Views ...
Content :
Every window has at least one canvas-view, and usually just one.
Stacked :
A canvas-view you display on top of another canvas-view
Toolbar :
Displays horizontal and vertical bars at the top of or to the side of a window,
respectively.
Windows
A form can include any number of windows.
For each window you create, you must create at least one content canvasview.
Creating Toolbars
You can create toolbars for any window in a form.
Toolbars can be displayed
Horizontally across the top of a window
Vertically on the left side of a window.
Notes
Notes
Notes
Recap
Canvas-Views
Windows
Review Questions
Review Questions
Hands-On-Exercise 15, 16
12
Visual Attributes, Property Classes
and Object Groups
Notes
Notes
Notes
Notes
Notes
Notes
Notes
Recap
Visual Attribute Properties
Setting Visual Attributes in the Properties window
Creating a Named Visual Attribute
Working with Property Classes
Creating Property Classes
Base an object on a property class
Reusing Objects and Code
Creating a Reference Object
Create an Object Group
Review Questions
Hands-On-Exercise 17, 18
13
Form Parameters
Form Parameters
Parameters provide a mechanism for :
Defining
Setting the values of inputs that are required by a form at startup.
Form Parameter
You can pass parameter values to a form when an application executes the
CALL_FORM,
NEW_FORM,
OPEN_FORM, or
RUN_PRODUCT built-in subprograms.
Referencing Parameters
In PL/SQL, you can reference and set the values of form parameters using bind
variable syntax.
Preface the parameter name with the reserved word PARAMETER :
:PARAMETER.parameter_name := 'TOKYO';
Or
:block.item := :PARAMETER.parameter_name;
ADD_PARAMETER
CREATE_PARAMETER_LIST
DELETE_PARAMETER
DESTROY_PARAMETER_LIST
GET_PARAMETER_ATTR
GET_PARAMETER_LIST
SET_PARAMETER_ATTR
Recap
Creating a Parameter
Referencing Parameters
Indirectly Referencing Parameters
Creating and Passing Parameter Lists
Review Questions
14
Menus
Menus
Every form runs with one of the following:
The Default menu that is built in to every form
A custom menu that you define as a separate module and then attach to the form
for runtime execution
No menu at all
Menu Objects
The Oracle Forms menu hierarchy contains three object categories:
Menu modules
Menus (including main menus, individual menus, and submenus)
Menu items
Null
Menu
PL/SQL
Plus
Current Forms
Macro
Notes
Notes
Notes
Recap
Menus
Menu Objects
Building a Custom Menu
Assigning Commands to Menu Items
Attaching a Menu Module to a Form
Writing Startup Code
Runtime Control
Review Questions
15
PL/SQL Libraries
PL/SQL Library
A library is a collection of subprograms, including user-named
procedures, functions, and packages.
Once you create a library, you can attach it to any other form, menu, or
library module.
The same library can be attached to multiple forms and menus.
Applications
Procedure
Database
Function
Package
Library
Notes
Recap
PL/SQL Libraries
PL/SQL Library File Formats
Calling Library Program Units
Writing Library Program Units
Steps for Creating and Attaching a Library
Creating a Library
Attaching a Library to Another Module
Editing a Library
Review Questions
16
Working with Images
Images
You can incorporate two types of images into an Oracle Forms application:
Boilerplate Images
Image Items
At runtime,
Navigating and selecting image items is possible
Cannot navigate to or modify boilerplate images.
Image Items
Image items are special types of interface controls that store and display
either vector or bitmap images.
Like other items that store values, image items can be either base table
items control items.
Notes
Recap
Images
Using Boilerplate Images
To Import a Boilerplate Image
Defining Image Items
Populating Image Items
Manipulating Images at Runtime
Hands-On-Exercise 19