O racle ®
INTERACTIVE WORKBOOK
Trang 2BOOKS IN THIS SERIES
• Baman Motivala
“Oracle Forms Interactive Workbook”
0-13-015808-9
• Benjamin Rosenzweig & Elena Silvestrova
“Oracle PL/SQL”
0-13-015743-0
• Alex Morrison & Alice Rischert
“Oracle SQL Interactive Workbook”
0-13-015745-7
Trang 3B AMAN M OTIVALA
Prentice Hall PTR Upper Saddle River, New Jersey 07458
www.phptr.com
INTERACTIVE WORKBOOK
O racle ®
F orms
O racle ®
F orms
®
Trang 4Introduction xi Acknowledgments xvii About the Author xix Chapter 1 Concepts and Objects 1
LAB 1.1 Oracle Forms Concepts 2
1.1.1 Explain How Oracle Forms Works 4 LAB 1.2 Mandatory Forms Objects 11
1.2.1 Identify Items and Their Types 17 1.2.2 Identify Canvases and Frames 18 1.2.3 Define Base-table Blocks 19 1.2.4 Understand Modules 20 1.2.5 Relate the Mandatory Forms Elements 20 CHAPTER 1 Test Your Thinking 30
Chapter 2 Wizards and Files 31
LAB 2.1 The Data Block and Layout Wizards 32
2.1.1 Use the Data Block and Layout Wizards 42 2.1.2 Reentering the Wizards 43 LAB 2.2 Oracle Forms Files 53
2.2.1 Differentiate Between Source and Executable Files 54 2.2.2 Compile Binary Files into Executable Files 55 2.2.3 Run Executable Files 57 CHAPTER 2 Test Your Thinking 63
Chapter 3 The Development Environment 65
LAB 3.1 The Object Navigator 66
3.1.1 Open and Identify Objects 68 3.1.2 Create and Delete objects 69 3.1.3 Drag & Drop and Cut & Paste Objects 70 3.1.4 Run and Save Forms 72 3.1.5 View Database Objects 72
vii
Trang 5LAB 3.2 The Property Palette 84
3.2.1 View Properties 86 3.2.2 Change Properties 86 LAB 3.3 The Layout Editor 93
3.3.1 Create and Format Objects 95 3.3.2 Arrange and Size Objects 97 CHAPTER 3 Test Your Thinking 105
Chapter 4 Master-Detail Forms 107
LAB 4.1 Master-Detail Forms 108
4.1.1 Create a Master-Detail Form 110 4.1.2 Work with Master-Detail Forms
and Relations 112 CHAPTER 4 Test Your Thinking 124
Chapter 5 Items 125
LAB 5.1 Text Items and Display Items 126
5.1.1 Create and Define Text Items Without the Wizard 127 5.1.2 Create and Define Display Items 131 LAB 5.2 Buttons, List Items, Radio Groups,
and Check Boxes 143 5.2.1 Create Buttons 147 5.2.2 Put Simple Code Behind Buttons 148 5.2.3 Create List Items 150 5.2.4 Create Radio Groups 153 5.2.5 Create Check Boxes 155 CHAPTER 5 Test Your Thinking 169
Chapter 6 Triggers & Built-ins 171
LAB 6.1 Trigger Basics 172
6.1.1 Use PL/SQL and SQL in Triggers 175 6.1.2 Understand Trigger Scope 176 6.1.3 Categorize Triggers 178 LAB 6.2 Creating Triggers of Various Types 187
6.2.1 Create Query Triggers 189 6.2.2 Create Validation Triggers 192 6.2.3 CreateTransactional Triggers 195 6.2.4 Create Key Triggers 197 LAB 6.3 Forms Built-ins 213
6.3.1 Use Forms Built-ins 216 CHAPTER 6 Test Your Thinking 223
viii Contents
Trang 6Query Array Sizeproperty, 140–41
QUERY_MASTER_DETAILtrigger, 26,
119–20
Query triggers, 175, 187–88
creating, 189–92
R
Radio Buttonnode, 163
Radio groups, 3, 22, 144–45, 163–65
creating, 153–55
radio buttons in, 165
Radio menu items, 423
Realcoordinate system, 49
Record Group Fetch Sizeproperty,
241
Record groups, and LOVs, 227–28
Record Historywindow, 331–32
Records page, Layout Wizard, 40–41
Relation object:
creation of, 109
and master block, 118
Relations, 25, 107
Report Builder, 404
Reports Runtime, 404, 409
Reusable code, 353–61
PL/SQL libraries, 362–73
program units, 354–61
stored PL/SQL objects, 374–78
Reusable objects, 313–52
subclassing, 80, 314–22
Subclass Informationdialog box,
332–33
subclass objects, 315–17
RUN_PRODUCTbuilt–in, 404, 405
running Oracle reports with, 406–7
RUN_REPORT_OBJECTbuilt–in, 404, 405–6
running Oracle reports with, 407–8
S
Sample schema, xv–xvi
SECONDCAN, 273
SECONDWIN, 273–74
Separators, 424
SET_ALERT_PROPERTYbuilt–in, 359
SET_ALERT_PROPTERYbuilt–in, 257
SET_BLOCK_PROPERTY, 218, 397
SET_built–ins, 214–15, 218–19
SET_CANVAS_PROPERTY, 218
SET_ITEM_PROPERTYbuilt–in, 89, 218
SET_VIEW_PROPERTYbuilt–in, 296
SET_WINDOW_PROPERTYbuilt–in, 218
SHOW_ALERTbuilt–in, 250, 257
Show Errorswindow, 202
SHOW_HISTtrigger, 273, 284
SHOW_LISTbutton, 245
SHOW_LOVbuilt–in, 245–46, 249
SHOW_VIEWbuilt–in, 267, 275, 296, 355
Size Objectswindow, 102 Software requirements, xiii–xiv Source page, LOV Wizard, 229, 236 SQL, using in triggers, 175–76 SQL query page, LOV Wizard, 229–30, 237 Stacked canvases, 287–97
creating/displaying, 289–92 defined, 287–88
INSTRUCTORstacked canvas, 293–94 viewport, 288
Stacked Canvastool, Tool Palette, 293 Stored PL/SQL objects, 374–78
calling, 374–75 moving between database and Forms application, 375
using, 375–77 Style page, Layout Wizard, 40
Subclass Informationproperty, 91,
318, 321, 344 Subclassing, 80, 314–22
Subclass Informationdialog box, 332–33
subclass objects, 315–17
Summary Functionproperty, 139
T TABLE_ITEM_PROMPT_ALIGNMENT, 26 Table page, 35–37
Data Block Wizard, 34–37
Text Colorbutton, 101–2 Text fields, 3
Text items, 3, 22, 126–27 creating/defining without the wizard, 127–30, 133–38
Enabledproperty, 134–35
Text Itemtool, 134 Toolbar canvases, 298–310 creating, 299–302
TOOLBARcanvas, 305–6, 314–15 using in another form, 302–3 Tool Palette, 99–100, 134, 147 Layout Editor, 95
Stacked Canvastool, 293 Transactional triggers, 175, 189 creating, 195–96
Triggers, 2–3, 9, 24–25, 172–212 and canvases, 25
categorizing, 173–75, 178–79
by function, 174–75
by name, 174 and events/items, 4 forms triggers, 9 key triggers, 174, 175, 189, 209–11 creating, 197–99
Onevent triggers, 174
Postevent triggers, 174
466 Index
Trang 7Preevent triggers, 174
query triggers, 175, 187–88
creating, 189–92
scope, 172–73, 176–77
transactional triggers, 175, 189
creating, 195–96
using PL/SQL and SQL in, 175–76
validation triggers, 175, 188–89
creating, 192–95
Whenevent triggers, 174
Type page, 34
Data Block Wizard, 34
U
Update Layoutproperty, 24, 98, 102–3
Use Securityproperty, 440
Utility toolbar, Layout editor, 94, 283
V
VAL_ALERTalert, 357
Validate Item event, 3
Validating an item, 3
Validation triggers, 175, 188–89
creating, 192–95
Value When Checkedproperty, 165–67
Value When Uncheckedproperty,
165–67
Viewmenu, Form Builder, 423–24
Viewport Heightproperty, 275
Viewports, 266–67
Viewport Widthproperty, 275
Visibleproperty, 133
Visual attributes, 323
behavior of, 330
creating/applying, 325–27
Visual Attribute Typeproperty,
330–31
Commonvalue, 330
Promptvalue, 331
Titlevalue, 331
W WHEN–BUTTON–PRESSEDtrigger, 7–8, 144,
158, 173, 181, 198, 209, 251, 254–55, 272–73, 280–81, 294, 354, 387
WHEN–CHECKBOX–CHANGEDtrigger, 9, 23, 167
WHEN–NEW–FORM–INSTANCEtrigger, 26,
55, 216, 220, 389
WHEN–VALIDATE–ITEMtriggers, 4, 47, 176–77, 179–83, 188–89, 193–94, 204–6,
353, 357–58, 360
WHEN–VALIDATE–RECORDtrigger, 206
WINDOW–CLOSEDtrigger, 3 Windows, 14, 262–69 content windows, 277–86 defined, 262
dialog windows, 262–64, 271 displaying, 265–66
document windows, 262–64, 270 modal windows, 263–64
Multiple Document Interface (MDI) window, 263, 272
styles of, 262 understanding, 267–69 Wizards, 32–52, 107, 288 Data Block Wizard, 32, 33–37, 42–43, 46–50
Layout Wizard, 32, 33, 37–42, 44–46,
48, 50–51 reentering, 43–45
Wrap Styleproperty, 135 Www.oracle.com, 59 Www.phptr.com/phptrinteractive, 4 WYSIWYG, 12–13
Index 467