Você está na página 1de 16

ORACLE

Color profile: Generic CMYK printer profile Series / Oracle Developer Advanced Forms & Reports / Brown / 2048-7 / Chapter 1
Composite Default screen
Blind Folio 1:v

Contents
FOREWORD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . XXI
ACKNOWLEDGMENTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . XXIII

PART I
Overview
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Why Don’t They Use Oracle Developer? . . . . . . . . . . . . . . . . . . . . . . . . 4
The Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
The Scope of the Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Web Coverage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
What Does this Book Cover? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Why Discuss Standards? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
The Version Number Game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Who Should Read this Book? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
How this Book Is Organized . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Where Do You Go from Here? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Strategies for Getting More Information . . . . . . . . . . . . . . . . . . . . 13
Oracle User Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
A Review of the Developer Forms Data Architecture . . . . . . . . . . . . . . . 14
Sample Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

Q:\Oracle8\048-7\fm.vp
Tuesday, October 12, 1999 2:58:57 PM
ORACLE
Color profile: Generic CMYK printer profile Series / Oracle Developer Advanced Forms & Reports / Brown / 2048-7 / Front Matter
Composite Default screen
Blind Folio FM:vi

vi Oracle Developer Advanced Forms & Reports

2 New Features in Oracle Developer Release 6 . . . . . . . . . . . . . . . . . . . . . . . . 19


What if You Are Skipping Release 2? . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Changes in Forms from Release 1 to Release 2 . . . . . . . . . . . . . . 20
Changes in Reports from Release 1 to Release 2 . . . . . . . . . . . . . 23
Developer 6 Support for Oracle8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Object Datatypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
PL/SQL 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Form Builder New Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Ease-of-Use Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Web Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Report Builder New Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Ease-of-Use Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Web Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

PART II
Basic Developer Standards
3 SQL and PL/SQL Standards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Why Coding Standards? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Readability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Enforcing the Standards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Top 10 Reasons to Not Use Code Standards . . . . . . . . . . . . . . . . 66
What Is the Answer? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
The Tool Helps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
General Coding Standards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Maximum Length of 30 Characters . . . . . . . . . . . . . . . . . . . . . . . 69
Three Spaces for Indenting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Uppercase for Keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Lowercase for User-Defined Elements . . . . . . . . . . . . . . . . . . . . . 71
Maximum Line Length of 80 Characters . . . . . . . . . . . . . . . . . . . 71
Monospaced Font . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
One Thing per Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Comments for Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Take Database Object Names into Account . . . . . . . . . . . . . . . . 76
SQL Coding Standards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Upper- and Lowercase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
White Space and Indenting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Commenting the Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Naming Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Organization of Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Sample Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82

Q:\Oracle8\048-7\fm.vp
Tuesday, October 12, 1999 2:58:58 PM
ORACLE
Color profile: Generic CMYK printer profile Series / Oracle Developer Advanced Forms & Reports / Brown / 2048-7 / Front Matter
Composite Default screen
Blind Folio FM:vii

Contents vii

PL/SQL Code Standards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83


Upper- and Lowercase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
White Space and Indenting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Commenting the Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Naming Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Code Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Sample Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
4 What Do You Base a Block on? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Forms Query Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Basing a Block on Nothing (a Control Block) . . . . . . . . . . . . . . . . . . . . . 108
Implementing a Block Based on Nothing . . . . . . . . . . . . . . . . . . . 108
Basing a Block on a Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Implementing a Block Based on a Table . . . . . . . . . . . . . . . . . . . 109
Basing a Block on a View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Updateable Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Views with INSTEAD OF Triggers . . . . . . . . . . . . . . . . . . . . . . . . 114
Non-Updateable Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Implementing a Block Based on a View . . . . . . . . . . . . . . . . . . . 118
Basing a Block on a Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
PL/SQL Table Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
REF CURSOR Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Implementing a Block Based on a Procedure . . . . . . . . . . . . . . . . 121
Basing a Block on a FROM Clause Query . . . . . . . . . . . . . . . . . . . . . . . 130
Implementing a Block Based on a FROM Clause . . . . . . . . . . . . . 131
Basing a Block on Transactional Triggers . . . . . . . . . . . . . . . . . . . . . . . . 133
Implementing a Block Based on Transactional Triggers . . . . . . . . 134
5 Forms GUI Standards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
The Forms Development Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Phase 1—Non-Functional Storyboard . . . . . . . . . . . . . . . . . . . . . 139
Phase 2—Semi-Functional Prototype . . . . . . . . . . . . . . . . . . . . . . 141
Phase 3—Production Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
Guidelines for Forms Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
The Size of the Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Screen Resolution and Monitor Size . . . . . . . . . . . . . . . . . . . . . . 143
Screen Real Estate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Items: Fonts, Colors, and Properties . . . . . . . . . . . . . . . . . . . . . . 148
Text, Labels, Lines, and Rectangles . . . . . . . . . . . . . . . . . . . . . . . 151
Forms Layout Editor Tips and Techniques . . . . . . . . . . . . . . . . . . . . . . . 151
Miscellaneous Forms Standard Techniques . . . . . . . . . . . . . . . . . . . . . . 152
Defer Required Enforcement Property . . . . . . . . . . . . . . . . . . . . . 152
Setting Up Your Directory Structure . . . . . . . . . . . . . . . . . . . . . . 153

Q:\Oracle8\048-7\fm.vp
Tuesday, October 12, 1999 2:58:58 PM
ORACLE
Color profile: Generic CMYK printer profile Series / Oracle Developer Advanced Forms & Reports / Brown / 2048-7 / Front Matter
Composite Default screen
Blind Folio FM:viii

viii Oracle Developer Advanced Forms & Reports

Arranging the Windows in Form Builder . . . . . . . . . . . . . . . . . . . 154


Ordering Blocks and Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Comment Property on Forms Objects . . . . . . . . . . . . . . . . . . . . . 155
Key Shortcuts in the Development Environment . . . . . . . . . . . . . 155
6 Forms Naming Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Why Name Forms Objects? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Naming Convention Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
Block Naming Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
Other Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Naming Conventions for Specific Objects . . . . . . . . . . . . . . . . . . . . . . . 164
Application Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
Forms and Object Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
7 Where to Put the Code in Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
Standards for Code Placement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Packages or Stand-Alone? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Benefits of Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Drawbacks of Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
Database Server or Form? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
How to Split the Forms Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
Other Database Code Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
Handling Forms Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
How to Handle Forms Functions . . . . . . . . . . . . . . . . . . . . . . . . . 192
Form-Level Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
Trigger or Program Unit? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Form or Library? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
Generic Library Code Example . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Which Library? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
Subclass or Copy from the Object Library? . . . . . . . . . . . . . . . . . . . . . . . 201
Subclassing Code from Object Libraries . . . . . . . . . . . . . . . . . . . 201
Which Level of Trigger? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
Execution Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
Another Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
The Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
The Development Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Genericizing Code for the Library . . . . . . . . . . . . . . . . . . . . . . . . 207
General Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208

Q:\Oracle8\048-7\fm.vp
Tuesday, October 12, 1999 2:58:59 PM
ORACLE
Color profile: Generic CMYK printer profile Series / Oracle Developer Advanced Forms & Reports / Brown / 2048-7 / Front Matter
Composite Default screen
Blind Folio FM:ix

Contents ix

8 Reports Development Standards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211


Genericizing Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
Setting the Report Standards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
Printing Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
Where Do You Put the Code in Reports? . . . . . . . . . . . . . . . . . . . 215
9 Reports Naming Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Naming the Report Itself . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Naming Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
SQL Naming Standards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Naming Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Columns in Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
Naming Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
Enclosing Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
Repeating Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
Naming Display Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
Naming Program Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
Naming Boilerplate Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232

PART III
Forms Templates
10 Forms Template Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Forms and VRAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
What Is a Template Form? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Benefits of Template Use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Drawbacks of Template Use . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
What Do You Put in the Template? . . . . . . . . . . . . . . . . . . . . . . . 240
Form Builder Features Used in the Template . . . . . . . . . . . . . . . . . . . . . 251
Template Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
Subclasses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
Object Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
Object Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
Template System Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
How to Use the Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
11 Constructing the Forms Template System . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
The Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
The Life Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
Where to Start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
The RAD Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
Summary of Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278

Q:\Oracle8\048-7\fm.vp
Tuesday, October 12, 1999 2:58:59 PM
ORACLE
Color profile: Generic CMYK printer profile Series / Oracle Developer Advanced Forms & Reports / Brown / 2048-7 / Front Matter
Composite Default screen
Blind Folio FM:x

x Oracle Developer Advanced Forms & Reports

Genericizing Objects and Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278


Genericizing Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
Genericizing Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
Object Library Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
Standard Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
Optional Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
Containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
Other SmartClasses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
Other Template Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
The Reference Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
The Template Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
Documenting the Template Files . . . . . . . . . . . . . . . . . . . . . . . . . 301
The Menu Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
Changing the Template Components . . . . . . . . . . . . . . . . . . . . . . 303
Style-Specific Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
Tab Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
Navigation Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
Administration Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
Locator Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
Hierarchical Tree Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
Project-Specific Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
12 Building a Form Based on a Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
1. Install the Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
Locating the Template Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
Setting Up the Development Environment . . . . . . . . . . . . . . . . . . 314
Keeping Template Versions Straight . . . . . . . . . . . . . . . . . . . . . . . 314
Setting Up Data Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
2. Create a New Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
3. Add Data Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
Using the Block Wizards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
Building a Block Manually . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
4. Apply SmartClasses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
How to SmartClass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
Which SmartClass to Choose . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
SmartClassing Other Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
Removing a SmartClass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
5. Modify the Template Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
Subclassed Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
Why Copy the Program Units? . . . . . . . . . . . . . . . . . . . . . . . . . . 332
STARTUP Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333

Q:\Oracle8\048-7\fm.vp
Tuesday, October 12, 1999 2:58:59 PM
ORACLE
Color profile: Generic CMYK printer profile Series / Oracle Developer Advanced Forms & Reports / Brown / 2048-7 / Front Matter
Composite Default screen
Blind Folio FM:xi

Contents xi

UTIL Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338


Adding Reusable Objects and Code . . . . . . . . . . . . . . . . . . . . . . 342
6. Add Other Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
Adding Reusable Components . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
Adding Other Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
7. Add Other Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345

PART IV
Advanced Forms Topics
13 Deploying Forms on the Web . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
The Web-Deployed Forms Environment . . . . . . . . . . . . . . . . . . . . . . . . . 352
The Java Virtual Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
The Middle Tier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
The Web-Deployed Forms Runtime . . . . . . . . . . . . . . . . . . . . . . 355
The Benefits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
The Development Environment . . . . . . . . . . . . . . . . . . . . . . . . . . 360
Oracle Information Manager Documents . . . . . . . . . . . . . . . . . . . . . . . . 361
General Advice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
Design for the Web . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
Test for the Web . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
Partition Your Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
Know What “Thin Client” Means . . . . . . . . . . . . . . . . . . . . . . . . 364
Set User Expectations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
Recompile the Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
Simplify Your Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
Use a Certified Client JVM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
Set Up the Infrastructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
Techniques and Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
Operating System Concerns . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
Reducing Network Traffic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
Design Differences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
Limitations and Work-Arounds . . . . . . . . . . . . . . . . . . . . . . . . . . 377
14 Forms Help Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
How Much Help? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
To What Level? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
How Much Content? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
Native Forms Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
Table-Based Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
Components of the Help System . . . . . . . . . . . . . . . . . . . . . . . . . 387
The Query Mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392
Enhancements to This System . . . . . . . . . . . . . . . . . . . . . . . . . . . 397

Q:\Oracle8\048-7\fm.vp
Tuesday, October 12, 1999 2:59:00 PM
ORACLE
Color profile: Generic CMYK printer profile Series / Oracle Developer Advanced Forms & Reports / Brown / 2048-7 / Front Matter
Composite Default screen
Blind Folio FM:xii

xii Oracle Developer Advanced Forms & Reports

Using a Help Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397


Other Table-Based Help Systems . . . . . . . . . . . . . . . . . . . . . . . . . 398
WinHelp Help System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
No WinHelp on the Web . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
What’s This? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
Working with WinHelp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
How to Integrate WinHelp and Forms . . . . . . . . . . . . . . . . . . . . . 402
Other Help Alternatives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
HTML-Based Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
Designer-Generated Help Systems . . . . . . . . . . . . . . . . . . . . . . . 408
15 Locator Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
Design of the Locator Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414
Poplists and LOVs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
Check Boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
Implementing Locator Query Criteria . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
Implementing the Locator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
Implementing Simple Numeric and Simple Character Items . . . . 417
Querying from Another Table . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
Querying by Generic Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
Locator Results Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
Sorting the Results Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
16 Multi-valued Selection Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
Check Boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
Implementing Check Boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
Radio Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
Implementation of Radio Groups . . . . . . . . . . . . . . . . . . . . . . . . . 432
List Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
Implementing Poplists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
A Limitation of Poplists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
Lists of Values (LOVs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
Implementation of LOVs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
17 Integrating Forms and Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
Calling Reports from Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
Passing Information to a Report . . . . . . . . . . . . . . . . . . . . . . . . . . 444
Handling Parameter Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
Bind Variables and Lexical Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . 445
Bind Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
Lexical Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446

Q:\Oracle8\048-7\fm.vp
Tuesday, October 12, 1999 2:59:00 PM
ORACLE
Color profile: Generic CMYK printer profile Series / Oracle Developer Advanced Forms & Reports / Brown / 2048-7 / Front Matter
Composite Default screen
Blind Folio FM:xiii

Contents xiii

PART V
Reports Topics
18 Reports—An Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453
Report Builder Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456
Data Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456
Layout Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
Parameter Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
Live Previewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
Advanced and Underused Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
Lexical Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
Built-in PL/SQL Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460
Report Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
Data Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
Building the Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464
Summary and Formula Columns . . . . . . . . . . . . . . . . . . . . . . . . . 465
Layout Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470
Live Previewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
Object Navigator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474
Live Previewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
Data Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
Layout Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
Parameter Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
Report Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
Program Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478
Attached Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
External SQL Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
PL/SQL Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
Debug Actions and Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
Built-in Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
Database Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
19 The Reports Data Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
Crafting the Query—Keep It Simple! . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
Query Builder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485
Multiple Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485
Using Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
Aliasing Column Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
Selecting PL/SQL Functions Within Queries . . . . . . . . . . . . . . . . 492

Q:\Oracle8\048-7\fm.vp
Tuesday, October 12, 1999 2:59:00 PM
ORACLE
Color profile: Generic CMYK printer profile Series / Oracle Developer Advanced Forms & Reports / Brown / 2048-7 / Front Matter
Composite Default screen
Blind Folio FM:xiv

xiv Oracle Developer Advanced Forms & Reports

Outer Joins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493


Temporary Report Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
Non-Query Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495
Formula Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495
Placeholder Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496
Report-Level Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497
Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
Break Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500
Specifying Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501
Group Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502
20 The Reports Layout Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
Working with the Layout Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
Working with Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510
Print Direction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513
Vertical and Horizontal Elasticity . . . . . . . . . . . . . . . . . . . . . . . . 514
Flex Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518
Confine Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519
Additional Default Layouts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520
Adding Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521
Moving Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521
Anchors: Keeping Things Where They Belong . . . . . . . . . . . . . . . . . . . . 523
Example of an Anchor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524
Format Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525
21 Using and Building Reports Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529
Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529
Template Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530
Template Editor—Data Model . . . . . . . . . . . . . . . . . . . . . . . . . . . 530
Template Editor—Layout Model . . . . . . . . . . . . . . . . . . . . . . . . . 531
Report Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536
Program Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536
Attached Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
Building a Sample Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
Data Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
Layout Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
Program Units and Attached Libraries . . . . . . . . . . . . . . . . . . . . . 542
Changing Template Default Settings . . . . . . . . . . . . . . . . . . . . . . 543
Setting Report Template Standards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544

Q:\Oracle8\048-7\fm.vp
Tuesday, October 12, 1999 2:59:01 PM
ORACLE
Color profile: Generic CMYK printer profile Series / Oracle Developer Advanced Forms & Reports / Brown / 2048-7 / Front Matter
Composite Default screen
Blind Folio FM:xv

Contents xv

22 Building a Production Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547


Preparing to Build the Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548
Step 1: Select the Report Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551
Step 2: Connect to the Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552
Step 3: Build the Query—Selecting Tables . . . . . . . . . . . . . . . . . . . . . . . 552
Step 4: Build the Query—Selecting Columns . . . . . . . . . . . . . . . . . . . . . 552
Step 5: Build the Query—Modify SQL Code . . . . . . . . . . . . . . . . . . . . . 553
Step 6: Build the Query—Selecting Fields for Breaks . . . . . . . . . . . . . . . 553
Step 7: Display Decisions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554
Step 8: Summary Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554
Step 9: Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554
Step 10: Template Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555
Step 11: Add a Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555
Step 12: Select Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555
Step 13: Alias the Column Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555
Step 14: Create Break Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 556
Step 15: Rename Groups and Queries . . . . . . . . . . . . . . . . . . . . . . . . . . 556
Step 16: Create Summary Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . 556
Step 17: Link Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557
Step 18: Create the Report Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557
Step 19: Select Groups and Modify Settings . . . . . . . . . . . . . . . . . . . . . . 557
Step 20: Change the Layout by Using the Live Previewer . . . . . . . . . . . . 558
Step 21: Add Information to the Report . . . . . . . . . . . . . . . . . . . . . . . . . 558
Step 22: Create a Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558
Step 23: Add the Employee Information . . . . . . . . . . . . . . . . . . . . . . . . . 559
Step 24: Apply the Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559
Step 25: Add Totals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559
Step 26: Fine-tune the Report Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . 559
Step 27: Complete the Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560

PART VI
Developer Tips and Techniques
23 Interview Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563
Oracle Developer Expertise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564
About the Interview Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564
Oracle Forms Interview Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
Forms Beginner Questions—
Basic Product Functionality (5 points each) . . . . . . . . . . . . . . . 565
Forms Intermediate Questions (10 points each) . . . . . . . . . . . . . . 573
Forms Advanced Questions (20 points each) . . . . . . . . . . . . . . . . 577

Q:\Oracle8\048-7\fm.vp
Tuesday, October 12, 1999 2:59:01 PM
ORACLE
Color profile: Generic CMYK printer profile Series / Oracle Developer Advanced Forms & Reports / Brown / 2048-7 / Front Matter
Composite Default screen
Blind Folio FM:xvi

xvi Oracle Developer Advanced Forms & Reports

Oracle Reports Interview Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582


Reports Beginner Questions—
Basic Product Functionality (5 points each) . . . . . . . . . . . . . . . 582
Reports Intermediate Questions (10 points each) . . . . . . . . . . . . . 588
Reports Advanced Questions (20 points each) . . . . . . . . . . . . . . . 592
Scoring Your Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599
24 Reports Tips & Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601
Page Breaks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602
Flexible Page Breaks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604
Control of Page Layout on a Form-Style Report . . . . . . . . . . . . . . . . . . . 606
Complex Centering of a Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 609
Strategies for Using Dot Leaders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 610
Managing Reports with Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611
Passing Page Numbers to a Report . . . . . . . . . . . . . . . . . . . . . . . 611
Alternating Page Headings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612
Counts of Record Subsets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 613
Basing a Query on a Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614
The Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614
Other Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 615
Performance Optimization in Reports . . . . . . . . . . . . . . . . . . . . . . . . . . 616
Use a Small Number of Queries . . . . . . . . . . . . . . . . . . . . . . . . . 616
Avoid Using Formula Columns Requiring Database Access . . . . . 616
Don’t Retrieve Detail Records from the Database
That Won’t be Displayed . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617
Tune Your SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617
Beware of Bind Variables, Changing Database Versions,
or Moving from One Database to Another . . . . . . . . . . . . . . . 618
Avoid Unnecessary Use of Graphics . . . . . . . . . . . . . . . . . . . . . . 618
Printer Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618
25 Forms Item Tips and Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621
Hierarchical Tree Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622
Preparation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624
Ingredients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 625
Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 625
On the Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 626
Additional Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627
Built-Ins and Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629
Dynamic Poplists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631
Dynamic Poplist Recipe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 632

Q:\Oracle8\048-7\fm.vp
Tuesday, October 12, 1999 2:59:02 PM
ORACLE
Color profile: Generic CMYK printer profile Series / Oracle Developer Advanced Forms & Reports / Brown / 2048-7 / Front Matter
Composite Default screen
Blind Folio FM:xvii

Contents xvii

System-Assigned ID Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634


Forms and Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634
Using a Database Trigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635
Using a PRE-INSERT Trigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635
Loading Image Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 637
Loading Image Items Recipe . . . . . . . . . . . . . . . . . . . . . . . . . . . . 637
Access Keys for Text Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 639
Defining an Access Key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 640
Recipe for the Text Item Access Key . . . . . . . . . . . . . . . . . . . . . . 641
Other Ideas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 644
Characters as Button Icons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 645
26 Forms Block Tips and Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647
Naming the Block Your Way . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648
Dynamic Block Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 649
Query Conditions in a PRE-QUERY Trigger . . . . . . . . . . . . . . . . . 649
WHERE Clause Block Property . . . . . . . . . . . . . . . . . . . . . . . . . . 650
What About a Block Based on a Procedure? . . . . . . . . . . . . . . . . 651
Dynamic Block Sorting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 651
Implementing Dynamic Sorting . . . . . . . . . . . . . . . . . . . . . . . . . . 652
List Item Order By . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 652
Column Order by Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 654
27 Forms Module Tips and Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659
Handling Forms Errors and Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . 660
The Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661
The Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 662
Using MESSAGE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 665
Standards for Error and Message Text . . . . . . . . . . . . . . . . . . . . . 665
Variations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 665
An Alert System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 666
Generic Alerts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 668
Alert Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 668
Sample Call . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669
Standard Button Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 670
Standard Alert Message Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671
The OK Alert Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671
Looping Through Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 672
Looping Through Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 672
Looping Through Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 673
Looping Through Other Objects . . . . . . . . . . . . . . . . . . . . . . . . . 674

Q:\Oracle8\048-7\fm.vp
Tuesday, October 12, 1999 2:59:02 PM
ORACLE
Color profile: Generic CMYK printer profile Series / Oracle Developer Advanced Forms & Reports / Brown / 2048-7 / Front Matter
Composite Default screen
Blind Folio FM:xviii

xviii Oracle Developer Advanced Forms & Reports

Tuning Your Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 674


Tuning from Outside the Form . . . . . . . . . . . . . . . . . . . . . . . . . . 675
Tuning from Inside the Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677
Finding Code and Objects in a Form . . . . . . . . . . . . . . . . . . . . . . . . . . . 682
Finding the Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682
Finding Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 683
Generating the Forms Object List Report . . . . . . . . . . . . . . . . . . . 683
Using the Forms Open API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 684
Changing the Cursor Shape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 685
Cursor Control Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686
Calling Other Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687
CALL_FORM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687
NEW_FORM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 688
OPEN_FORM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 688
Calling Other Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 688
Not on the Web . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 688
HOST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 688
HOST START . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689
WinExec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689
Other Tips and Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690
User Notes System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690
Aligning Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690
Viewing Windows and Canvases . . . . . . . . . . . . . . . . . . . . . . . . . 691
28 Forms Menu Tips and Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693
Techniques for Building Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 694
Creating a Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 694
Menu Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696
On Magic Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 699
On Check and Radio Group Items . . . . . . . . . . . . . . . . . . . . . . . . 700
On Menu Icons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 702
Menu Toolbars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703
Ordering the Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703
Hiding and Showing the Buttons . . . . . . . . . . . . . . . . . . . . . . . . . 705
Implementing Menu Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705
Database Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705
Menu Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 706
Dynamic Toolbars and Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707
Preparation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 709
Ingredients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 709
Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 711
Variations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 711

Q:\Oracle8\048-7\fm.vp
Tuesday, October 12, 1999 2:59:02 PM
ORACLE
Color profile: Generic CMYK printer profile Series / Oracle Developer Advanced Forms & Reports / Brown / 2048-7 / Front Matter
Composite Default screen
Blind Folio FM:xix

Contents xix

29 Forms System Tips and Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 713


Sharing Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 714
Database Package Specification Variables . . . . . . . . . . . . . . . . . . 715
Forms Package Specification Variables . . . . . . . . . . . . . . . . . . . . 715
Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716
Items in a Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 718
Global Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 718
Using “Constant” Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 719
Compiling Forms Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720
Compiling Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720
Compiling Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721
Command-Line Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721
The Order of Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
UNIX Batch Compiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
Setting Forms Registry Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724
Setting Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725
Setting the Registry from Within Forms . . . . . . . . . . . . . . . . . . . . 726
Foreign Function Interface (FFI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 726
FFIGEN.FMB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727
What FFIGEN Creates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 728
FFI Package Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 728
FFI Package Body . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729
Error Checking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731
Which Files Does Oracle Installer Install? . . . . . . . . . . . . . . . . . . . . . . . 732
A Sample Template PL/SQL Library Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . 735
F_ALERT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737
F_BLOCK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 738
F_CURSOR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 740
F_FORM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741
F_GLOBAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741
F_HELP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 744
F_ITEM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 745
F_MENU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 746
F_MESSAGE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 748
F_TOOLBAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 749
F_UTIL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 750
F_WINDOW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 753
B Interview Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 757
Forms Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 758
Forms Beginner Questions (5 points each) . . . . . . . . . . . . . . . . . . 758
Forms Intermediate Questions (10 points each) . . . . . . . . . . . . . . 760
Forms Advanced Questions (20 points each) . . . . . . . . . . . . . . . . 761

Q:\Oracle8\048-7\fm.vp
Tuesday, October 12, 1999 2:59:03 PM
ORACLE
Color profile: Generic CMYK printer profile Series / Oracle Developer Advanced Forms & Reports / Brown / 2048-7 / Front Matter
Composite Default screen
Blind Folio FM:xx

xx Oracle Developer Advanced Forms & Reports

Reports Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 763


Reports Beginner Questions (5 points each) . . . . . . . . . . . . . . . . . 764
Reports Intermediate Questions (10 points each) . . . . . . . . . . . . . . 765
Advanced Reports Questions (20 points each) . . . . . . . . . . . . . . . 766
C WinHelp Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 771
Topic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 772
Keyword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 772
Context String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 773
Hotspot Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 774
Hotspot Graphic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 774
Other Help Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 774
D Stepping Through the Report Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 777
Style Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 778
Type Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 782
Data Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 783
Groups Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 784
Fields Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 785
Totals Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 786
Labels Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 787
Template Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 787
E Performing a Report Audit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 791
F Report Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 797
User-Level Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 798
Sorts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 799
Breaks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 800
Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 801
Other User-Specified Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 804
System-Level Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 804
G Oracle White Papers on Web-Deployed Forms . . . . . . . . . . . . . . . . . . . . . . . 807

Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 811

Q:\Oracle8\048-7\fm.vp
Tuesday, October 12, 1999 2:59:03 PM

Você também pode gostar