0% found this document useful (0 votes)
55 views

Getting Started With Oracle Forms Developer

1. The document provides instructions for installing and configuring Oracle Forms Developer and making a first form. It guides the reader through downloading and installing the Oracle Suite 10g, setting up the connection, and generating a simple form from the CUSTOMER table. 2. Next, it describes how to create additional forms by joining data from related tables using the Data Block Wizard. It shows how to display additional fields from joined tables on the form. 3. Finally, it explains how to create a List of Values (LOV) using the LOV Wizard to populate a dropdown with available branch names and cities from a query, and assign it to a display item on the form.

Uploaded by

api-19815946
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views

Getting Started With Oracle Forms Developer

1. The document provides instructions for installing and configuring Oracle Forms Developer and making a first form. It guides the reader through downloading and installing the Oracle Suite 10g, setting up the connection, and generating a simple form from the CUSTOMER table. 2. Next, it describes how to create additional forms by joining data from related tables using the Data Block Wizard. It shows how to display additional fields from joined tables on the form. 3. Finally, it explains how to create a List of Values (LOV) using the LOV Wizard to populate a dropdown with available branch names and cities from a query, and assign it to a display item on the form.

Uploaded by

api-19815946
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

GETTING STARTED WITH ORACLE FORMS DEVELOPER

Oracle Database Access on


Péter Pázmány Catholic University
Faculty of Information Theory

subject: Database Systems

revision 1a
April 25th 2008
Dear Students!

This paper guides you through the installation, configuration, and making first steps with Oracle
Forms Developer. First section show, how to install the Oracle Suite 10g for “invidia”. After this
procedure, I'll show you, how can you built your first form and how can you write new
functionality...

Tamás Fülöp

PS: Please tell me, if you find something wrong (English, or other): fulta+oracle (@) digitus.itk.ppke.hu

thx by fulitomi
Index
Step I. - Setting up Oracle Forms Builder............................................................................................4
Step II. - First Run..............................................................................................................................12
Step III. – Join....................................................................................................................................21
Step IV. – List Of Values, and PL/SQL..............................................................................................24
Step I. - Setting up Oracle Forms Builder

The latest version of Oracle Forms Builder is a part of Oracle Suite 10g, unfortunately you must
download the all installation disks (2 zip files, cc. 800 MB) from Oracle website (after a free
registration, from here: http://www.oracle.com/technology/software/products/ids/index.html).
Please unpack the files, and go to the first disk directory:

fig 1: Unpacked files

After directory change, please run the setup.exe:

fig 2: Start installer

You get an Oracle welcome screen, press Next:

fig 3: Welcome screen


Now, you can choose a friendly destination directory:

fig 4: Set up directory

Next step, where you can choose the Installation Type. Please select COMPLETE, because this
type of installation contain Oracle Forms Developer.

fig 5: Select Complete


If you want, you can setting up Mail Server for Oracle, but it is not important for us.

fig 6: Leave blank


Well, the Installer is ready for installing Oracle Suite, with Forms Builder. Please Press Install.

fig 7: Press Install

Now, you can drink a coffee... or two...

fig 8: Coffee time...

When the progressbar is 70%, then you should add the second disk location, and click OK button:

fig 9: Usually change 1->2


Please be patient...

fig 10: ...


Please don't stop installer, until this screen:

fig 11: End of Installation


Press exit...

fig 12: Confirm exit


Now, we must setting up Oracle Suite's connection. You should start Net Configuration Assistant
(Start->Programs->Oracle DevSuiteHomeX->Configuration and Migration Tools-> Net
Configuration Assistant):

fig 13: Location, where can you find

Choose Local Net Service Name configuration, and press Next:

You should add a new service, so select add:

The service name is: “gyak”, please type it:


We need TCP, for connecting to our Oracle Server:

The server's hostname: invidia.itk.ppke.hu , the port is the default 1521.

I suggest to perform a test...

The only problem is the login information, you can try connect with your oracle user.
After good login, press next:

Please look the service name: “gyak”

Well, we finished.

A “dialog” again...
Click Finish (“Befejezés”) button.

Well, we installed, and configured the base system.


Step II. - First Run
Now we will to use Oracle Forms Builder. Please upload a base database schema for your account.
This guide will use the traditional banking database, to show, how to use the Builder (It's available
on http://digitus.itk.ppke.hu/~b_novak/adb/4_het/BANK_DB.SQL, or on the wiki).

First, we start OC4J Instance, because it's the Forms Application Server for testing.
(Start->Programs->Oracle Developer Suite – DevSuiteHome1 ->Forms Developer->Start OC4J
Instance)

It will be start a background program. Please don't close this window, while you work with Forms
Builder.

Now, you can run Forms Builder ( Start->Programs->Oracle Developer Suite – DevSuiteHome1
->Forms Developer->Forms Builder)

This is our workplace:

The Object Navigator is an important element, because we can see, and setting all properties of our
4GL program.
Now, we start to write a simple query form, which contain, the CUSTOMER table's all attributes.
First, we need to connect to our database server (File->Connect...).

Type your oracle user name and password. The database name's: “gyak”.

We make a data block, which supply the layout generator (and others) with data. Start the Data
Block Wizard (Tools->Data Block Wizard).

You see a welcome window. Just click next.


Select “Table or View”.

Now, we must to select a table from our database. Please click the “Browse...” button.

This is the Tables window. Select “Customer” in the list of tables (don't worry, if you look some
strange name tables).
Look the selected table and it's available attributes. Click on the double right arrow, because we
want to use all attributes. (Note: usually select the needful attributes eg. join, important data...)

Enter a name of your data block. Please accept now the default name.

Well, we need to create a layout for our data block, so choose “Create the data block, then call the
Layout Wizard”.
This is the Layout Wizard's Welcome. Click Next to proceed.

Now, you can select canvas name and type that you want to use. Click Next to accept the default
values.

Select the items that you would like to show in the form.
You can set some properties of the elements.

Select a layout style of your block.

You can select a title for the form that you are creating. You can set, how many records displayed on
form, and check if you need scrollbar.
The last window:

The Builder generate your form.

With a right click, you can call the properties window, where can set several properties of forms,
and their components.
Now, you can try to run your form (Program->Run Form)

In first run, you must to install Jinitiator:

ábra 2: Firefox
ábra 1: IE

MS IE offer a window to download the component, and Mozilla offer a Download Page after click
Install Component. Please download, and start the Installer. After Installing Jinitiator, you must
restart the browser.
You get a screen, like this:
You can download data if you click Execute Query:

The result is this, and you can navigate with blue arrows, and modify data. If you change data, you
need to send and commit it.
Step III. – Join
In this section, we'll tell the customer's loan amount. We will use the following tables:
CUSTOMER(name, street, city)
BORROWER(customer_name, loan_number)
LOAN(loan_number, branch_name, amount)
First we open the Step 2's form, to continue our work. Select “Data Blocks”, in Object Navigator
window. Start the Data Block Wizard, and choose the BORROWER table, and their all attributes,
and press Next.

Next step, we can make the join. Please uncheck the “Auto join”, and press “Create Relationship...”.

Our connection will be based on join connection, so choose that, and press OK.
Choose the Customer table for the join connection (if you have got more data blocks, then there will
be here), and press OK.

Now, you can choose the key attributes from Customer, if you click “Master Item”. Please select
“CUSTOMER_NAME”. You can see the SQL like syntax of join condition. Please press Next.

Well, the last step of Data Block Wizard, you can choose a name for this data block, and make a
Layout for it. If the connection is not 1:1, then I suggest to create more than one row.
After it, you need a Loan data block (and their layout). Make a join with Borrower table, and
generate a layout for it.
We only want to select the amount of loan, so select only it.

If you finished wizards, and run your form, you get similar result:
Step IV. – List Of Values, and PL/SQL
In this step, we make a Button, which open a new window, with the available Branchname, and City
pair, where we can choose the right value pair.
Now, you can create a form like this:
(join: Customer.cname=Borrower.cname and Borrower.lnumber=Loan.lnumber)

Create a display item:

Set their properties, with Property Palette. The important properties for us:
– Database Section, Database Item: No
– General Section, Name: BNAME

Please click LOVs on Object Navigator, and start LOV Wizard (Tools->LOV Wizard)

You need a “New Record Group based on a query”, so choose that.


Now get a textbox, where you can write query, which result's a list of values :). We want to generate
the all branch name, so we select branc_name and branch_city from branch table. It will be in the
pop up window:

(Note: Try to use the funny SQL builder, where you can clickclickclick a new query. :) )
We need all Columns, so select their.

Please click on Branch_name's return value, and press “Look up return item...”. Now you can
assign the BNAME for Branch_name.

Select for BRANCH_CITY: CUSTOMER.BNAME (this is our new display item...). After it, press
Next.

Now you can add a title name for LOV, after it, press Next.
Retrieve 20 items, or more...

We need to assign branch_name.


This is the end of wizard. You will come to the Object Navigator window. Now, right click on your
LOV, and select Property Palette from popup menu. Set name: BRANCH_LOV.
On Record Groups, select your new LOV, and set name BRANCH_REC, with Property Palette.
Now you need assign the Branch_name is data assign, so please set their “Validate from List”: Yes

You need to create a new button, for update. Set their name with Property Palette: BRANCH_BUT

Now we write a function for this button. Select the button, click with right mouse button, and select
the PL/SQL Editor. It will be open a list of triggers. Select “WHEN-BUTTON-PRESSED”.

Now get a PL/SQL editor, where you can write the button press trigger. We want to show our LOV.
Please copy this simple PL/SQL code:

DECLARE v_value BOOLEAN;


BEGIN
v_value:=Show_lov('branch_lov');
END;

You can test the code, if you press the Compile button (blue arrow). Close the Window, and now,
you can run your form, with new functionality.

You might also like