Forms: Oracle Forms is a software product for creating screens that interact with an Oracle database. It has an IDE including an object navigator, property sheet and code editor that uses PL/SQL. It was originally developed to run server-side in character mode terminal sessions. It was ported to other platforms, including Windows, to function in a client–server environment. Later versions were ported to Java where it runs in a Java EE container and can integrate with Java and web services.
The primary focus of Forms is to create data entry systems that access an Oracle database.
- Native frontend tool of Oracle.
- Supports PL/SQL coding.
- Supports communication with database.
- Supports all database objects of SQL and PL/SQL ( Tables, Views, Synonym, Sequence, Triggers, Sub programs)
- Supports to view and define database objects from forms environment.
- Supports to share properties of controls using visual attributes and property classes.
- Supports OOPS features.
- Supports to share application with multiple users and multiple platforms.
Developer 10g suite
It consists of three components
Used to develop user friendly application screens for data manipulations and retrieval purpose.
Used to represent information for read only purpose in a user friendly format.
Used to represent the information in char formar with X and Y co-ordinates.
Supports to manipulate data or retrieve data available in RDBMS.
Interfaces in forms
- Object Navigator ( F3 )
Allows to create components and navigate between other screens of forms.
- Layout Editor ( F2 )
Used to design application screens. Supports to create controls ( GUI Controls).
- Property pallete ( F4 )
Used to assign properties for controls.
- PL/SQL Editor ( F11 )
Used to provide code for procedures, functions, packages, triggers.
- Menu Editor
Used to design menus.
Used to make components like blocks, canvas, charts, LOV.
There are two important forms components.
Represents collection of controls (items).
There are two types of blocks
- Base table block
- Control block
Base table block:
Block created based on table, view or synonym or stored procedure.
Block created without any table. It will not represent any table.
Control blocks are created manually.
Used to hold block items. It is a container which can hold more than one block on it.
Canvas can be created through layout wizard or manually.
- The default type of canvas is content canvas.
- Default type of item is text item.
- Text item: It is an editable control, used to represent column of a table.
- At least one content or tab canvas must be there to run the application.
- At least one editable item must be available to run the application.
- Whenever base table block is created in a form, it automatically frames an internal insert, update, delete and select statements.
Shortcut keys :
|ctrl + s||save the FMB file|
|ctrl + t||compiles the FMB file and gives FMX file|
|ctrl + r||Runs FMX file ( Gives the final output )|
|F8||Execute the query ( used to retrieve the data from table|
Data block wizard — Used for creating datablock.
Layout wizard — used for creating Canvas.
LOV wizard — used for creating list of values
Chart wizard — used for creating chart.
Report wizard — used for creating wizard.
Create your first form using wizard
Form Builder Tool
Open the “Form Builder” tool.
You will get the ‘Welcome to the Form Builder’ window.
Use the data Block Wizard, ( Tools Data block wizard )
You will get ‘welcome to the the data block wizard’
Next table or view Enter the table name EMP
Refresh provide connection details ( user name , password and host string )
Move all the columns from available columns to database items
Data block name ( let it be same as table name ) create data block then call layout wizard
We are done with datablock wizard , You will get ‘welcome to layout wizard’
Canvas – ( new canvas ) Type – content
Next Move all items from available items to displayed items Next Next Select form
Frame tile – Emp Details Next Finish
We are done with layout wizard
Go to File – Save As – Create new folder in desktop with the name MY_FORMS
Save the file with the name EMP_FORM.fmb
Important is to observe the object navigator ( Press F3 )
You can see under forms your form name i.e. EMP_FORM
Under form, data block is created i.e. EMP ( Data block refers to table )
Under data block, i.e. you find Item ( Item refers to columns in the table )
Under canvases, you can see a canvas
Under Canvas, you can see the frame
Understand hierarchy. It is simple.
Now, Compile the form.
In the Menu, Go to Program – Compile Module ( Ctrl + T )
In your desktop, in your folder MY_FORMS , Observe .fmx file is generated.
When we compile fmb file, fmx file is generated.
To run the form, start the listener / Start OC4J listener
Now, Run the form
Click on Run Form Icon.
It will prompt to install Jinitiator, Install it.
Your Form is opened in the browser.
Now, Enter values in few fields like empno, ename ,sal , deptno, click on save.
You get a message, Transaction complete: 1 record applied and saved.
Now check your EMP table in the database, you can see the new row is inserted.
To look at all the rows in the emp table, click on execute query
To look at the next row click on next record.
To look at previous row click on previous record button.
To change the salary of ALLEN from 1600 to 2000.
Go to ALLEN record, change the value of sal field to 2000.
Click on save button.
To delete the row of empno 111, traverse the record, click on delete button and save.