ORACLE FORMS 6I • Enterprise application developers need a declarative model-based approach.

Oracle Designer and Oracle Forms Developer provide this solution, using Oracle Forms Services as the primary deployment option.

What Is Oracle Forms Developer? • A productive development environment for Internet business applications  Data entry  Query screens It provides a set of tools that enable business developers to easily and quickly construct  sophisticated database forms and  business logic with a minimum of effort.

Oracle Forms Services?  Oracle Forms Services is a component of Oracle9i Application Server for delivering Oracle Forms Developer applications to the Internet. Oracle Forms Services uses a three-tier architecture to deploy database applications: 1. The client tier contains the Web browser, where the application is displayed and used. 2. The middle tier is the application server, where the application logic and server software reside. 3. The database tier is the database server, where enterprise data is stored.

• Find field and icons. 4. and packages in Oracle Forms Developer as well as the database • Development of libraries to hold PL/SQL program units • Statement-level debugging of PL/SQL at run time . size. When you use the Tool Palette and the Toolbar available in the Layout Editor.Form Builder Components 1. including the module itself. enabling forward and backward searches for any level of node or for an individual item in a node. 2. similar to Object Navigator 3. Layout Editor (or Layout Model) The Layout Editor is a graphical design facility for creating and arranging interface items and graphical objects in your application. It provides: • Development of triggers. Property Palette All objects in a module. Features include: • Copy and reuse properties from another object • Find field and icons. have properties that you can see and modify in the Property Palette. you can design the style. PL/SQL Editor The PL/SQL Editor is the integrated functionality of Oracle Procedure Builder that exists within the Form Builder. • An icon next to each object to indicate the object type. functions. and arrangement of visual objects in the application. Features include: • A hierarchy represented by indentation and expandable nodes. • Icons in the vertical toolbar replicating common File menu functions. Object Navigator The Object Navigator is a hierarchical browsing and editing interface that enables you to locate and manipulate application objects quickly and easily. procedures. color.

and its items do not relate to any columns within any database table. Its items are called control items. If it is based on a table (or view). What Is a Content Canvas? A content canvas is the base canvas that occupies the entire content pane of the window in which it displays.Types of Blocks In Form Builder there are two main types of blocks: 1. DATA BLOCKS • • A data block is associated with a specific database table (or view). or transactional triggers. 1. . Control Blocks • • A control block is not associated with a database. The content canvas is the default canvas type. you specify its type by setting the Canvas Type property. It is similar to an empty picture frame. The type determines how the canvas is displayed in the window to which it is assigned. Form Builder provides three other types of canvases which are: • Stacked canvas • Toolbar canvas • Tab canvas When you create a canvas. the data block can be based on only one base table 2. What Is a Window? A window is a container for all visual objects that make up a Form Builder application. a stored procedure. What Is a Canvas? A canvas is a surface inside a window container on which you place visual objects such as interface items and graphics. control blocks. a FROM clause query. data blocks and 2.

What Is a Tab Canvas? A tab canvas is a special type of canvas that enables you to organize and display related information on separate tabs. . The Three Toolbar Types • Vertical toolbar: Use a vertical toolbar to position all your tool items down the left or right hand side of your window. • Horizontal toolbar: Use a horizontal toolbar to position all your tool items and controls across the top or bottom of your window. • MDI toolbar: Use an MDI toolbar to avoid creating more than one toolbar for a Form Builder application that uses multiple windows.What Is a Stacked Canvas? A stacked canvas is displayed on top of. or stacked on. What Is a Toolbar Canvas? A toolbar canvas is a special type of canvas that you can create to hold buttons and other frequently used GUI elements. the content canvas assigned to a window.

The trigger belongs to a block and can only fire when this block is the current block 3.The trigger belongs to the form and can fire due to events across the entire form 2. There are three possible levels: 1. Block level .The body of PL/SQL that defines the actions of the trigger 3. Item level . Trigger scope . These triggers are mostly fired by events within a form module Trigger Components There are three main components to consider when you design a trigger in Form Builder: Component Description 1. Trigger code . that is. Form level .The trigger belongs to an individual item and can only fire when this item is the current item .What Is a Trigger? A trigger is a program unit that is executed (fired) due to an event. events include the following: • Query-related events • Data entry and validation • Logical navigation or physical mouse movement • Operator interaction with items in the form • Internal events in the form • Errors and messages Trigger Characteristics You write Form Builder triggers in PL/SQL. You can use triggers to add or modify form functionality in a procedural way Every trigger that you define is associated with a specific event. the type of object under which you create the trigger.Defines the specific event that will cause the trigger to fire 2.The level in a form module at which the trigger is defined— determining the scope of events that will be detected by the trigger Trigger Scope The scope of a trigger is determined by its position in the form object hierarchy. Trigger type .

and can exist outside the scope of a PL/SQL block. Using Variables in Form Builder In triggers and subprograms. PL/SQL variables: These must be declared in a DECLARE section. If declared in a PL/SQL package. They are not prefixed by a colon. KeyFires in place of the standard action of a function key 2.Trigger Type The trigger type determines which type of event fires it. Using Smart Triggers Smart Triggers item expands to a list of common triggers that are appropriate for the selected object.PostFires just after an action (for example. and remain available until the end of the declaring block. each identified by a specific name. There are more than 100 builtin triggers. Form Builder generally accepts two types of variables for storing values: 1. before a query is executed) 4. Write this code as an anonymous PL/SQL block by using the PL/SQL Editor. These are seen by PL/SQL as external variables. Trigger Prefix Description 1. and require a colon (:) prefix to distinguish them from PL/SQL objects (except when their name is passed as a character string to a subprogram). a variable is accessible across all triggers that access this package. Form Builder variables are not formally declared in a DECLARE section. after a query is executed) 5. Form Builder variables: Variable types maintained by the Form Builder.WhenFires in addition to standard processing (used to augment functionality) Trigger Code The code of the trigger defines the actions for the trigger to perform when it fires. . OnFires in place of standard processing (used to replace or bypass a process) 3. PreFires on an event that occurs just before an action (for example. 2.

Global variable Scope: All modules in current session Use: Session-wide storage of character data 3. list. check box.Form Builder Variables The following variables are available for the storage and manipulation of values: Form Builder Variable Type Description 1. System variable Scope: Current form and attached menu Use: Form status and control 4. Item (text. and so on) Scope: Current form and attached menu Use: Presentation and interaction with user 2. Parameter Scope: Current module Use: Passing values in and out of module .

FIRST: GO_BLOCK('EMP'). PREVIOUS_RECORD.DESIGN FORM AS FOLLOWS EXECUTE CODE: GO_BLOCK('EMP'). NEXT: GO_BLOCK('EMP'). FIRST_RECORD. EXIT: EXIT_FORM. . PREVIOUS GO_BLOCK('EMP'). NEXT_RECORD. LAST_RECORD. LAST : GO_BLOCK('EMP'). EXECUTE_QUERY.

JOB.DEPTNO INTO :T_ENAME.:T_JOB. .:T_DEPTNO FROM EMP WHERE EMPNO=:T_EMPNO.:T_SAL.T_EMPNO “POST_TEXT_ITEM” SELECT ENAME.SAL.

JOB. END. COMMIT. SAVE CODE INSERT INTO EMP(EMPNO. IF N IS NULL THEN :T_EMPNO:=1001.DEPTNO) VALUES(:T_EMPNO.:T_JOB. END IF. CLEAR_FORM.:T_ENAME.:T_SAL.SAL. .DESIGN FORM AS FOLLOWS ADD CODE DECLARE N NUMBER. ELSE :T_EMPNO:=N+1. BEGIN SELECT MAX(EMPNO) INTO N FROM EMP.:T_DEPTNO).ENAME.

EXIT EXIT_FORM.DEPTNO INTO :T_ENAME. COMMIT. CLEAR CLEAR_FORM.:T_DEPTNO FROM EMP WHERE EMPNO=:T_EMPNO.:T_JOB. DELETE DELETE FROM EMP WHERE EMPNO=:T_EMPNO. END IF. CLEAR_FORM. . CLEAR_FORM. COMMIT.DEPTNO=:T_DEPTNO WHERE EMPNO=:T_EMPNO.JOB=:T_JOB.SAL. END IF. FIND IF :T_EMPNO IS NULL THEN :T_EMPNO:=7654. ELSif :T_JOB='MANAGER' THEN :T_SAL:=2200.:T_SAL.MODIFY UPDATE EMP SET ENAME=:T_ENAME.SAL=:T_SAL. ELSE SELECT ENAME. T_JOB “POST_TEXT_ITEM” if :T_JOB='CLERK' THEN :T_SAL:=1200. ELSE :T_SAL:=3200.JOB.

LOV FOR FINDING RECORDS CREATE AN LOV - CALLING LOV WHEN YOU CLICK ON FIND BUTTON DECLARE N BOOLEAN. . END. BEGIN N:=SHOW_LOV('LOV11').

ALERTS CREATE AN ALERT TO CALL WHEN EVER YOU TRY TO EXIT FROM FORM - IN EXIT BUTTON WRITE FOLLOWING CODE DECLARE N NUMBER. END IF. END. . BEGIN N:=SHOW_ALERT('ALERT28'). ELSE GO_BLOCK('BLOCK3'). IF N=ALERT_BUTTON1 THEN EXIT_FORM.

. END. IF N=ALERT_BUTTON1 THEN EXIT_FORM. BEGIN N:=SHOW_ALERT('ALERT28'). END IF. ELSE GO_BLOCK('BLOCK3'). NOW CALL THE PROCEDURE IN “EXIT BUTTON” CLOSEFORM.WORKING WITH PROGRAM UNITS CREATE A PROCEDURE TO CALL WHEN YOU CLICK ON EXIT BUTTON NOW WRITE FOLLOWING CODE PROCEDURE CLOSEFORM IS N NUMBER.

WORKING WITH MENUS DESIGN FOLLOWING FORM NOW CREATE MENU OPEN MENU AND DESIGN MENU AS FOLLOWS - WRITE THE CODE FOR THE MENU ITEMS EXECUTE CODE: GO_BLOCK('EMP'). EXECUTE_QUERY. .

NOW CLOSE MENU AND SAVE THE MENU IN C:\MYMENU NOW COMPILE MENU [CTRL+T] NOW SET EMP MODULE PROPERTY AS - NOW RUN THE FORM YOU CAN SEE YOUR MYMENU WILL DISPLAY . NEXT_RECORD. NEXT: GO_BLOCK('EMP'). - FIRST: GO_BLOCK('EMP').LAST : GO_BLOCK('EMP'). LAST_RECORD. EXIT: EXIT_FORM. FIRST_RECORD. PREVIOUS_RECORD. PREVIOUS GO_BLOCK('EMP').

Sign up to vote on this title
UsefulNot useful