Download - Oracle Developer 11g
![Page 1: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/1.jpg)
Software Engineering Lab
Oracle Developer 11g
Part 1
![Page 2: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/2.jpg)
2
Oracle Developer
The aim is to introduce the concepts andtechniques of forms, and to learn how tobuild single and multiple form applications,using database and graphical userinterface (GUI) features
![Page 3: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/3.jpg)
3
Form Module
There are many types of objects thatyou can create in a form module:
Item
Block
Canvas
Trigger
Other Objects ( i.e. Alerts)
![Page 4: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/4.jpg)
4
Form Objects1- Item
Object to represent data values to theuser or let the user interact with theform
Member of a block
Items are logically grouped into blocks
Items are visibly arranged on canvas
![Page 5: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/5.jpg)
5
Form Objects2- Block
Logical owner of items. Owned bythe form module
There is no practical limit to thenumber of blocks that can bedefined
![Page 6: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/6.jpg)
6
Block Types
Block Types: Data blocks and control blocks
Data block:
Data block is associated with data (tablecolumns) within a database
By default, the association between a data block
and the database allows operators to automatically
query, update, insert, and delete rows within a
database
Data blocks can be based on database tables,
views, procedures, or transactional triggers
![Page 7: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/7.jpg)
7
Block Types (cont.)
Control block:
Control block is not associated with the database
Items in a control block do not relate to tablecolumns within a database
![Page 8: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/8.jpg)
8
Form Objects3- Canvas (page)
The surface where visual objects arearranged
Content Canvas: Specifies that the canvas should occupy the entire
content area of the window to which it is assigned.
Most canvases are content canvases
![Page 9: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/9.jpg)
9
Form Objects4- Triggers
A program unit (a PL/SQL block) that is executed due to an event
![Page 10: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/10.jpg)
10
Form Minimum Requirements
1 Canvas
1 Block
1 Item
![Page 11: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/11.jpg)
Oracle Forms Builder
11
![Page 12: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/12.jpg)
12
Layout Editor
Graphical design facility for creatingand arranging interface items in aform
F2 Layout editor
F3 object Navigator
![Page 13: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/13.jpg)
13
Lab Practice: Creating Form
![Page 14: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/14.jpg)
14
Lab Practice: Data Block
We will create a form which contains one database blockassociated with EMP table.
Database block Creation:
Click the object navigator entry block
(you should use the wizard for creating the data block)
OR
Click the create icon in the object navigator
![Page 15: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/15.jpg)
Data Block Wizard
15
![Page 16: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/16.jpg)
Data Block Wizard (cont.)
16
![Page 17: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/17.jpg)
Data Block Wizard (cont.)
17
![Page 18: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/18.jpg)
Data Block Wizard (cont.)
18
![Page 19: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/19.jpg)
Data Block Wizard (cont.)
19
![Page 20: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/20.jpg)
Data Block Wizard (cont.)
20
![Page 21: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/21.jpg)
Data Block Wizard (cont.)
21
![Page 22: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/22.jpg)
Data Block Creation: Layout Wizard
22
![Page 23: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/23.jpg)
Data Block Creation: Layout Wizard
23
![Page 24: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/24.jpg)
Data Block Creation: Layout Wizard
24
![Page 25: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/25.jpg)
Data Block Creation: Layout Wizard
25
![Page 26: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/26.jpg)
Data Block Creation: Layout Wizard
26
![Page 27: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/27.jpg)
Data Block Creation: Layout Wizard
27
![Page 28: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/28.jpg)
28
Before running the form
For the Form to run; Oracle HTTP Server listener receives therequest when web browser starts. Oracle HTTP Server listenerforwards the request to the Oracle WebLogic Server OracleDeveloper. So there must be a weblogic server started.
Write in the windows search box:
Start Web Logic Admin Server
Once the weblogic server is running, you can minimize it andcontinue working (design/ run) in the form builder.
When you are finished, and the weblogic server is no longerneeded, you may stop it
Write in the windows search box:
Stop Web Logic Admin Server
![Page 29: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/29.jpg)
Username:weblogic and Password: Administrator1
Note that the password is INVISIBLE, so it is better to write itin a notepad and copy it then paste in the web logic window
29
![Page 30: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/30.jpg)
30
![Page 31: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/31.jpg)
Running the form
31
![Page 32: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/32.jpg)
Running the form for the first time
32
![Page 33: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/33.jpg)
33
Running the form for the first time
![Page 34: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/34.jpg)
34
Lab Practice: Running Form
Run your form from the toolbar, click on Run
Insert new, update, and delete employees
Retrieving data (unrestricted query)
=> press Execute Query
![Page 35: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/35.jpg)
Select all employees
35
![Page 36: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/36.jpg)
Select all employees
36
Use navigation keys (those blue arrows) to display next or previous record
![Page 37: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/37.jpg)
37
Lab Practice: filter data based on condition (restricted query)
Retrieving data (restricted query)
you can use matching values, matching patterns(wildcards)
1. Select from Menu => Query =>Enter
OR press icon enter query from form menu
2. Enter your query
ex: enter 10 in the deptno text box
3. Press Execute Query
Data of employees working in dept 10 only isdisplayed
![Page 38: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/38.jpg)
Insert Record
38
![Page 39: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/39.jpg)
Insert Record
39
![Page 40: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/40.jpg)
Delete record
40
![Page 41: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/41.jpg)
Delete Record
41After the record is deleted, it automatically displays next record on the form
![Page 42: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/42.jpg)
42
Lab Practice: Buttons
Draw a button from the toolbox and open itsproperty palette by:
Double-click the object icon OR
Select the button then press F4 OR
Right click then choose property palette
Label property: label that appears on thebutton at runtime
Tool tip property: short help text thatdisplays info about item when you navigate toit with the mouse
![Page 43: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/43.jpg)
Lab Practice: Buttons
43
Press F2 to go to the Layout Editor
Double Click on the button to open the property pallet
![Page 44: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/44.jpg)
44
Lab Practice: Triggers
Item level:
A Trigger fires when this item is the current item
In the layout editor, create a button, right click, and choose
Smart Triggers => ‘When_button_pressed’
Edit PL/SQL:
1- Next_record; 2- Previous_record;
3- First_record; 4- Last_record;
5- Commit;
Compile and close
![Page 45: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/45.jpg)
Lab Practice: Triggers
45
![Page 46: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/46.jpg)
Before we start
You need to connect to SQL Developer with user name:
scott and password: tiger then write these SQL
statements in :
Alter table emp
add ( skills char(3), gender char(1));
Update emp set skills = 'yes' , gender='M'
where empno between 7300 and 7839;
Update emp set skills = 'no' , gender='F'
where empno between 7844 and 8000;
Commit;
46User scott already contains tables emp and dept similar to employees and departments of user hr
![Page 47: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/47.jpg)
Create New form based on Emp table
47
![Page 48: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/48.jpg)
48
Lab Practice: Check Box
In the layout editor, select the skills item, enterproperty palette:
Change item type into Check Box
Set value when checked => yes
and value when unchecked => no
Set check box mapping of other values:
this determines how data values other thanspecified are processed, not allowed propertymakes the form ignore the entire record duringthe query processing
Set initial value => yes
![Page 49: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/49.jpg)
Lab Practice: Check Box
49
![Page 50: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/50.jpg)
Lab Practice: Check Box
Form layout (design)
Form Run
50
![Page 51: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/51.jpg)
51
Lab Practice: Radio Group
A radio group is a set of radio buttons, eachrepresents a different value. These values aremutually exclusive
In the layout editor, select the gender item, enterproperty palette
Change item type property into radio group. Itdisappears from layout editor
In the object navigator, expand the gender node =>radio buttons node => click the create icon, andcreate two radio buttons
Enter the property palette of the radio buttons:
Change label into Female, radio button value => F
Change label into Male, radio button value => M
![Page 52: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/52.jpg)
52
Lab Practice: Radio Group (cont.)
In layout editor, radio buttons are placed on thetop left corner above each other. Drag them, adda frame
Enter the property palette of the radio group, thatis, the gender item itself.
Set initial value => F
Leaving the radio group’s mapping of othervalues property blank makes the form ignore theentire row during query processing. Associate itwith one of the existing radio buttons by writing M
![Page 53: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/53.jpg)
Lab Practice: Radio Group
1. Double click on the Gender Item
2. Change item type property
3. Press F3 then Add two radio buttons
53
![Page 54: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/54.jpg)
Lab Practice: Radio Group
4. Open the property pallet of the first radio button and change the following
5. Do the same for FEMALE the second radio button
54
![Page 55: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/55.jpg)
Lab Practice: Radio Group
6- Press F2 then you will find both radio buttons above each other
55
![Page 56: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/56.jpg)
Lab Practice: Radio Group
56
![Page 57: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/57.jpg)
Lab Practice: Radio Group
7. Open the property pallet of the Gender item
Initial Value: M
Mapping of other Values: M
57
![Page 58: Oracle Developer 11g](https://reader030.vdocument.in/reader030/viewer/2022012410/616a617711a7b741a351de64/html5/thumbnails/58.jpg)
58
Thank You