You are on page 1of 86

Database Management Systems

Chapter 6
Forms and Reports

Jerry Post
Copyright © 2003
1
D Uses of Forms
A  Collect Data
T  Display Query Results
 Display Analysis and Computations
A  Switchboard for other Forms and Reports

B  Direct Manipulation of Objects


 Graphics

A  Drag and Drop

S
E
2
D Human Factors Design
A  User Control
 Match user tasks.
 Feedback
 Methods

T  Application responds to user


control & events.
 Visual
 Text
 User customization  Audio

A  Consistency  Uses
 Acceptance of input
 Layout, Design & colors
B  Actions
 Clarity
 Changes to data
 Completion of tasks
 Events / Activation
A  Organization
 Purpose
 Forgiveness
 Anticipation and correction
S  Terminology
 Aesthetics
of errors
 Confirmation on delete and

E  Art to enhance, graphics


 Sound
updates
 Backup and recovery

3
D Windows Interface Standards
A  The Windows Interface: An
Application Design Guide
 Manipulation
 Activation
T (Microsoft)
 Navigation and Choices
 Drag and Drop
 Feedback
A  Mouse, Icons
 Keyboard, Short-cuts
 Progress indicators and
status gauges

B  Menus
 Selections from a list
 Flashing
 Tool tips

A  Single  Status bar


 Contiguous Multiple  3-D controls
 Disjoint Multiple  Message boxes
S  Focus
 Outline box
E  Cursor

4
D Windows Interface
A
 Window components
T  Frame (sizing)
 Title bar
A  Control-menu box
 Buttons
B  Minimize
 Maximize
A  Close
 Scroll box (thumb)

S  Scroll bar

E
5
D Windows Menus
A
 Menus
T  Drop-down
 Short Cut Keys
A  Mnemonic character
 Pop-up (as needed)
B
A
S
E
6
D Message Box (A Simple Form)
A  Message Boxes
T 

Title
Message

A 

Simple buttons
Icons

B  Modal (required)

A
S
E
7
D Interface / Accessibility
A
 Multiple Input Methods  Some Suggestions:
T  Keyboard  Beware of Red/Green.
 Mouse  Avoid requiring rapid
A  Voice user responses.
 Avoid rapid flashing on
 Multiple Output
B  Visual
the screen.
 Give users customization
A
 Sound options.
 Color  Volume

S  Color
 Typefaces & Fonts

E
8
D Form Layout
A  Types of Forms Form
T 

Tabular
Single Row Order

A 

Sub-forms (one-to-many)
Switchboard Items

B  Controls
 Form Properties
11
7
Dog
Dog
5
1
13 Cat 2
A  Form Events

S
E
9
D Tabular Form
A  Works best for single table.
T  Designer can control data
entry sequence.
A  Probably include buttons for
sorting.

B
A
S
E
10
D Single Row (Columnar) Form
A  Data for only one row.
T  Designer can set optimal
layout.
A  Similar in appearance to
paper forms.

B  Can use color, graphics, and


command buttons to make

A
the form easier to use.
 Note the importance of the
navigation buttons.
S  Probably want a Find
command.
E  Useful to include subforms.

11
D Sub-Forms
A  Typically a one-to-many relationship.
 Subform contents are linked to the main form through a common

T column (not displayed on the subform.)


 Can have multiple subforms (Independent or Nested).

A
B
A
S
E
12
D Switchboard Form
A  Blank Form
T  Graphics/Picture/Backgroun
d
A  Identify User
 Choose Task.

B
A
S
E
13
D Menu Design
A
Main Menu Customer Information
T 1. Setup Choices Daily Sales Reports

A 2.
3.
Data Input
Print Reports
Friday Sales Meeting
Monthly Customer Letters

B 4.
5.
DOS Utilities
Backups Exit

A
S
Hard to understand Organized by user tasks.

E
14
D Menus
A  Consistency
 With operating environment
 Pop-up
 Miniature form
T  Within project
 Pull-down


Tied to location/pointer
Right-mouse button

A 

Name, Action
Shortcut keys


Attribute settings
Modal (keeps focus) or not

B
 Access keys (&File, File)
 Breaks/groups (-)
 Dimmed option

A  Check mark
 Submenus ()

S  Logical groupings
 Tradeoff: length v depth

E  Form indicator (…)

15
D Queries
A  Queries are used to
T automatically look up data.
 e.g., Customer name

A  e.g., Product description


 Be very careful when using

B queries.
 Each form should store data
in only one table.
A  For multiple tables, use a
subform or separate forms.

S  Usually Lock the look up


data so it cannot be
changed accidentally.
E
16
D Form Query Example
A  Clerk enters a CustomerID.
 Stored in the Order table.

T  Query joins Sale and


Customer.

A  Automatically matches the


CustomerID.
 Matching name is displayed
B
Customer Order
on the form.
SaleID 1234 Date 7/25/01
 Do not include the join column CustomerID 17
A (CustomerID) from the look up
table (Customer).
Carly Embry

S
E
17
D Form Query: Underlying Tables
A Customer Order
SaleID 1234 Date 7/25/01
T CustomerID 17
Carly Embry

A
B
Data
Data
entry
display

A SaleID
1232 23
Sale
CustomerID Sdate
7/24/01
CustomerID
15
Customer
First Last
Connie Fisher
Query
S 1233
1234
74
17
7/24/01
7/25/01
Join
16
17
Rosie Wade
Carly Embry

E
18
D Form Properties (Some)
A  Data  Format
T  Base Table / Query
 Filters


Caption
Scroll Bars

A  Sort
 Integrity


Record Selectors
Navigation Buttons

B  Edits
 Additions, Deletions


Size and Centering
Background/Pictures

A
 Locks  Colors
 Other  Tab Order
 Pop-up menus
S  Menu Bar
 Help
E
19
D Controls on Forms (Basic)
A Label Text box
Drop down list
or combo box
List box

T Last Name Clothing

A Country
Shoes
Electronics

B
Payment Method Options
Credit Card x Gift wrap Sales
Check x Gift card
A Cash Monogram

S Option button Check box Command


button

E
20
D Pictures
A  Background pictures Employee

T 

Unbound, unchanging.
Stored with the form.
Name: Che Zhang
ID: 3354
A 

Keep edit screen readable.
Sizing (zoom, scale, clip).
Phone: 222-111-1524

B  Pictures stored as data


 Bound to a data column.
...
Photo:

A
 Define column as object.
 Tie to scanner or graphics
package through OLE.
S  Beware of data size
 Resolution

E  Number of colors
 User machine capabilities.

21
D Basic Controls
Option Group
A Label
Text Box (single response)

T
A Command
B Button

A
S
E Combo Box
(click arrow to open)
List Box
(always open)

22
D Combo & List Boxes
A  User selects from a list
 Combo box can enter new
 Example when you want to
use data entry:

T data, or restrict to list.


 Two basic uses:
 On a sales form, use a
combo box for customer.
 It takes a value from the
A  Insert a value into a table
 Choose from a list of preset
options, e.g. gender.
Customer table and inserts
the ID into the Sale table.

B  Select from a different table,


e.g., choose a customer.
 Example when you want to
use a search:
 Find the data record in this
A
 On a Customer edit form,
form that matches the you might use a combo to
choice. search the Customer table.

S  Be careful! Many systems


do not distinguish between
the two uses (enter data and
 Be sure the combo is not
bound to the table!

E search).  Probably need to write code


for search.

23
D Combo Box
A  ControlSource sets the
Name
ControlSource
Properties
CustomerID
CustomerID
T column to receive the choice
(in the Sale table)
Format
DecimalPlaces Auto
InputMask
A  RowSource generates the
list of data to display.
RowSource/Type Table/Query
RowSource SELECT . . .

B  Uses standard SQL.


 Note 4 columns displayed.
ColumnCount
ColumnHeads
ColumnWidths
4
No
...
 First column is the one to
A store in the data table. BoundColumn 1
SELECT Customer.CustomerID,

S Customer.LastName,
Customer.FirstName,
Customer.Phone FROM Customer

E ORDER BY Customer.LastName;

24
D Combo Box Sources
A  Microsoft Access supports
three methods:
 Useful feature of list combo
box.
 Fixed list.  The Row Source property is
T  Query from a table.
 Defined function.
a text string.
 This string can be

A  With some systems (e.g.,


Visual Basic), you write code
generated by code.
 List entries can be changed

B to generate each list entry. in response to user actions.


 You might use a fixed list for  Programmed function.
 For straightforward cases, it
A
simple lists like “male”,
“female”, “unknown”. is easier to use a fixed list
and just change the text.
 It is better to query from a
S table, even for simple lists.
 Use a one column table.
 More complex cases, you
can write a subroutine that
generates the list choices
E  Easier to add to a table than
to change a combo box.
following a specific format.

25
D Controls on Forms (Complex)
A  Common
Calendar

T 

Tab
Grid Tab

A 

Calendar
Gauge Grid

B 

Slider
Spin Box

A  Additional
 Purchase
 Create your own (C++)
S Gauge Slider Spin box

E
26
D Charts
A  Build a query that generates
Sale 1
Animal Merchandise

T the data to be graphed.


 Numeric data
Sale 2
Animal
Merchandise

A  Individual series
 Aggregate data
Sale 3 Animal
Merchandise

 Labels
B  Columns to link to form.
 Summary chart--unlinked.
A  Insert chart.
 Set chart type.
Total Sales

S 

Set up data and labels.
Set chart properties.
Animals
Merchandise

E  Verify size.

27
D Multiple Forms
A Sale

T Customer Edit
FirstName: Mary Customer

A
LastName: Jones
Address: 123 Oaxaca Ave. FirstName: Mary
LastName: Jones

B Animals Purchased Address: 123 Oaxaca Ave.


City: Los Angeles
A Merchandise ZipCode: 90086

S Gender: Female
Age: 20

E AccountBalance: $150

28
D Multiple Forms
A  Using data on other forms
Animal

T  The forms object collection


 Forms![FormName]![Control]
AnimalID

A  Subtotals and subforms


 The form property
Sale
B  Forms![MainForm]!
[SubForm].Form![Control]
=AnimalID from Animal form

 Multi-page v Separate forms ItemsSold


A  Same recordset
-------
-------
Subtotal=Sum(Price*Quantity)
 Screen size
S  Side-by-side =Forms!Sale!ItemsSold.Form!Subtotal

Subtotal

E Tax
OrderTotal
=Subtotal*[TaxRate]
=Subtotal+Tax

29
D Integrity
A  Avoid relying on forms
 Set integrity conditions in
 Controls
 Security rights

T table definitions
 Be sure to set referential
 Data formats
 Data entry
integrity (relationships)
A
 Round-off
 Use forms to make it easy to  Selectivity
enter quality data  Visible

B 

Combo/list boxes
Menus
 Enabled & Locked
 Example: no production

A 

Pop-up forms
Ties to related forms
change after item is sold.
 User assistance
 Tool tips
S 

Data transfer across forms
Computations
 Status bar
 Menu
E  Error checking & trapping
 Help--context sensitive

30
D Large Projects Switchboard
 Design Standards
A  Templates
 Colors, layout
form
Customer Order

T
Assembly
 Titles
 Actions, common buttons
Order
A
 Naming convention is crucial Assembly
 Forms form form
 Controls

B  Event procedures
 Variables

A  Team Coordination
 Menu design
Order form
Item# item not
Backorder
Notice
available
S
 Within a form/standards & Form
 Across an application
Customer#
 Event / action diagrams

E  State diagram
 Scenario diagram/messages
large
customer
Customer
Discount

31
D Objects
A  Scenario diagrams  Messages are usually
initiated by calling exposed
 Objects
T 

Properties
Events
functions in an object
 Data can be passed directly,

A  Messages or made available by


exposing properties

B Message: compute
discount using
Customer ID
Market
A & Order size
Pricing
Object

S Customer

E Order object
Message: discount pct

32
D International Attributes
A  Language
 Character sets and punctuation
T marks
 Sorting

A  Data formats
 Date

B 

Time
Metric v English

A
 Currency symbol and format
 Separators (decimal, . . .)
 Phone numbers
S  Separators
 International code prefix

E  Postal codes
 National ID Numbers

33
D Direct Manipulation of Objects
A Kennel/
Orders 
Current Choices
Customer

T Bird

Cat

A
Tabby
Dog

Fish

B Mammal

Reptile

A Spider
 Brown Lab

S  A graphical approach.
 Minimize data entry.
E  Drag and drop objects (blue arrows).

34
D Creating a Graphical Approach
 Get the hardware.
A  Images: Scanners
 Sound: Microphone and Sound card
T 

Video: Camera and capture card
Lots of disk space.
A  High speed processors.
 Add an object column to your table definition.
B  Design the screens.
 Be creative.

A 

Get user input.
Make the user’s job easier.

S 

Avoid using graphics just for show.
Double-click

E
 Drag-and-drop
 Programming!

35
D Oracle Forms
A
Use List of Values (LOV) instead of select boxes.

T
A
B
A
S
E
36
D Oracle Forms Designer
A
T
A
B
A
S
E
37
D Oracle Forms: Sales
A Oracle provides
minimal support for
T updateable queries,
so several items are

A grayed out to indicate


they cannot be
changed here.
B
A
S
E
38
D Oracle Forms: Sales Design
A
T
A
B Two new
data blocks
are used for
A the
repeating

S sections.

E
39
D Oracle Forms Design Hints
A  Displaying non-updateable data from other tables is tricky.
T In Master/Sale set:
 DML Data Target Type = Table

A  DML Data Target Name = Sale


 For SaleID, set PrimaryKey = Yes

B  Add the other tables


 Query Data Source Type = Table

A
 Query Data Source Name (parentheses are critical!)

(SELECT Sale.columns, Customer.Columns, Employee.Columns


S FROM Sale, Customer, Employee
WHERE (Sale.CustomerID = Customer.CustomerID)

E AND (Sale.EmployeeID = Employee.EmployeeID))

40
D Oracle Forms Hints
A Add non-updateable columns by hand. Use aliases in the query to
ensure all column names are unique. Then set properties:

T General – Name: cLastName


Functional – Enabled No (optional but clearer to the user)
A Database – Database Item Yes

B Database – Column Name


Database – Query Only
cLastName
Yes

A Database – Insert Allowed


Database – Update Allowed No
No

S
E
41
D Report Design
A  Report usage/user needs.  Security controls
 Distribution list
 Report layout choices.
T  Tabular
 Columns/Subgroups
 Unique numbering
 Concealed/non-printed

A 
 Charts/graphs
Paper sizes.
data
 Secured printers

B
 Transmission limits
 Printer constraints.  Print queue controls
 How often is it generated?  Output concerns
A 

Events that trigger report?
How large is the report?
 Typefaces
 Readability
S 

Number of copies?
Colors?
 Size
 User disabilities

E  OCR needs

42
D Terminology
A  Page Layout
 Landscape v. portrait
Facing pages (portrait)

T  Margins
 Gutter (binding space)

A  Typefaces
 Serif (Times New Roman)
B  Sans-serif (Arial) gutter
margins
 Ornamental
A  Fixed width
Landscape

S  Font size
 common: 10 - 12 point

E
 72 points approx. 1 inch Alignment marks for
color separations.
 pica (1/6 inch) (12 points)

43
D Report Types: Tabular
A
T
A
B
A
S
E
44
D Report Types: Labels
A
T
A
B
A
S
E
45
D Report Types
A  Column.
T  Column with groups.

A
B
A
S
E
46
D Report Layout
A  Report Header

T  Page Header
 Group Header1

A  Group Header2
 ...
 Detail

B  ...
 Group Footer2

A
 Group Footer1
 Page Footer
 Report Footer
S
E
47
D Report Layout/Common Use
A  Report Header  Group Footer
T  Title pages that are printed
one time for entire report.
 Subtotals for the group.
 Page Footer
A  Page Header
 Title lines or page notes that
 Printed at the bottom of
every page--page totals or
are printed at the top of
B
page numbers and notes.
every page.
 Report Footer
 Group Header  Printed one time at the end
A  Data for a group (e.g.,
Order) and headings for the
of the report. Summary
notes, overall totals and

S
detail section. graphs for entire data set.
 Detail
 Innermost data.
E
48
D Report Layout/Groups
A  Often use groups/breaks for  Customer(C#, Name, …)
one-to-many relationships.  Order(O#, C#, Odate, …)
T  Use a query to join all  OrderItem(O#, Item#, Qty, …)
necessary tables.
A  Can include all columns.
 Use query to create
Report of Orders
Group1: Customer

B computed columns (e.g.,


Extended:Price*Quantity).
H1: Customer name, address, …
Group2: Order
H2: Order#, Odate, Salesperson.
 Avoid creating aggregates
A or subtotals in the query.
 Each one-to-many
Detail: Item#, Qty, Extended
F2: Order total: Sum(Extended)

S relationship becomes a new


subgroup. F1: Customer total orders:

E Rpt footer: graph orders by customer

49
D Report Computations
A
 Query
T  Same row computations.
 Extended=Price*Quantity
A  Report

B
 Group subtotals.
 Page and report totals.

A
 Mixed, e.g., commission = rate * total
 Scope depends on location

S
 Group footer: subtotal
 Page footer: page total
 Report footer: report total
E
50
D Report Graphs
A  Graphs
 Separate query.
T  Detail
 Locate in detail or group footer section.

A  Avoid aggregation and groups in query.


 Include column that links to detail query in

B report.
 Subtotals and totals
 Typically located in report footer or header.
A  Compare group totals
 Relies on Group By and aggregation.
S  Be sure query groups match report groups.

E
51
D Report Graph for Group
A
T
A
B
A
S
E
52
D Oracle Report Writer: Preview
A
T
A
B
A
S
E
53
D Oracle Report Writer: Design
A
T
A
B
A
S
E
54
D Oracle Reports: Data View
A The data view can be used to

T create reports with complex data


structures. It is primarily used for
master/detail reports.
A
B In this example, each supplier can
be sent many purchase orders,
which each contain many items

A being ordered. The report can


produce group breaks on all three
sections.
S
E
55
D Application Features
A  Application organization Customer

T 

Menu
Toolbar
File Edit Help Report File Edit Help

File Edit Help

A
File Edit Help
 Help
Sales
 Transactions
B
Report
Switchboard
Switchboard
 Improving forms
 Customized reports
A  Distributing Applications

S
E
56
D Application Design
A  Customer Form Customer Order

T  Order Form
 Bad design:
1592
Jane Doe
333 Elm St.
Customer:
1592 Jane Doe
333 Elm St.

A  Enter data twice.


 Poor design:
B  Memorize data (ID) on one
form to enter on second.

A  Better design:
 Automatically transfer data
across forms.
S
E
57
D Application Importance
A  User interface  Decision Support
 Make users’ jobs easier.  Monitoring of events.
T 

Tie input forms and reports.
Automate basic tasks
 Analysis, Graphs, Reports.
 Statistical analysis and
A  Tie to external data collection
devices.
optimization.
 Forecasts and simulation.

B  Help system.
 Ensure data integrity
 Linking to other software.
 Expert Systems &

A
 Validate data. Intelligence
 Perform computations.  Logic and forward chaining.
 Verify totals.  Analysis and decisions in
S 

Control user access.
Maintain related transactions.
code.
 Databases of cases,

E  Backup and recovery. situations and solutions.

58
D Application Organization
A  Organized by user needs.
 Identify user.
 Build forms and reports.
 Start with a core concept.
T  Outline tasks.
 Organize forms and reports.
 Identify most important
features. Get them correct.

A  Direct users to tasks.


 Potential drawbacks
 Add features, forms and
reports. Issue application
updates--number and date!
B  Too many layers makes it
difficult for users to find
 Use menu stubs for
incomplete and future work.
anything.
A  Poor organization confuses
users and requires
 Make them invisible to the
user with the Visible
property.
S additional support and
training.  Be sure they are disabled.

E
59
D Application Structure
A Forms and Reports Front end
Visual Basic
T Internet
Oracle Forms
A
B Middle Tier
If x > 10,000 Then (Optional)
A Database
Oracle
Else
End If Business logic
Rules
S SQL Server
DB2
E Access
Back end
60
D User Orientation
A  Database application is a model
of the organization.
T  Applications based on user jobs.
 Flexibility and user control.

A  Application organization
 User tasks.

B  User control over sequence.


 Forms

A  Minimize user entry.


 Anticipation.

S  Reports
 Easy access from forms.
 User selection of scope and
E conditions or filters.

61
D Initial Menu / Switchboard
A  Starting point for users.
T  Identify the user.
 From network if possible.

A  Separate log in if needed.


 Customized for users.
 Hide restricted options.
B  Different forms as needed.
 Avoid cluttered screens.
A  Use graphics and color to
enhance the presentation.

S  Limit the number of options.

E
62
D Switchboard Uses
A  Acts as a directory for the application.
T  Identifies users.
 Contains startup and shutdown code.
A  Can preload forms in background.
 Make them invisible.

B  Speed up later usage.


 Can initiate transaction and security logs.

A
 Can establish network connections.
 Contains copyright and usage notes.

S
E
63
D Sally’s Pet Store: Poor Organization
A Order Receive Sell
Merchandise Merchandise Merchandise
T Item Item Item

A What is wrong?
Get
B Focus needs to be at higher level
(Order, Receipt, Sale); not Item.A
Customer
Data

A You cannot go from Order to Receipt.

S
You cannot go from Receipt to Sale.
You need to get customer data before

E recording the sale.

64
D Sally’s Pet Store: Better Organization
A Supplier

T Customer

A
Orders Receipt
B specia
A orders
l
Sale

S Inventory
Items More links--usually as buttons.

E Separate sales from orders,


except for special orders.

65
D Sally’s Pet Store: Initial VTOC
A Sales Sale Animal
Sale Merchandise

T
Animals

Customers Animal Health

A Animal Genealogy

Customer Receipts

B
Suppliers
Supplier Payments
Purchase Animals

A Purchase Merchandise
Inventory
Sales Report
S Accounting
Cash Flow
Marketing

E
Accounts Payable
Employees Accounts Receivable

66
D Menus
A  Why a custom menu?
 Limit user actions.
File Help
Contents
T 

Simplify user interface.
Add custom actions. Search
About Rolling Thunder
A
 Menus can be activated by
keystrokes.
 Accessibility
B  Touch-typists and
heads-down data entry. File Edit Help

A  Sometimes need different


menus for each form.
Add Customer
Delete Customer Ctrl+D

S Modify Customer Data

E
67
D Creating Menus
A
 View | Toolbars | Customize
T  Drag and Drop
 Multilevel menu.
A  Sublevels/hierarchy.
 Each level is a separate menu with its
B own name.
 Menu choices

A  Each entry has a name.


 Access key: & (e.g., &File).

S  Status Bar Text


 Actions

E  Submenu.
 Run any code.

68
D Toolbars
A  Why toolbars?
Print

T  Single click for complex


actions.
·Identify report
·Ask for single or

A  Commands available across multiple pages.


the application / shortcuts. Switchboard
Switchboard ·Preview or print.
 Position and customization
B by user.
 Toolbar components Weekly Sales Analysis
A  Button
 Text
Build graphs
Print reports

S  Icon/graphic (bitmap)
 Tool Tip
Export data to spreadsheet

E  Status Bar description


 Action

69
D Menus and Toolbars
A
T
A
B
A
S
E
70
D Creating Toolbars
A  View | Toolbars | New
 Customizing
T  Add new button.
Select from DBMS list.
A Bring up query/form/report.
Run code.
B  Change icon.
Modify existing icon.
A Replace icon.
Create your own icon and paste it on the button.
S Place text label on button.
 Tool tips are vital.
E  Status bar for description.

71
D Icons
A  16 by 16 pixels
T  16 colors
 Bright and shaded

A  Dither to mix colors


 Outline in black

B
A
S
E
72
D Help
A  On-line help replaces manuals Sally’s Pet Store--Contents
T  Context sensitive:
 Pressing F1 key provides
Copyright Notice
The Firm
Introduction
A information on topic with
current focus
Processes
Entering Data
 Hypertext links to related topics Sales
B  Sequential topics
 Descriptions
Animal Health

A  Examples
 Definitions / Glossary
Breeds (and other terms)

S  Contents / overview
 Index / keywords

E  Full-text search
 Windows 95 & Win-NT

74
D HTML Help
A  Get the Microsoft HTML Help Workshop:
T  http://msdn.microsoft.com/library/tools/htmlhelp/
 Create each of the following

A  Help project files


 Use separate directory
 HTML topic files
B  Standard HTML with some additions for keywords
 Topic Header and Text File

A  Graphics and multimedia


 Avoid monster sizes
 Contents files
S  Can auto-generate from heading tags (<H1>, <H2>, …)
 Index files

E  Use Help workshop to set keywords within each topic

75
D HTML Help Workshop
A
T
A
B
A
S
E
76
D HTML Project Hints
A
 Project Options
T  Project Title
 Default file (first page)
A  Can create new files with File - New

B
 Be sure to Add/Remove Topic files to project list
 Edit – Compiler Information to add keywords to HTML file

A  Concentrate on creating useful help content


 On large projects, hire/train someone to manage help
S  Add useful features
 Keep content up to date

E  Manage/organize all the files

77
D Context-Sensitive Help
A
Set the help file name in the form properties.

T
A
B
A
S
E
Set the topic number (Context Id) for each form or control. 78
D Context Sensitive HTML Help
A  Create a Topic file for pop-  Create a header file to link
T up topics the topic names to numbers
 Use HTML API to set the

A .topic Filename1 filenames


Description #define Filename1 10000
B #define Filename2 20000
.topic Filename2
A Description …

S …

E
79
D Appendix: Oracle PL/SQL: Data Types
A  CHAR
 Primary Data Types
T  NUMBER(precision, scale)  Fixed length string
 VARCHAR2
 precision: Number of digits
A  scale: Round-off point
 NUMBER(7,4): 123.4567
 Variable length string
 LONG, LONG RAW

B  INTEGER
 Default: NUMBER(4)
 Binary data
 DATE

A  BOOLEAN
 Yes/No

S
E
80
D Appendix: Oracle PL/SQL Structure
A CREATE OR REPLACE PACKAGE myPackage AS
PROCEDURE myProcedure(oldProjectID IN NUMBER);
END myPackage;
T CREATE OR REPLACE PACKAGE BODY myPackage AS
DECLARE
A myGlobalVar NUMBER;

B PROCEDURE myProcedure(oldProjectID IN NUMBER) IS


DELCARE
myLocalVar NUMBER;
A BEGIN
myLocalVar := oldProjectID;
IF
S END IF
COMMIT;

E END myProcedure;

End myPackage;
81
D Appendix: PL/SQL Operators
A
T
A
B
A
S
E
82
D Appendix: PL/SQL IF-THEN-ELSE-ELSEIF
A
DECLARE
T X NUMBER(10,2);
BEGIN
A -- retrieve the balance
IF (BALANCE > 0) THEN
Use ELSEIF for case statements.

B
X = BALANCE*1.10; IF (ACCOUNT = ‘P’) THEN
ELSE -- do personal accounts
X = 0.0; ELSEIF (ACCOUNT = ‘C’) THEN
A END IF;
END;
-- do corporate accounts
ELSEIF (ACCOUNT = ‘S’) THEN

S Watch the semicolons! ELSE


-- do small business

-- handle error
E END IF;

83
D Appendix: PL/SQL Loops
A (Start statement)
T LOOP
WHILE (condition) LOOP
A …
EXIT; …

B EXIT WHEN (condition); END LOOP;

… FOR (variable) IN low...high LOOP


A END LOOP; …

S END LOOP;

E
84
D Appendix: Procedures or Subroutines
A
PROCEDURE DropOldAccounts (CutDate DATE) IS
T -- local variables are defined here
BEGIN
A -- First copy the data to a backup table
INSERT INTO OldAccounts

B
SELECT * FROM Account WHERE AccountID NOT IN
(SELECT AccountID FROM Order WHERE
Odate > CutDate);
A -- Copy additional tables…
-- Delete from Account automatically cascades to

S others
DELETE FROM Account WHERE AccountID NOT IN
(SELECT AccountID FROM Order WHERE
E Odate > CutDate);
END DropOldAccounts;
85
D Appendix: SQL Cursors
A DECLARE
CURSOR c1 IS

T SELECT Name, Salary, DateHired FROM Employee;


varTotal Employee.Salary%TYPE;
BEGIN
A varTotal = 0;
OPEN c1;

B FOR recEmp in c1 LOOP


varTotal := varTotal + recEmp.Salary;
END LOOP;
A CLOSE c1;
-- Now do something with the varTotal
S END;

E
86
D Appendix: Error Handling
A PROCEDURE myProc ( ) IS
DECLARE
T -- declare all local variables
BEGIN

A -- SQL statements here


EXCEPTION
WHEN OTHERS THEN -- you can specify a particular error
B -- but OTHERS captures all errors
-- PL/SQL code to execute if an error arises
A END myProc;

S
E
87

You might also like