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.
What is Form Builder?Form Builder is a powerful development tool for building robust, enterprise-class applications thatenable end users to retrieve, enter, modify, and save information in the database.
1. Object Navigator – [F3]2. Property Palette [F4]3. Layout Editor (or Layout Model) [F2]4. PL/SQL Editor [F11]Types of BlocksIn Form Builder there are two main types of blocks:1. data blocks and2. control blocks.1. DATA BLOCKS • A data block is associated with a specific database table (or view), a stored procedure, a FROM clause query, or transactional triggers. • If it is based on a table (or view), the data block can be based on only one base table2. Control Blocks • A control block is not associated with a database, and its items do not relate to any columns within any database table. • Its items are called control items.What Is a Window?A window is a container for all visual objects that make up a Form Builder application.It is similar to an empty picture frame.What Is a Canvas?A canvas is a surface inside a window container on which you place visual objectssuch as interface items and graphics.What Is a Content Canvas?A content canvas is the base canvasthat occupies the entire content pane of the window in which it displays. The contentcanvas is the default canvas type.Form Builder provides three other types of canvaseswhich are:• Stacked canvas• Toolbar canvas• Tab canvasWhen you create a canvas, you specify its type by setting the Canvas Type property.
The type determines how the canvas is displayed in the window to which it isassigned.What Is a Stacked Canvas?A stacked canvas is displayed on top of, or stacked on, the content canvas assigned toa window.What Is a Toolbar Canvas?A toolbar canvas is a special type of canvas that you can create to hold buttons andother frequently used GUI elements.The Three Toolbar Types• Vertical toolbar: Use a vertical toolbar to position all your tool itemsdown the left or right hand side of your window.• Horizontal toolbar: Use a horizontal toolbar to position all your toolitems and controls across the top or bottom of your window.• MDI toolbar: Use an MDI toolbar to avoid creating more than onetoolbar for a Form Builder application that uses multiple windows.What Is a Tab Canvas?A tab canvas is a special type of canvas that enables you to organize and displayrelated information on separate tabs.
TO DESIGN FORM MODULE USING WIZARD1. OPEN FORM MODULE2. SELECT WIZARD OPTION AND CLICK ON OK3. CLICK ON NEXT->NEXT4. TYPE THE TABLE NAME AND CLICK ON REFRESH BUTTON5. ENTER USER NAME: SCOTT/TIGER@VIS6.
7. NOW MOVE THE REQUIRED COLUNMS TO DATABASE ITEMS8. CLICK ON FINISH9. TO PLACE DATABLOCK ITEMS ON CANVAS10.11. CLICK ON NEXT->NEXT BUTTON12. MOVE THE REQUIRED ITEMS TO BE PLACED ON CANVAS
13. CLICK ON NEXT->NEXT BUTTON14. ENTER FRAME TITLE15 CLICK FINISH BUTTON
T_EMPNO “POST_TEXT_ITEM”SELECT ENAME,JOB,SAL,DEPTNO INTO :T_ENAME,:T_JOB,:T_SAL,:T_DEPTNO FROM EMPWHERE EMPNO=:T_EMPNO;
DESIGN FORM AS FOLLOWSADD CODEDECLARE N NUMBER;BEGIN SELECT MAX(EMPNO) INTO N FROM EMP;IF N IS NULL THEN :T_EMPNO:=1001;ELSE:T_EMPNO:=N+1;END IF;END;SAVE CODEINSERT INTO EMP(EMPNO,ENAME,JOB,SAL,DEPTNO)VALUES(:T_EMPNO,:T_ENAME,:T_JOB,:T_SAL,:T_DEPTNO);COMMIT;CLEAR_FORM;
MODIFYUPDATE EMP SET ENAME=:T_ENAME,JOB=:T_JOB,SAL=:T_SAL,DEPTNO=:T_DEPTNO WHEREEMPNO=:T_EMPNO;COMMIT;CLEAR_FORM;DELETEDELETE FROM EMP WHERE EMPNO=:T_EMPNO;COMMIT;CLEAR_FORM;FINDIF :T_EMPNO IS NULL THEN :T_EMPNO:=7654;ELSE SELECT ENAME,JOB,SAL,DEPTNO INTO :T_ENAME,:T_JOB,:T_SAL,:T_DEPTNO FROMEMP WHERE EMPNO=:T_EMPNO;END IF;CLEARCLEAR_FORM;EXITEXIT_FORM;T_JOB “POST_TEXT_ITEM”if :T_JOB=CLERK THEN :T_SAL:=1200;ELSif :T_JOB=MANAGER THEN :T_SAL:=2200;ELSE :T_SAL:=3200;END IF;
LOV - FOR FINDING RECORDS CREATE AN LOV - CALLING LOV WHEN YOU CLICK ON FIND BUTTONDECLARE N BOOLEAN;BEGIN N:=SHOW_LOV(LOV11);END;
ALERTSCREATE AN ALERT TO CALL WHEN EVER YOU TRY TO EXIT FROM FORM - IN EXIT BUTTON WRITE FOLLOWING CODEDECLARE N NUMBER;BEGIN N:=SHOW_ALERT(ALERT28); IF N=ALERT_BUTTON1 THEN EXIT_FORM; ELSE GO_BLOCK(BLOCK3); END IF;END;
WORKING WITH PROGRAM UNITSCREATE A PROCEDURE TO CALL WHEN YOU CLICK ON EXIT BUTTONNOW WRITE FOLLOWING CODEPROCEDURE CLOSEFORM IS N NUMBER;BEGIN N:=SHOW_ALERT(ALERT28); IF N=ALERT_BUTTON1 THEN EXIT_FORM; ELSE GO_BLOCK(BLOCK3); END IF;END; - NOW CALL THE PROCEDURE IN “EXIT BUTTON” CLOSEFORM;