Title: Introduction to Oracle
1Chapter 2 Introduction to Oracles Forms Builder
9i
2- In this chapter you will
- Learn about the major Developer 9i Forms Builder
tools - Launch Forms Builder and connect to Oracle
- Practice using the main Forms Builder integrated
design environment (IDE) tools Object Navigator,
Layout Editor, Property Palette, and PL/SQL
editor - Create a simple form using the Data Block and
Layout Wizards
3- In this chapter you will
- Compile and save a form module
- Launch a form using Oracle Forms Builder runtime
engines - Learn about the form operating modes and how to
determine which mode the form is in - Filter records from the database using the form
data items - Use the form function keys
4Introducing Major Forms Builder 9i Tools
- Forms Builder consists of three products
- Forms Builder - the integrated development
environment - Forms Compiler - used to create the executable
form - Forms Runtime (client server) or Forms Server
(Web) - used to run the form
5Introducing Major Forms Builder 9i Tools
6Introducing Major Forms Builder 9i Tools
- Forms Builder IDE files have a file extension of
.fmb. - Executable Forms Builder files have a file
extension of .fmx. - Form Builder 6i can be executed on both the
client-server and the Web. - Forms Builder 9i forms can only be executed on
the Web.
7Introducing Major Forms Builder 9i Tools
8Introducing Major Forms Builder 9i Tools
- Forms Runtime is used to execute client-server
forms. - Forms Server dishes up the form when a URL
request is received. - Forms Server changes the form .fmx file into an
applet and sends it to the Web browser. - A Java plug-in called JInitiator executes the
applet in the Web browser. - JInitiator is downloaded to the client the first
time a user requests a form from Forms Server.
9Introducing Major Forms Builder 9i Tools
10Introducing Major Forms Builder 9i Tools
- Forms Builder IDE is launched by selecting the
Forms Builder option on the Start menu. - When Forms Builder is first opened a blank form
module or file will be displayed on the Object
Navigator.
11Introducing Major Forms Builder 9i Tools
12Introducing Major Forms Builder 9i Tools
- One of the first tasks that should be performed
is to connect to the Oracle database in order to
take advantage of the Forms Builder wizards.
13Forms Builder IDE Tools Object Navigator, Layout
Editor, Property Palette, and PL/SQL editor
- The Forms Builder IDE has four tools. These are
- Object Navigator - used to view the form modules,
the various form components, and other files. - Property Palette - used to modify form object
settings such as background color, number of
records displayed, or the name of the horizontal
tool bar.
14Forms Builder IDE Tools Object Navigator, Layout
Editor, Property Palette, and PL/SQL editor
15Forms Builder IDE Tools Object Navigator, Layout
Editor, Property Palette, and PL/SQL editor
- Layout Editor - used to format the form.
- PL/SQL Editor - used to add PL/SQL scripts to the
form.
16Forms Builder IDE Tools Object Navigator, Layout
Editor, Property Palette, and PL/SQL editor
17Forms Builder IDE Tools Object Navigator, Layout
Editor, Property Palette, and PL/SQL editor
18Forms Builder IDE Tools Object Navigator, Layout
Editor, Property Palette, and PL/SQL editor
- Forms Builder synchronizes the selected object on
the various tools. - Forms Builder provides hot keys and other tools
that allow the developer to easily move between
the tools.
19Creating a Simple Form Using the Data Block and
Layout Wizards
- All forms must have at least three components
- Data block with at least one data block item
- Canvas
- Window
20Creating a Simple Form Using the Data Block and
Layout Wizards
- A data block contains items that hold data.
- Data block items receive user input or display
values received from the database. - A form cannot be displayed unless at least one
data block item is available to receive the input
focus.
21Creating a Simple Form Using the Data Block and
Layout Wizards
- Data blocks interact with the database in the
following ways - Issues Select statements against the data blocks
data source - Places locks on corresponding database records
- Issues insert, update, and delete statements
against the corresponding data source
22Creating a Simple Form Using the Data Block and
Layout Wizards
- A canvas is the form object that is displayed.
- Any form object visible to the operator must be
placed on a canvas. - Canvases contain data block items, a boilerplate,
and graphics. - A window object is necessary to display the
canvas in the Web browser or on the operating
system.
23Creating a Simple Form Using the Data Block and
Layout Wizards
- In order to create a form, you must first create
a form module or file. This is done using Forms
Builder menu options or Object Navigator tools. - A data block must be created. This can be done
manually or with the Data Block Wizard. - The Data Block Wizard is a series of pages that
prompt the developer to enter values needed to
create the data block and associate it with a
database table, view, or stored procedures.
24Creating a Simple Form Using the Data Block and
Layout Wizards
- The Data Block Wizard will prompt the developer
for the following - Data source name
- Items that are contained on the data block
- Primary/foreign key columns used to synchronize
multiple data blocks - After completion, a data block and data block
items will be created. Each item will have the
same data type, length, and constraints as those
placed on the corresponding data source column.
25Creating a Simple Form Using the Data Block and
Layout Wizards
26Creating a Simple Form Using the Data Block and
Layout Wizards
27Creating a Simple Form Using the Data Block and
Layout Wizards
28Creating a Simple Form Using the Data Block and
Layout Wizards
29Creating a Simple Form Using the Data Block and
Layout Wizards
- The Layout Wizard is used to associate the data
block items with a canvas and set some of the
items display properties. - The Layout Wizard has a series of pages that
allow the following - Identify and set the canvas on which the items
are to display. - Identify the items that will be displayed.
- Set each items height, width, and prompt.
- Set the layout of the items (form or tabular).
- Set the number of records displayed on the
canvas.
30Creating a Simple Form Using the Data Block and
Layout Wizards
31Creating a Simple Form Using the Data Block and
Layout Wizards
32Creating a Simple Form Using the Data Block and
Layout Wizards
33Creating a Simple Form Using the Data Block and
Layout Wizards
34Creating a Simple Form Using the Data Block and
Layout Wizards
35Creating a Simple Form Using the Data Block and
Layout Wizards
36Creating a Simple Form Using the Data Block and
Layout Wizards
37Creating a Simple Form Using the Data Block and
Layout Wizards
38Compiling and Saving the Form Modules
- Forms must be compiled before they can be run.
- Forms can be compiled using the ControlT hot
keys or the Program/Compile Module menu option. - Forms Builder also has a preference that causes
the form to be compiled before it is executed
from the IDE. - Compiling the form creates an .fmx file.
39Compiling and Saving the Form Modules
- Forms created in Forms Builder 9i must be saved
before they are executed. If they are not, an
alert will be displayed and the form closed. - Forms are saved by pressing the Save tool or
selecting the File/Save As (or File/Save) menu
selection. - Saving the form causes an .fmb binary file to be
created.
40Launching a Form Using Oracle Forms Builder
Runtime Engines
- Forms are executed by runtime engines.
- Client server forms use Forms Runtime to execute
the .fmx file. - Web forms must be called from a Web server.
- Production forms are served from the Forms9iAS
Web server. - The Forms Builder IDE has its own internal Web
server allowing you to run forms from the IDE.
41Launching a Form Using Oracle Forms Builder
Runtime Engines
- Before running a Forms Builder 9i form from the
IDE two tasks must be performed - The Web server listener must be started.
- The form file must be saved at least once.
- The listener for Forms Builder 9i is called Start
OC4J and it is located on the Start menu next to
the Forms Builder option.
42Launching a Form Using Oracle Forms Builder
Runtime Engines
43Launching a Form Using Oracle Forms Builder
Runtime Engines
- Web forms will display in the default Web
browser. - Inside the Web browser will be an applet area.
- The size of the applet area is controlled by
settings in the Formsweb.cfg file located in the
\ora\forms90\server directory. - A comparable file exists in Forms Server. This
is the file used for production.
44Form Operating Modes and Determining Which Mode a
Form is in
- Forms have three operating modes These are
- ENTER QUERY mode in which the data block is ready
for the operator to enter values that can be used
as arguments in a SELECT statement - QUERY mode in which the data block has sent a
SELECT statement to the database and is waiting
to receive the result set - NORMAL mode in which the data block can be used
to insert, update, or delete records
45Form Operating Modes and Determining Which Mode a
Form is in
- Data blocks in the NORMAL mode always have at
least one row that can be used to add records
(unless this feature is disabled). This will be
the row following the result set. - When the form is in the NORMAL mode you can move
between the result set rows using your mouse, the
up and down arrows, or the Page Up and Page Down
keys.
46Form Operating Modes and Determining Which Mode a
Form is in
47Form Operating Modes and Determining Which Mode a
Form is in
- The ENTER QUERY mode occurs when the form is
prompting the user to enter search arguments. - Forms Builder flushes the data block of values
when it places the block in the ENTER QUERY mode. - The first record of a data block in the ENTER
QUERY mode is used to enter the search values. - The ENTER QUERY mode can always be identified by
a message appearing in the status line.
48Form Operating Modes and Determining Which Mode a
Form is in
49Form Operating Modes and Determining Which Mode a
Form is in
- A data block in the QUERY mode only lasts while
Forms Builder is retrieving records from the
database. - Users often confuse an empty data block in the
NORMAL mode with a data block in the ENTER QUERY
mode. - Data blocks are placed in the NORMAL mode by
default when the form is launched.
50Form Operating Modes and Determining Which Mode a
Form is in
51Form Operating Modes and Determining Which Mode a
Form is in
- A form is placed into the ENTER QUERY mode by
selecting the Query/Enter menu option, the Enter
Query tool on the tool bar, or the F11 function
key. - A form is placed into the QUERY mode by selecting
the Query/Execute menu option, the Execute Query
tool on the tool bar, or the F12 function key. - The Form will be placed into the NORMAL mode when
a result set is returned from the database.
52Form Operating Modes and Determining Which Mode a
Form is in
- If the SELECT statement does not return a result
set, the data block will return to the ENTER
QUERY mode. - The ENTER QUERY mode can be cancelled by exiting
the form. The first attempt to exit returns the
current block to the NORMAL mode. The second
attempt closes the form. - Forms can only be closed when the data block is
in the NORMAL mode.
53Filtering Records From the Database Using a Form
- All items displayed on the data block can be used
to enter search values. - The name of the item will be used as one argument
and the value the other (i.e. ename like
SMITH). - The values can be literal values or numeric
values. - The operator can also enter wild card symbols
(i.e. , _) since the default operator is LIKE. - Functions such as SUBSTR or UPPER can also be
used as arguments.
54Filtering Records From the Database Using a Form
55Filtering Records From the Database Using a Form
- The Query Length of the data block item can be a
constraint since it is set to the size of the
data source item by default. - The Query Length property can be enlarged so that
lengthy arguments can be entered. - Values entered into the data block items will be
the same data type as the item. It is not
necessary to enclose literals with single quotes.
56Filtering Records From the Database Using a Form
- The default evaluation operator (LIKE) can be
modified by entering the symbol as the first
character. Forms Builder will then use the next
symbol as the evaluation operator (i.e. gt 1000)
. - A text editor can be called from any item by
pressing the Edit/Edit menu option or the
ControlE keys. The text editor can be used to
enter lengthy values.
57Filtering Records From the Database Using a Form
58Filtering Records From the Database Using a Form
- The Query/Where dialog box can be called by
placing an ampersand () into an item and
executing a query. This dialog box can be used
to enter the entire WHERE clause. - Any function or column acceptable to Oracle can
be used in the Query/Where dialog box. Even if
the column is not included in the data block
(however, it must exist on the data source).
59Filtering Records From the Database Using a Form
60Function Keys
- Oracle forms have function keys that perform
tasks such as - Placing the form into the ENTER QUERY mode
- Exiting the form
- Duplicating values from one record into another
- Committing the record modifications
- Many of the default tool bar and menu options are
also available as function keys. - Experienced operators often find function keys
quicker to use than the mouse.
61Where You Are and Where Youre Going
- You have learned how to create a form module and
how to create a data block using the Data Block
Wizard. - You have learned how to format and set data block
item properties using the Layout Wizard. - You have seen how to compile, save, and execute
the form. - You have seen how to enter complex search
criteria into the form and to use function keys
to perform tasks.
62Where You Are and Where Youre Going
- In the next chapter you will learn how to use the
Object Navigator to compile, save, and execute
the form. - You will also learn how to add synchronized
detail data blocks to your forms.