Lab-8 Oracle Developer 9i (Forms Basics)

Click to download
Lab-8 Oracle Developer 9i (Forms Basics) A- Creating a Simple Form: 1- You have to start OC4J Instance before running the Forms Builder. Start Programs Oracle 9i Developer Suite OraHome92d Forms Developer OC4J Instance 2- Start the Forms Builder from Start Programs Oracle 9i Developer Suite OraHome92d Forms Developer Forms Builder (The above screen is the object navigator.) 3- Go to File Connect scott/tiger is the user name db9i is the global database name, this name is different from one machine to another. 4- Press on the Data Block,and then choose Create (the + green sign) Prepared By: Aws Yousif Al-Taie Computer Science & Engineering Department 1 5- Choose create a form using the wizard 6- Choose the next button 7- Choose Table or View then press next Prepared By: Aws Yousif Al-Taie Computer Science & Engineering Department 2 8- Press the Browse Button to select one of the tables. 9- Select the items from the DEPT table, then press next Prepared By: Aws Yousif Al-Taie Computer Science & Engineering Department 3 10- Give a name for the Data Block, then press next. 11- You have finished describing the Data Block, now choose the first option and then press finish to go to the layout wizard. Prepared By: Aws Yousif Al-Taie Computer Science & Engineering Department 4 12- Choose next. 13- Choose the Canvas, which will contain the Data Block, then press next 14- Select the items, then press next or each item, then press next Prepared By: Aws Yousif Al-Taie Computer Science & Engineering Department 5 15- We can specify the Width and Height 16- Specify the Layout, and then press next 17- Specify the Frame title, number of records to display, and the width between each record, press next. Prepared By: Aws Yousif Al-Taie Computer Science & Engineering Department 6 18- Press Finish We will get the following layout editor. 19- Save the form in your Hard Disk, the extension for the file will be fmb • • • • Don’t save your file in path with spaces like (My Documents) Before you run the form, Go to the Edit Menu Choose Preferences Choose the Run Time tab Press the set Default and Browse the Internet Explorer Folder and then select the following executable file IEXPLORE.EXE, which is your browser You perform these steps only once. 7 Prepared By: Aws Yousif Al-Taie Computer Science & Engineering Department 20- Press Run Form This will generate a file with a fmx extension. The Form will run on your browser as a Java Applet Press Execute query to view your data in the Dept Table. Prepared By: Aws Yousif Al-Taie Computer Science & Engineering Department 8 We can go to the next record and previous record by using the arrows We can Insert/Delete a Record by using +/x sign We have to save the record after it has been inserted or deleted We can shift between the Object Navigator and the layout editor from the window menu Creating a Master-Detail Form Prepared By: Aws Yousif Al-Taie Computer Science & Engineering Department 9 B- Creating a Master-Detail Form: The Master-Detail Form is based on two related tables; we will use DEPT and EMP tables, which are related by DEPTNO field. 1- Create a canvas with any name 2- Create the Master Form, which is based on the DEPT Data Block 3- Create the Detail Form, which is based on the EMP Data Block on the same canvas, while creating the emp data block we will get the following screen to create the relation between the two Data Blocks Prepared By: Aws Yousif Al-Taie Computer Science & Engineering Department 10 4- Press on Create Relationship 5- We will get the following screen, that will specify the Foreign Key, then press ok Prepared By: Aws Yousif Al-Taie Computer Science & Engineering Department 11 6- We will get a screen to specify the relationship condition. which is EMP.DEPTNO=DEPT.DEPTNO 7- Give a name for the data block, call it EMP, then press next Prepared By: Aws Yousif Al-Taie Computer Science & Engineering Department 12 8- Put the EMP Data Block on the same canvas 9- Choose the form style as Tabular Prepared By: Aws Yousif Al-Taie Computer Science & Engineering Department 13 10- Specify the following information, for name, number of records, width within each record, and the scrollbar. 11- We will get the following Layout Editor. Master Form Detail Form Prepared By: Aws Yousif Al-Taie Computer Science & Engineering Department 14 12- We will get two data blocks as shown below: 13- As you see from the above snap shot, the EMP Data Block is before the DEPT Data Block, we need to drag the DEPT above the EMP, because it’s the main Block. Prepared By: Aws Yousif Al-Taie Computer Science & Engineering Department 15 14- Run the Form and press Execute Query. Prepared By: Aws Yousif Al-Taie Computer Science & Engineering Department 16

Related docs
Other docs by Sarahsinthekin...