Вы находитесь на странице: 1из 52

Training on Oracle Forms

By :Manoj Baghel (Assistant Consultant) TCS,New Delhi


11 August 2012 1

Agenda

What Is Oracle Form Builder? Forms Concepts - What is a Form? The Forms Application Display Forms Builder forms in a Web browser Use a data block form to view, insert, update, and delete database data Create a data block form that displays a single record at a time Use the Object Navigator to change form object names
11 August 2012 2

Agenda (continued)
Use

the Data Block and Layout Wizards to modify form properties Create a tabular-style data block form that displays multiple records References

11 August 2012

What Is Oracle Form Builder?


Component of
Forms Reports

Oracle Developer/2000

Graphics

Application builder Event-driven applications

11 August 2012

Forms - The Basic Idea


A powerful Graphical User Interface. Are used to create applications to enter, access, change, or delete data from an Oracle database in an online, formbased environment. Forms provides many objects for developing an effective application module. Coupled with the concept of user extensibility, Forms can be used to serve virtually every online need in an Oracle database environment.

11 August 2012 5

Components of Form Builder


Forms

Builder

- Used to create a form. Forms Compiler - Required to compile the file created in Forms Builder. Forms Runtime - Used to run the compiled code created by Forms
Compiler.
11 August 2012 6

Forms Concepts - The Big Picture


User actions Internal events

Triggers and/or default processes


Application State
11 August 2012

Database

What Is Forms Looking For


Client

Forms Runtime
Connect Database Registry
FORMS_PATH

Forms Server
(Compiled Objects)
8

11 August 2012

File Types

Forms Modules
.FMB; Forms Source
.FMX; Forms Executable

Menu Modules
.MMB; Menu Source
.MMX; Menu Executable

Libraries
.PLL; PL/SQL Source and Executables
.PLX; PL/SQL Executable Only. .PLD; Documentation file

11 August 2012

The Forms Application What You See


File Edit View Query Block Record Insert Help Whatever

Menu

Canvas
Are you really sure you want to do this? Yes No

Window
enter

exit

View
11 August 2012

Control Item

BaseTable Item
10

The Forms Application


What

you see;

Window Menu

Canvas/View
Items Base-block items Control-block items Database records
11 August 2012 11

Forms Components
Highest Level of Hierarchy
Forms Menu Libraries Built-in Packages Database Objects

11 August 2012

12

Forms Components
Windows
- Displays canvases. - Form can have multiple windows. - Modal; user must respond and dismiss window before doing anything in another window. - Modeless; user can move to another window.

11 August 2012

13

Forms Components
Canvas-Views
- Visual element of Forms. This is how you display all those Items. - Canvas; Background on which text and items are placed. - View; Visible portion of canvas. - Form can have multiple canvases. - Canvases can be stacked, scrolled.

11 August 2012

14

Forms Components
Blocks
- Base-Table Block corresponds to Database Table; set of items representing database table columns. An instance of a Base-Table Block corresponds to a Database Record. - Control Block is usually a collection of control items (e.g. Buttons, CheckBoxes, Radio Groups), but can also be collection of Display Items (readonly text), Text Items (variables), images, etc.
11 August 2012 15

Forms Components
Block Properties

11 August 2012

16

Forms Components
Items
- Base-Table Items are text items that correspond to Database Columns. Forms creates them automatically. - Control Items can be Buttons, Check-Boxes, Radio Groups, Display Items (read-only text), Text Items (variables), images, etc.

11 August 2012

17

Forms Components
Item Properties

11 August 2012

18

Forms Components
Visual Attributes
- Collection of display properties. - Refer to Named Visual Attribute in Items to standardise appearance. Change in NVA will affect all Items referring to it.

Property Classes
- Collection of ANY properties. - When items refer to Property Class, only properties that make sense for that item will be used.
11 August 2012 19

Forms Components
Triggers
- At Form, Block or Item level - Lower level triggers fire before higher level triggers - If same trigger-type occurs at different levels, only lowest will fire

11 August 2012

20

Forms Component
Alerts
- Modal Window that displays a message - Modal; User must respond - One, two or three buttons - Three types; - Stop (stop sign) - Caution (exclamation) - Note - Use SHOW_ALERT built-in function
11 August 2012 21

Forms Components
LOVs
- Allows user to select from specific set of values. -Displays Record Group. -Use Built-in Show_Lov,List_Values functions

11 August 2012

22

Forms Components
Editors
- Editor; simple text-editor dialog box for entering lines of text into Text Item. - Can create editors with different appearances for different text fields.

11 August 2012

23

Forms Components
Parameters
- Used as a Form variable. - Pass values between Forms.

11 August 2012

24

Forms Components
Program Units
- PL/SQL Procedures, Functions and Packages etc.

11 August 2012

25

Forms Components
Attached Libraries, Libraries & Built-in Packages
- PL/SQL procedures and functions. - Attached Library; Reference collected routines. - Library; Maintain and reference collected routines. - Built-in Packages; Oracle supplied procedure and functions.
11 August 2012 26

Forms Components
Object Groups
- Package reusable objects for later copying or reference. - E.g. Your Form includes an alarm clock to wake the user after ten minutes inactivity. This includes Triggers, Procedures, a Window, some graphics, etc. You can package these objects together to conveniently include this functionality in other forms.
11 August 2012 27

Forms Concepts
Events
Processes Triggers

11 August 2012

28

Forms Concepts
Events Things that happen External Events

User Interaction; Mouse, Keyboard, Menu

Internal Events Timers Processing steps for which triggers can be set Initiate Processes No Events? No Processing!
11 August 2012 29

Forms Concepts
Processes Pre-programmed default behavior What Forms DOES, for example;

Navigation Transaction Processing Validation Query Processing Master-Detail coordination

Series of Internal Events


11 August 2012 30

Forms Concepts
Triggers
Fired when Internal/External events occur Replace, supplement or initiate default

processing Initiate External events, to make Forms behave as if user performed action

E.g. Simulate User key-press

11 August 2012

31

The Forms Application


Form Builder builds Forms, Menus and Libraries
Application consists of at least one Form Can also include one or more Menu and Library modules Oracle provides default Menu

11 August 2012

32

Data Block Wizard Table Page

11 August 2012

33

Layout Editor Window

11 August 2012

34

The Layout Editor

Graphical display of form canvas Draw and proportion form items Boilerplate objects
Static imported image

11 August 2012

35

Using a Data Block Form

Block
Group of related form items

Data block
Corresponds to specific database table Contains objects that display values from tables data

fields

Text items Form menu


Contains selections to manipulate form
11 August 2012 36

Using a Data Block Form (continued)


Modes:
Normal Enter query

Query

Message

line

11 August 2012

37

Using a Form to View Table Records


Click

Enter Query button Type search expression Click Execute Query button To retrieve all records
Do not enter search expression

Inexact search Use comparison and wildcard operators in

search fields
11 August 2012 38

Using a Form to Insert, Update, and Delete Records

Insert
Enter data in blank form Click Save button

Update
Modify existing record using form Click Save button

Delete
Click Remove Record button Click Save button

11 August 2012

39

Viewing and Interpreting Form Errors


When

error occurs

Error code and message displayed in message

line
Errors

generated by

Form DBMS

11 August 2012

40

Creating a Data Block Form


Forms

Builder

Automatically generates text items and labels

for data fields in table Provides code for inserting, modifying, deleting, and viewing data records

11 August 2012

41

Multiple Record Form

11 August 2012

42

Triggers
Forms

Trigger
Trigger

Fires in response to Forms Events

Database THESE

Fires in response to Database Events

ARE COMPLETELY INDEPENDENT OF EACH OTHER!!!

11 August 2012

43

Triggers
Can

be coded at Form, Block, and/or Item Level Some Triggers apply to multiple levels of hierarchy, others are specific
When creating new trigger, List of Values

presents list of appropriate triggers


Each

Trigger-type executes only once Lowest level Triggers fired first


11 August 2012 44

Types of Form Triggers


Interface

Triggers

- Triggers associated with user interface objects. Navigational Triggers - Fire in response to navigational events Smart Triggers - Triggers classified on the basis of the object
11 August 2012 45

Types of Interface Triggers


Key

Triggers

- Key-Next-Item, Key-Commit etc. Action Triggers associated with user objects - When-Button-Pressed, When-List-Changed,WhenRadio-Changed etc

Mouse

Triggers

- When-Mouse-Click, When-Mouse-Leave,WhenMouse-Enter etc


11 August 2012 46

Types of Navigational Triggers

Pre- and Post- triggers - Fire when cursor navigates internally through different levels of the object hierarchy. - e.g. Pre-Text-Item, Post-Text-Item etc When-New-Instance triggers - Fires after the forms focus is positioned on given form,block or item. - e.g. When-New-Form-Instance, When-New-ItemInstance etc.
11 August 2012 47

Master-Detail Delete Properties

Non-Isolated - A master record cannot be deleted if associated detail records exist in the database. Isolated - A master record can be deleted, but the associated details records are not affected. Cascading - Master record can be deleted, and any associated detail
records are automatically deleted from the database.

11 August 2012

48

How Forms Builder Displays a Form in a Browser


Java

applet OC4J Instance


Translates compiled .fmx file into Java applet Downloads Java applet to Web browser

11 August 2012

49

References

On-line help

Oracle Developer/2000 Handbook (2nd. Ed.) Robert J. Muller, Oracle Press Oracle technology network (http://TechNet.Oracle.Com)

11 August 2012

50

11 August 2012

51

11 August 2012

52

Вам также может понравиться