Anda di halaman 1dari 300

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

le

b
fera

n
a
r
t
n-

a
c
n
a

no
a
has Express:
Oracle Application
)
om Web
ideApplications
Developing
c
u

cle ent G
a
r
oActivitytuGuide
d Volume I
@
i
e is S
b
a
b e th
a

ca to us
n
a
bi nse
(
i
e lice
bab

Bi

D56782GC30
Edition 3.0
December 2011
D75248

Copyright December, 2011, Oracle and/or its affiliates. All rights reserved.

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

Disclaimer
This document contains proprietary information and is protected by copyright and other intellectual property laws. You may copy and
print this document solely for your own use in an Oracle training course. The document may not be modified or altered in any way.
Except where your use constitutes "fair use" under copyright law, you may not use, share, download, upload, copy, print, display,
perform, reproduce, publish, license, post, transmit, or distribute this document in whole or in part without the express authorization
of Oracle.
The information contained in this document is subject to change without notice. If you find any problems in the document, please
report them in writing to: Oracle University, 500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not
warranted to be error-free.
Restricted Rights Notice
If this documentation is delivered to the United States Government or anyone using the documentation on behalf of the United
States Government, the following notice is applicable:
U.S. GOVERNMENT RIGHTS
The U.S. Governments rights to use, modify, reproduce, release, perform, display, or disclose these training materials are restricted
by the terms of the applicable Oracle license agreement and/or the applicable U.S. Government contract.
Trademark Notice

n
a
r
t
n-

Bia

no
a
Authors
has
)
Dimpi Sarmah, Salome Clement
om uide
c

cle ent G
Technical Contributors and Reviewers
a
r
o tudChristina Cho, Christopher Wensley,
Anthony Rayner, Bryan Roberts, Chaitanya
@Koratamaddi,
i
S
e
b
s
i
Drue Baker, Ganesh Pitchaiah, Hailing
Huang,
Hilary
Farrell, Iloon Ellen, Jason Straub, Jeana
h
t
b
a
e
Paul Fillon, Joel Kallman, Linda
s Greenberg, Madhavi Siddireddy, Maria Billings,
a Ross,uNancy
c
n
o
t Patrick Wolf, Sharon Kennedy, Terri Jennings, Yi Lu,
Matthew Gregory, Michael
ia Hichwa,
b
e
(
s
Wayne Abbottei
en
b
c
i
a
l
b
A
a
ncThis book was published using: Oracle Tutor
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective
owners.

le

b
fera

Table of Contents

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

Practices for Lesson 1: Course Overview ................................................................................................ 1-1


Practices for Lesson 1............................................................................................................................. 1-2
Practices for Lesson 2: Introduction to Oracle Application Express....................................................... 2-1
Practices for Lesson 2............................................................................................................................. 2-2
Practice 2-1: Using Oracle Application Express as a Workspace Administrator ......................................... 2-3
Practice 2-2: Using Oracle Application Express as a Developer ................................................................ 2-4
Practice Solution 2-1: Using Oracle Application Express as a Workspace Administrator ............................ 2-5
Practice Solution 2-2: Using Oracle Application as a Developer ................................................................ 2-8
Practices for Lesson 3: Interacting with the Database by Using SQL Workshop.................................... 3-1
Practices for Lesson 3............................................................................................................................. 3-2
Practice 3-1: Using Object Browser ......................................................................................................... 3-3
Practice 3-2: Using SQL Commands and SQL Scripts.............................................................................. 3-4
Practice 3-3: Using Utilities ...................................................................................................................... 3-5
Practice Solution 3-1: Using Object Browser ............................................................................................ 3-6
Practice Solution 3-2: Using SQL Commands and SQL Scripts ................................................................ 3-19
Practice Solution 3-3: Using Utilities ........................................................................................................ 3-27

n
a
r
t
n-

no
a
Practices for Lesson 4: Building a Database Application........................................................................
4-1
s
a
h
Practice 4-1: Creating Applications ..........................................................................................................
4-2
) de
m
Practice Solution 4-1: Creating Applications .............................................................................................
4-3
o
c Gui

e
l
Practices for Lesson 5: Creating Reports ................................................................................................
5-1
c ent
a
r
Practices for Lesson 5.............................................................................................................................
5-2
tud
@oReportS...................................................................
i
Practice 5-1: Building and Manipulating an Interactive
5-3
e
b
s
i
aReport .......................................................................................
Practice 5-2: Customizing an Interactive
5-5
th
b.....................................................................................................
a
e

Practice 5-3: Creating Classic Reports


5-6
s
a
u
c
n
Practice Solution 5-1: Building
and
Manipulating
an
Interactive
Report
.....................................................
5-7
o
ia seantInteractive Report.......................................................................... 5-38
bCustomizing
(
Practice Solutioni 5-2:
e 5-3: lCreating
enClassic Reports ....................................................................................... 5-46
b
Practice a
Solution
c
i
Abfor Lesson 6: Creating Forms................................................................................................... 6-1
Practices
a
anc Practices for Lesson 6............................................................................................................................. 6-2

Bi

Practice 6-1: Creating a Form on a Table................................................................................................. 6-3


Practice 6-2: Creating a Master Detail Form ............................................................................................. 6-4
Practice 6-3: Creating a Tabular Form ..................................................................................................... 6-5
Practice Solution 6-1: Creating a Form on a Table ................................................................................... 6-6
Practice Solution 6-2: Creating a Master Detail Form ............................................................................... 6-16
Practice Solution 6-3: Creating a Tabular Form ........................................................................................ 6-32

Practices for Lesson 7: Working with Pages and Regions ...................................................................... 7-1
Practices for Lesson 7............................................................................................................................. 7-2
Practice 7-1: Working with Pages and Regions ........................................................................................ 7-3
Practice Solution 7-1: Working with Pages and Regions ........................................................................... 7-5
Practices for Lesson 8: Understanding Session State and Debugging................................................... 8-1
Practices for Lesson 8............................................................................................................................. 8-2
Practice 8-1: Understanding Session State .............................................................................................. 8-3
Practice 8-2: Debugging Your Application ................................................................................................ 8-4
Practice Solution 8-1: Understanding Session State ................................................................................. 8-5
Practice Solution 8-2: Debugging Your Application ................................................................................... 8-20
Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Oracle Application Express: Developing Web Applications Table of Contents


i

le

b
fera

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

Practices for Lesson 9: Adding Items and Buttons ................................................................................. 9-1


Practices for Lesson 9............................................................................................................................. 9-2
Practice 9-1: Adding Items and Buttons ................................................................................................... 9-3
Practice 9-2: Manipulating Items.............................................................................................................. 9-4
Practice 9-3: Creating an Upload and Download Page ............................................................................. 9-6
Practice Solution 9-1: Adding Items and Buttons ...................................................................................... 9-7
Practice Solution 9-2: Manipulating Items................................................................................................. 9-23
Practice Solution 9-3: Creating an Upload and Download Page ................................................................ 9-48
Practices for Lesson 10: Including Page Processing .............................................................................. 10-1
Practices for Lesson 10: Creating Page Processes .................................................................................. 10-2
Practice 10-1: Creating and Manipulating Computations, Processes, and Validations ................................ 10-3
Solution to Practice 10-1: Creating and Manipulating Computations, Processes, and Validations............... 10-5
Practices for Lesson 11: Using Application and Page Utilities................................................................ 11-1
Practices for Lesson 11 ........................................................................................................................... 11-3
Practice 11-1: Using the Advisor .............................................................................................................. 11-4
Practice 11-2: Managing Your Attribute Dictionary.................................................................................... 11-5
Practice Solution 11-1: Using the Advisor................................................................................................. 11-6
Practice Solution 11-2: Managing Your Attribute Dictionary ...................................................................... 11-13

n
a
r
t
n-

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Practices for Lesson 12: Adding Shared Components That Aid Navigation ........................................... 12-1
Practices for Lesson 12 ........................................................................................................................... 12-2
Practice 12-1: Creating Lists and List Regions ......................................................................................... 12-3
Practice 12-2: Creating and Editing Standard Tabs .................................................................................. 12-4
Practice 12-3: Managing Help Text in Your Application............................................................................. 12-5
Practice 12-4: Adding Navigation Bar Entries ........................................................................................... 12-6
Practice 12-5: Adding Breadcrumbs and Tabs to an Existing Page ........................................................... 12-7
Practice Solution 12-1: Creating Lists and List Regions ............................................................................ 12-8
Practice Solution 12-2: Creating and Editing Standard Tabs ..................................................................... 12-16
Practice Solution 12-3: Managing Help Text in Your Application ............................................................... 12-24
Practice Solution 12-4: Adding Navigation Bar Entries .............................................................................. 12-30
Practice Solution 12-5: Adding Breadcrumbs and Tabs to an Existing Page .............................................. 12-38

A for Lesson 13: Displaying Dynamic Content............................................................................ 13-1


a
Practices
c
an

Bi

Practices for Lesson 13 ........................................................................................................................... 13-2


Practice 13-1: Using Dynamic Actions on Your Page................................................................................ 13-3
Practice 13-2: Importing and Using the Star Rating Plug-In....................................................................... 13-5
Practice 13-3: Creating and Modifying Flash Charts ................................................................................. 13-6
Practice 13-4: Creating a Calendar .......................................................................................................... 13-7
Practice 13-5: Creating a Tree Whose Nodes Link to a Different Page ...................................................... 13-8
Practice Solution 13-1: Using Dynamic Actions on Your Page .................................................................. 13-9
Practice Solution 13-2: Importing and Using the Star Rating Plug-In ......................................................... 13-35
Practice Solution 13-3: Creating and Modifying Flash Charts .................................................................... 13-45
Practice Solution 13-4: Adding a Calendar ............................................................................................... 13-54
Practice Solution 13-5: Creating a Tree Whose Nodes Link to a Different Page......................................... 13-62

Practices for Lesson 14: Working with Themes, Templates, and Files ................................................... 14-1
Practices for Lesson 14 ........................................................................................................................... 14-2
Practice 14-1: Working with Themes, Templates, and Files ...................................................................... 14-3
Practice Solution 14-1: Working with Themes, Templates, and Files ......................................................... 14-5
Practices for Lesson 15: Administering Oracle Application Express Workspaces................................. 15-1
Practices for Lesson 15 ........................................................................................................................... 15-2
Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Oracle Application Express: Developing Web Applications Table of Contents


ii

le

b
fera

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

Practice 15-1: Administering Oracle Application Express Workspaces ...................................................... 15-3


Practice Solution 15-1: Administering Oracle Application Express Workspaces ......................................... 15-4
Practices for Lesson 16: Implementing Security ..................................................................................... 16-1
Practices for Lesson 16: Implementing Security ....................................................................................... 16-2
Practice 16-1: Creating an Authentication Scheme ................................................................................... 16-3
Practice 16-2: Restricting Users By Using Access Control ........................................................................ 16-4
Practice Solution 16-1: Creating an Authentication Scheme...................................................................... 16-5
Practice Solution 16-2: Restricting Users By Using Access Control ........................................................... 16-11
Practices for Lesson 17: Deploying Your Application ............................................................................. 17-1
Practices for Lesson 17: Deploying an Application ................................................................................... 17-2
Practice 17-1: Deploying Your Application................................................................................................ 17-3
Practice Solution 17-1: Deploying Your Application .................................................................................. 17-4
Practices for Lesson 18: Building a Websheet Application ..................................................................... 18-1
Practices for Lesson 18 ........................................................................................................................... 18-2
Practice 18-1: Creating and Modifying a Websheet Application ................................................................. 18-3
Practice 18-2: Creating and Manipulating a Data Grid .............................................................................. 18-4
Practice Solution 18-1: Creating and Modifying a Websheet Application ................................................... 18-5
Practice Solution 18-2: Creating and Manipulating a Data Grid ................................................................. 18-14

n
a
r
t
n-

no
a
Practices for Lesson 19: Manipulating and Administrating a Websheet Application..............................
19-1
s
a
h
Practices for Lesson 19 ...........................................................................................................................
19-2
) de
m
Practice 19-1: Adding and Manipulating Sections on a Page ....................................................................
19-3
o
c t Gui
e
Practice 19-2: Interacting with the Database ............................................................................................
19-4
l
c en
a
Practice 19-3: Sharing Websheets Between Users ...................................................................................
19-5
r
o
ud....................................................... 19-6
Practice Solution 19-1: Adding and Manipulatingi@
Sections on atPage
S
e
bDatabaseth...............................................................................
is
Practice Solution 19-2: Interacting with the
19-16
a
b
a
Practice Solution 19-3: Sharing Websheets
Between
Users
.....................................................................
19-26
e
us the Application Development Process ................. 20-1
ca andtoMaintaining
n
Practices for Lesson 20: a
Managing
b20i...........................................................................................................................
(
Practices for Lesson
20-2
se
i
n
e
e
b
Practice a
20-1:
Adding lFeatures
and
Milestones
to
Your
Development
Project
...........................................
20-3
c
i
b20-2: Adding and
Practice
Monitoring Feedback in Your Application ......................................................... 20-5
A
a
c
an Practice Solution 20-1: Adding Milestones and Features to Your Development Project.............................. 20-6

Bi

Practice Solution 20-2: Adding and Monitoring Feedback in Your Application ............................................ 20-21

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Oracle Application Express: Developing Web Applications Table of Contents


iii

le

b
fera

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

Bi

le

a
c
n
a
A
n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba
n
a
r
t
nb
fera

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

le

b
fera

n
a
r
t
n-

a
c
n
a

no
a
as
hLesson
Practices for
1:
)

e
m
Course
uid
coOverview
e
G
l
c ent
a
r
Chapter
o tu1 d
@
i
e is S
b
a
b e th
a

ca to us
n
a
bi nse
(
i
e lice
bab

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 1: Course Overview


Chapter 1 - Page 1

Practices for Lesson 1

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

Course Practices: Overview


There are no hands-on practices for this lesson.
Throughout the course practices, you create an Order Management application. The following
practices are mandatory:
Practice 2-1: Creates the developer user that you will use to create the Order Management
Application
Practice 2-2: Installs the database objects required for the rest of the practices
Practice 15-1: Creates the users to use in an Access Control list

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 1: Course Overview


Chapter 1 - Page 2

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

le

b
fera

n
a
r
t
n-

a
c
n
a

no
a
as
hLesson
Practices for
2:
)

e
m
Introduction
uidOracle
co t Gto
e
l
c en Express
a
Application
r
tu2 d
@oChapter
i
S
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Introduction to Oracle Application Express


Chapter 2 - Page 1

Practices for Lesson 2

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

Practices Overview
There are two practices for this lesson. In these practices, you log in to Oracle Application
Express and create the user that you will need for the rest of the practices in this course. You
also run a sample application and install a packaged application. The packaged application
creates an application definition and the database objects that you will need for this course.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Introduction to Oracle Application Express


Chapter 2 - Page 2

Practice 2-1: Using Oracle Application Express as a Workspace


Administrator

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

Overview
In this practice, you log in to the Oracle Application Express workspace and create a developer
user.

Assumptions
N/A

Tasks
a.

Log in to Oracle Application Express with the following details:


Workspace: ora<n>
Username: ora<n>_admin
Password: ora<n>

Create a developer user with the following details:


Username and Password: ora<n>
Email: ora<n>@oracle.com

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Introduction to Oracle Application Express


Chapter 2 - Page 3

n
a
r
t
n-

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

b.

a
c
n
a

le

b
fera

Practice 2-2: Using Oracle Application Express as a Developer


Overview

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

In this practice, you log in to Oracle Application Express as a Developer, run a sample
application, and install a packaged application.

Assumptions
You have created the ora<n> user from the previous practice.

Tasks
a.

b.

n
Bia

Log in to Oracle Application with the following details:


Workspace: ora<n>
Username: ora<n>
Password: ora<n>
Run the sample application.

le

b
fera

n
a
r
t
n-

no
a
c. Install the packaged application and its supporting objects from
as the following location:
h
)
/home/oracle/labs/oehr/oehr_object_app_installer.sql
e
m
d
o
i
c G
required
Note: This application installs the database objects
foru
the rest of the practices in
e
l
t
c
this course.
n
ra de
o
i@ s Stu
e
b
i
a
h
t
b
a
e
a
us
c
n
o
t
a
bi nse
(
i
abe lice
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Introduction to Oracle Application Express


Chapter 2 - Page 4

Practice Solution 2-1: Using Oracle Application Express as a


Workspace Administrator

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

Overview
In this practice solution, steps to log in to the Oracle Application Express workspace and create
a developer user are provided.

Tasks
a.

Log in to Oracle Application Express with the following details:


Workspace: ora<n>
Username: ora<n>_admin
Password: ora<n>
1)

Enter the following URL in your browser address bar:


http://<instructor_machine_name>:8080/apex

n
a
r
t
n-

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

2)

a
c
n
a

le

b
fera

On the Login page, enter ora<n> for Workspace, ora<n>_admin for Username, and
ora<n> for Password, and click Login.

Bi

3)

4)
5)

If you are prompted to change your password, enter the old and new passwords and
click Apply Changes. (You can enter the current password as your new password.)

Click Return.
You will be directed to log in again. Enter the new password and click Login.
Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Introduction to Oracle Application Express


Chapter 2 - Page 5

6)

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

b.

You have successfully logged in to the Oracle Application Express application as an


administrator user.

Create a developer user with the following details:


Username and Password: ora<n>
Email: ora<n>@oracle.com
1)

Click the down arrow on the Administration tab and select Manage Users and
Groups.

le

b
fera

n
a
r
t
n-

a
c
n
Bia

no
a
has
)
om uide
c

cle ent G
a
r
2) Click Create User >.
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
3) Enter
ora<n>
ic for Username and ora<n>@oracle.com for Email Address.
a
l
b
A

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Introduction to Oracle Application Express


Chapter 2 - Page 6

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

4)

Scroll down and verify the account privileges. Make sure that User is a workspace
administrator is set to No and User is a developer is set to Yes.

le

5)

b
fera

Scroll down and enter ora<n> for Password and Confirm Password. Select No for
Require Change of Password on First Use.

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b andthclick
6) Scroll up to the top of the a
page
is Create User.
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
7) b
Click
a Logout.lic
aA

You have successfully created a developer user by logging in to the Oracle Application
Express application as a workspace administrator.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Introduction to Oracle Application Express


Chapter 2 - Page 7

Practice Solution 2-2: Using Oracle Application as a Developer


Overview

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

In this practice solution, the steps to log in to Oracle Application Express as a developer, run a
sample application, and install a packaged application are provided.

Tasks
a.

Log in to Oracle Application with the following details:


Workspace: ora<n>
Username: ora<n>
Password: ora<n>
1)

le

Enter ora<n> for Workspace, Username, and Password, and click Login.

b
fera

n
a
r
t
n-

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
You
have
successfully
logged in to Oracle APEX as a developer.
ic
a
l
b
A

a Run the sample application.


c
n
b.
Bia
1) Click the Application Builder icon from the Oracle APEX home page.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Introduction to Oracle Application Express


Chapter 2 - Page 8

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

2)

Click the Sample Database Application icon.

3)

Click the Run Application icon.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
o tud
@Password
i
S and click Login.
4) Enter ora<n> for User Namee
and
b
s
i
a
h
ab se t

a
nc to u
a
i
(b nse
i
e
ice
ab
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Introduction to Oracle Application Express


Chapter 2 - Page 9

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

5) The Sample Database Application displays. Click the various tabs and try to
understand what the application does.

le

b
fera

n
a
r
t
n-

Bi

no
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b toolbar
isthe bottom.
6) Click the Home button ona
the
at
h
t
b
a use
a
c
n
o
t
a
i
b
e
You have
i ( successfully
ns run the sample database application.
e
e
b
c
a
li
b
A
c.a Install the packaged application and its supporting objects from the following location:
c
n
/home/oracle/labs/oehr/oehr_object_app_installer.sql
a
1)

Navigate to the Application Builder page by clicking the Application Builder icon.

2)

Click the Import button.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Introduction to Oracle Application Express


Chapter 2 - Page 10

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

3)

Click the Browse button.

le

b
fera

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

4)

Browse to the /home/oracle/labs/oehr folder, select the


oehr_object_app_installer.sql script file, and click Open.

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Introduction to Oracle Application Express


Chapter 2 - Page 11

n
a
r
t
n-

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

5)

Click Next > to import the file.

le

b
fera

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
e and click Install.
a Schema
7) Select ora<n> fora
Parsing
s
u
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA
6)

n
a
r
t
n-

You have successfully imported the file. To install the application, click Next >.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Introduction to Oracle Application Express


Chapter 2 - Page 12

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

8)

To install the supporting objects for the application, ensure that Install Supporting
Objects is Yes and click Next >.

9)

Click Install to confirm the installation of supporting objects.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
10) Click Install Summary.
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Introduction to Oracle Application Express


Chapter 2 - Page 13

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

11) Review the Install Summary.

le

b
fera

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba
You have successfully installed a packaged application.

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Introduction to Oracle Application Express


Chapter 2 - Page 14

n
a
r
t
n-

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

le

b
fera

n
a
r
t
n-

a
c
n
a

no
a
as
hLesson
Practices for
3:
)

e
m
Interacting
uidthe Database
co t with
e
G
l
cUsing
nSQL Workshop
a
by
r
e
o
d
tu3
i@ Chapter
S
e
b
s
i
a
h
t
b
a
e
a
us
c
n
o
t
a
bi nse
(
i
e lice
bab

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 1

Practices for Lesson 3

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

Practices Overview
There are three practices for this lesson. In these practices, you use the components of SQL
Workshop to create and modify tables, upload and run scripts, build and save queries, and load
and unload data.
Hints in the form of SQL queries have been provided in case you are not familiar with writing
SQL queries.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 2

Practice 3-1: Using Object Browser


Overview

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

In this practice, you use the Object Browser to view, create, and modify tables.

Assumptions
You should have performed Practice 2-1.

Tasks
a.

Create a table called OEHR_AUDITS with the following details:


Column Name

Data Type

Other Details

CUSTOMER_ID (PK)

NUMBER

Not populated

CREATED_BY

VARCHAR2

Scale 40

CREATED_ON

DATE

N/A

le

b
fera

n
a
r
t
n-

no
a
b. Review the data in the OEHR_ORDERS table.
has
)
e
obymusingutheidORDER_MODE
c. Create a lookup table for the OEHR_ORDERS table
column.
c

G
t
Follow the following naming convention: cle
ra den
o
Table name: OEHR_ORDER_MODE_LOOKUP
i@ s Stu
e
Sequence name: OEHR_ORDER_MODE_LOOKUP_SEQ
b
i
a to thethdata
b
What do you think will
happen
in both tables after the lookup table is
a
e

s
a
u
c
created?
n
o
t
a
i
b
e
(
s
i the
nfrom
e
e
d. Display
data
the OEHR_COUNTRIES table and save the data in a spreadsheet.
b
c
i
a
l
b
A

a e.
c
n
Bia

Change the data type for the JOB_TITLE column in the OEHR_JOBS table to char and
the length to 300.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 3

Practice 3-2: Using SQL Commands and SQL Scripts


Overview

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

In this practice, you use SQL Commands and SQL Scripts to upload, save, and run queries.

Assumptions
You have performed the previous practice.

Tasks
a.

Using SQL Commands, update the ORDER_DATE column in the OEHR_ORDERS table
by running the following query (located in /home/oracle/labs/files/lab31.txt).

le

UPDATE oehr_orders
SET order_date = order_date + 2290

b
fera

b.

a
c
n
Bia

n
a
r
t
n-

Upload the CreateTerritories.sql script file from the


/home/oracle/labs/files folder and name it Create Territory Table. Run
the script and confirm that it ran successfully.

no
a
has
)
om uide
c. Upload the get_sal.sql script file from the /home/oracle/labs/files
folder.
c

e nt G
Run the script and correct errors, if any. acl
r
o
de
u
t
@
i
S
ewhich was
d. Use the get_sal procedure,
created in the previous task, and execute a
b
s
i
a
h
t
b name,e employee
query that displays the
ID, and salary for employees. Also include
alast

s
a
u
c
a proposed salary,
which
should
be
40%
more
than the current salary.
n
o
t
a
i
Hint: (located
(b in /home/oracle/labs/files/lab3-2.txt)
se
i
n
e
e
SELECT
employee_id, salary CURRENT SALARY,
ic
ab last_name,
l
b
A
get_sal(employee_id, 1.4) PROPOSED SALARY
FROM oehr_employees;

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 4

Practice 3-3: Using Utilities


Overview

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

In this practice, you use SQL Workshop Utilities to build queries, load/unload data, and generate
data definition language (DDL).

Assumptions
You have performed the previous practice.

Tasks
a.
b.

Using Query Builder, create and save a query to retrieve the department ID, name,
city, state, and the country name for each department.
Load data from a flat file to a new database table called OEHR_STATES. The file is
located at /home/oracle/labs/files/states.txt. The data in the file is stored
as comma-separated values (CSV) and the first row in the file contains the column
names. Name the table columns STATE_ID and STATE_NAME. Accept the option to
create a new primary key and sequence. View the created table in Object Browser.

n
a
r
t
n-

n
Bia

no
a
c. Unload data from the OEHR_ORDERS table to a CSV file. Ensure
as that the table column
h
)
names are also included in the file. Save the file to the
/home/oracle/labs/files
e
m
d
o
i
folder.
c t Gu
e
l
c
d. Display data from the OEHR_JOBS tablera
in XML format,
n adhering to the canonical XML
e
o
d
specification.
i@ s Stu
e
b
i
a
h
t
b
a
e. Generate a DDL script
file
for
the
STATES
table and sequence. Name the file
e

s
a
u
c
states.sql. n
Downloado
and save the file to the /home/oracle/labs/files folder.
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 5

le

b
fera

Practice Solution 3-1: Using Object Browser


Overview

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

In this practice solution, the steps to view, create, and modify tables by using the Object
Browser are provided.

Tasks
a.

Create a table called OEHR_AUDITS with the following details.


Column Name

Other Details

CUSTOMER_ID (PK)

NUMBER

Not populated

CREATED_BY

VARCHAR2

Scale 40

CREATED_ON

DATE

N/A

A
a
2)
c
an

Click the down arrow in the Create button and select Table.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 6

le

b
fera

s
n
a
r
Navigate to the Object Browser page by selecting Object Browser fromnthe
-t SQL
o
Workshop tab menu.
n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

1)

Bi

Data Type

3)

A Create Table wizard opens. Enter OEHR_AUDITS for Table Name, and then fill out
the columns by using the following details. Then, click Next >.

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

Column Name

Data Type

Other Details

CUSTOMER_ID (PK)

NUMBER

Not populated

CREATED_BY

VARCHAR2

Scale 40

CREATED_ON

DATE

N/A

le

b
fera

n
a
r
t
n-

4)

no
a
has
)
om uide
c

G
t
cleCUSTOMER_ID(NUMBER)from
n
Select Not populated for Primary Key.ra
Select
the drope
o
d
u
down list for Primary Key and click
Next
>.
t
i@ s S
e
b
i
a
h
t
b
a
e
a
us
c
n
o
t
a
bi nse
(
i
e lice
bab

a
c
n
a

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 7

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

5)

You do not want to create a foreign key. Click Next >.

le

b
fera

n
a
r
t
n-

6)

n
a
You do not want to create constraints. Click Next >.
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

a
c
n
a

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 8

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

7)

Click Create to create the table.

le

b
fera

a
c
n
Bia

s
n
a
r
t
-page.
8)
The OEHR_AUDITS table is created and displayed on the Object Browser
n
o
n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens created a table.
e
You
have successfully
b
ic
a
l
b
A

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 9

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

b. Review the data in the OEHR_ORDERS table.


1)
Select OEHR_ORDERS from the Object Selection pane of the Object Browser page.

le

b
fera

n
a
r
t
n-

2)

no
a
has
)
om uide
c

cle ent G
a
r
ud pane. Click the Data tab.
tdetail
@oin the
i
The OEHR_ORDERS table is displayed
S
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

a
c
n
a

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 10

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

3)

Review the columns and the data they hold. Notice that the ORDER_MODE column is a
good candidate for a lookup table.

You have identified that a lookup table based on the ORDER_MODE column can be
created for the OEHR_ORDERS table.

s
n
a
r
c. Create a lookup table for the OEHR_ORDERS table by using the ORDER_MODE column.
-t Follow
n
o
the following naming convention:
n
a
Table name: OEHR_ORDER_MODE_LOOKUP
has
Sequence name: OEHR_ORDER_MODE_LOOKUP_SEQ
)
omafteruthe
idelookup table is
What do you think will happen to the data in both thec
tables
created?
cle ent G
a
r
1)
Click the Table tab for the OEHR_ORDERS
tud
@o Stable.
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
A Click the Create Lookup Table button.
2)
a
c
an

Bi

3)

Select ORDER_MODE - varchar2 for Column and click Next >.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 11

le

b
fera

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

4)

Enter OEHR_ORDER_MODE_LOOKUP for New Table Name and


OEHR_ORDER_MODE_LOOKUP_SEQ for New Sequence and click Next >.

5)

Review the details and click Finish.

le

b
fera

n
a
r
t
n-

6)

n
a
has
)
om uide
c

To view the data in the lookup table, click c


the
leData ntab.t G
a
r
o tude
@
i
e is S
b
a
b e th
a

ca to us
n
a
bi nse
(
i
e lice
bab

Bi

a
c
n
a

7)

View the columns and data in the new lookup table. Notice that the data from the
OEHR_ORDERS table has been added here and a new primary key column is inserted.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 12

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

8)

To view the data in the OEHR_ORDERS table, select OEHR_ORDER from the Object
Selection pane.

le

b
fera

n
a
r
t
n-

9)

no
a
has
)
om uide
c

cle ent G
a
r
o tud
@
i
S replaced with an ORDER_MODE_ID
e
Note that the ORDER_MODE b
column has
been
s
i
a
h
column.
ab se t

a
nc to u
a
i
(b nse
i
e
lice
bab

a
c
n
a

Bi

You have successfully created a lookup table.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 13

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

d. Display the data from the OEHR_COUNTRIES table and save the data in a spreadsheet.
1)
Select the OEHR_COUNTRIES table.

le

b
fera

n
a
r
t
n-

2)

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b clicktthe
Scroll down to the bottoma
and
isDownload link.
h
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

a
c
n
a

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 14

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

3)

Make sure that Open with the open office application is selected and click OK to save
the file.

le

b
fera

4)

s
n
a
r
t click OK
-and
Open Office will open. Ensure that Comma is selected for Separated by
n
o
n
to import the text.
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

a
c
n
a

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 15

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

5)

The data is displayed.

le

b
fera

n
a
r
t
n-

no
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b thcolumn
is in the OEHR_JOBS table to char and the
e. Change the data type for the JOB_TITLE
a
b
a use
length to 300.
a
c
n
o
1)
Select the OEHR_JOBS
table.
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
A
a
c
an

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 16

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

2)

Click the Table tab.

3)

Click Modify Column.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

4)
Select JOB_TITLE(VARCHAR2) for Column.
cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 17

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

5)

Select CHAR for Datatype, enter 300 for Length, and click Next >.

6)

Click Finish.

le

n
a
r
t
n-

n
Bia

b
fera

n
a
has
)
om uide
c

7)
Review the change in the table.
cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA
You have successfully modified a table.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 18

Practice Solution 3-2: Using SQL Commands and SQL Scripts


Overview

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

In this practice solution, the steps to upload, save, and run queries by using SQL Commands
and SQL Scripts are provided.

Tasks
a.

Using SQL Commands, update the ORDER_DATE column in the OEHR_ORDERS table
by running the following query (located in /home/oracle/labs/files/lab31.txt).
UPDATE oehr_orders
SET order_date = order_date + 2290
1)

le

Select SQL Commands from the SQL Workshop tab menu.

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
2) Enter
the
following
command
and click Run.
(
s
i
n
e
e
babUPDATElicoehr_orders

SET order_date = order_date + 2290

Bi

3)

b.

View the output on the Results tab.

Upload the CreateTerritories.sql script file from the


/home/oracle/labs/scripts folder and name it Create Territory Table. Run
the script and confirm that it ran successfully.
Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 19

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

1)

Select SQL Scripts from the SQL Workshop tab menu.

2)

Click the Upload > button.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
3) Click Browse and locate the file to upload.
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 20

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

4)

Select /home/oracle/labs/files/CreateTerritories.sql and click


Open.

le

b
fera

n
a
r
t
n-

Bi

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b for
is
a
h
5) Enter Create Territories
Script Name and click Upload.
t
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

6)

The file was successfully loaded into SQL Scripts. Click the Run icon to run the
script.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 21

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

7)

Click Run Now.

8)

Click View Results.

le

b
fera

n
a
r
t
n-

n
a
has
)
9) The script ran without errors.
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
licsuccessfully uploaded and run a script file.
ba You have

Bi

A
a
c
an c.

Upload the get_sal.sql script file from the /home/oracle/labs/files folder.


Run the script and correct errors, if any.
1)

Click the SQL Scripts breadcrumb.

2)

Click the Upload button.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 22

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

3)

Click Browse. Locate /home/oracle/labs/files/get_sal.sql and click


Open. Then, click Upload.

4)

Run the script by clicking the Run icon.

le

b
fera

n
a
r
t
n-

Bi

a
c
n
a

n
a
5) Click Run Now.
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba
6)

Click View Results.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 23

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

7)

Notice that the script has an error. Click Edit Script.

8)

Notice that the statement in line 6 is missing a semicolon at the end. Correct the
code and click Run.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
nNow. to
a
i
9) Click b
Run
(
se
i
n
e
e
lic
bab

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 24

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

10) Click View Results.

11) The script ran without errors this time.

le

b
fera

n
a
r
t
n-

n
Bia

no
a
hasfile.
You have successfully uploaded, edited, and run a)script
om uide
c

G task, and execute a


d. Use the get_sal procedure, which wasacreated
cle inenthet previous
r
o tID,
dand salary for employees. Also include
query that displays the last name, employee
uthan
@
i
S
a proposed salary, which should
be 40% more
the current salary.
e
b
s
i
a
h
Hint: (located in /home/oracle/labs/files/lab3-2.txt)
ab se t

a
u
SELECT last_name,
salary CURRENT SALARY,
nc temployee_id,
o
a
i
b nse
1.4) PROPOSED SALARY
(get_sal(employee_id,
i
e
e
FROM
ic
ab oehr_employees;
l
b
aA
1)

Select SQL Commands from the SQL Workshop menu.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 25

2)

Enter the following query and click Run.

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

SELECT last_name, employee_id, salary CURRENT SALARY,


get_sal(employee_id, 1.4) PROPOSED SALARY
FROM oehr_employees;

3)

View the output on the Results tab.

le

b
fera

n
a
r
t
n-

a
c
n
a

no
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i (successfully
ns ran a SQL command that used the get_sal function that you
e
e
b
You
c
li
ba
created in the previous task.

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 26

Practice Solution 3-3: Using Utilities


Overview

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

In this practice solution, the steps to build queries, load/unload data, and generate DDL by using
SQL Workshop Utilities are provided.

Tasks
a.

Using Query Builder, create and save a query to retrieve the department ID, name,
city, state, and the country name for each department.
1)

Select Query Builder from the SQL Workshop tab menu.

le

b
fera

n
a
r
t
n-

a
c
n
Bia

no
a
has
)
om uide
c

cle ent G
a
r
tudOEHR_DEPARTMENTS,
@oselectSthe
2) From the Object Selectionepane,
i
bOEHR_COUNTRIES
is
OEHR_LOCATIONS, and
tables. They will appear in the Display
a
h
t
b
a
e
pane.
a
us
c
n
o
t
a
bi nse
(
i
abe lice
b
A

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 27

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

3)

Select the columns that you want to retrievenamely, DEPARTMENT_ID and


DEPARTMENT_NAME from the OEHR_DEPARTMENTS table; CITY and
STATE_PROVINCE from the OEHR_LOCATIONS table; and, COUNTRY_NAME from
the COUNTRIES table.

le

b
fera

Bi

a
c
n
a

s
n
a
r
-t
4) Now you want to join these tables. To join the OEHR_DEPARTMENTSnand
o
n column in
OEHR_LOCATION tables, select the join column for the LOCATION_ID
a
the OEHR_DEPARTMENTS table, and then click the join column
has for the
LOCATION_ID column in the OEHR_LOCATIONS table.
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

5)

Similarly, join the OEHR_LOCATIONS and OEHR_COUNTRIES table on the


COUNTRY_ID column.

6)

Click the Run button.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 28

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

7)

The output is displayed on the Results tab of the Output pane.

8)

To save the query, click the Save button.

9)

Enter a name for the query and click Save.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

G pane.
t
ctableof the
10) The query is listed on the Saved SQL
Output
n
a
r
o tude
@
i
e is S
b
a
b e th
a

ca to us
n
a
bi nse
(
i
e lice
bab

Bi

b.

You have successfully created and saved a query by using Query Builder.
Load data from a flat file to a new database table called OEHR_STATES. The file is
located at /home/oracle/labs/files/states.txt. The data in the file is stored
as comma-separated values (CSV) and the first row in the file contains the column
names. Name the table columns STATE_ID and STATE_NAME. Accept the option to
create a new primary key and sequence. View the created table in the Object Browser.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 29

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

1)

Select Data Workshop from the SQL Workshop tab menu.

2)

From the Data Load pane, click Text Data.

le

b
fera

n
a
r
t
n-

a
c
n
a

no
a
has
)
om uide
c

le nt G
cLoad
a
3) Ensure that New table is selected rfor
To
eand Upload file for Load From and
o
d
u
click Next >.
t
i@ s S
e
b
i
a
h
t
b
a
e
a
us
c
n
o
t
a
bi nse
(
i
e lice
bab

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 30

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

4)

Click Browse.

le

b
fera

5)

a
c
n
a

n
a
r
t
n-

Select the /home/oracle/labs/files/states.txt file and click Open.

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 31

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

6)

Click Next >.

le

b
fera

7)

a
c
n
a

n
a
r
t
n-

Enter OEHR_STATES for Table Name. Change the first column name to STATE_ID
and click Next >.

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 32

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

8)

Select Use an existing column for Primary Key From and make sure that
STATE_ID(VARCHAR2) is selected for Primary Key and click Load Data.

le

b
fera

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
s
10) Click
i ( Object
nBrowser.
e
e
b
c
li
ba
9)

n
a
r
t
n-

To view the created table, click the SQL Workshop breadcrumb.

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 33

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

11) From the Object Selection pane, locate and click the OEHR_STATES table.

le

b
fera

n
a
r
t
n-

Bi

a
c
n
a

n
a
has
)
12) View the created table.
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

You have successfully loaded a table stored in a text file to the Oracle database.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 34

c.

Unload data from the OEHR_ORDERS table to a CSV file. Ensure that the table column
names are also included in the file. Save the file to the /home/oracle/labs/files
folder.

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

1)

Select Data Workshop from the SQL Workshop tab menu.

le

b
fera

no
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
3) Select
for table and select all the columns. Click Next >.
i ( OEHR_ORDERS
ns
e
e
b
c
li
ba
2)

a
c
n
a

n
a
r
t
n-

From the Data Unload pane, select to Text.

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 35

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

4)

Select the Include Column Names check box and click Unload Data.

5)

Select Save File and click OK. Your file should be saved to the Desktop.
Note: If you select the Open with option, you need to associate gedit. To do this,
select Other from the drop-down list and navigate to /usr/bin/gedit.

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 36

le

b
fera

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

6)

If you open the file (use gedit), it will look similar to the following:

le

b
fera

n
a
r
t
n-

n
Bia

no
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b thtable
is data to a text file and saved it in your local
a
b
You have successfully
unloaded
a use
file system. ca
n
o
t
a
i
d. Display data
from theeOEHR_JOBS
table in XML format, adhering to the canonical XML
b
(
s
i
n
specification.
abe lice
b
aA
1)

Select Data Workshop from the SQL Workshop tab menu.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 37

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

2)

From the Data Unload pane, select to XML.

3)

Select OEHR_JOBS for Table and select all the columns. Click Unload Data.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 38

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

4)

The XML is displayed. (If the XML opens in the same browser, click the Back
button.)

le

b
fera

n
a
r
t
n-

n
Bia

no
a
has
You have successfully displayed table data in XML)format.
e the file
e. Generate a DDL script file for the STATES table c
and
sequence.
om
idName
u

G
states.sql. Download and save the filec
tole
the /home/oracle/labs/files
folder.
t
n
a
r
o tude
@
i
S tab menu. (Click the Back button in your
1) Select Utilities from thebSQL
e Workshop
s
i
a
h
browser to return tobAPEX development,
if required.)
t
a
e

s
a
nc to u
a
i
(b nse
i
e
ice
ab
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 39

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

2)

Click Generate DDL.

le

b
fera

3)

a
c
n
a

Click Create Script >.

n
a
r
t
n-

no
a
has
)
om uide
c

4) Ensure that your schema is selected and


>.
tG
cleclickeNext
n
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic As Script File for output. Select the Table and Sequence object type
b5)a Select lSave
check boxes and click Next >.

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 40

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

6)

Locate and check OEHR_STATES_SEQ and OEHR_STATES (not shown in the


screenshot) and click Generate DDL.

7)

Enter states.sql for Script Name and click Create Script.

le

b
fera

a
c
n
a

n
a
r
t
n-

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba
8)

The DDL script has been generated. Select the edit pencil icon for the
states.sql script.

9)

The DDL is displayed.

Bi

You have successfully generated DDL.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 41

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop
Chapter 3 - Page 42

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

le

b
fera

n
a
r
t
n-

a
c
n
a

no
a
as
hLesson
Practices for
4:
)

e
m
Building
uid
coatDatabase
e
G
l
c en
a
Application
r
tu4 d
@oChapter
i
S
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Building a Database Application


Chapter 4 - Page 1

Practice 4-1: Creating Applications


Overview

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

In this practice, you create database applications in three different ways: from a spreadsheet,
from scratch, and instantly.

Assumptions
You have performed the previous practices or imported LAB03_SOLN.SQL.

Tasks
a.

Create an application named Tasks based on the tasks.txt file available in the
/home/oracle/labs/files folder. The file has tab-delimited information and the
first row contains the column names. Name the table where the data from the file is
uploaded to as Tasks. Ensure that the data is displayed as an interactive report and
can be edited, if required. Use Theme 1 for the application.

no
a
has
)
om Inuthe
iderest of the practices in
c

c. Create an instant application named Order Management.


Gpages, regions, processes
t
cleby creating
n
this course, you will complete this application
a
r
o tude
and so on.
@
i
e is S
b
a
b e th
a

ca to us
n
a
bi nse
(
i
abe lice
b
A
b.

a
c
n
Bia

n
a
r
t
n-

Create an application named Customers that has the Report and Form pages based
on the DEMO_CUSTOMERS table. Specify no tabs and no authentication for the
application. Use DD-MON-YYYY as the date format and use Theme 20.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Building a Database Application


Chapter 4 - Page 2

le

b
fera

Practice Solution 4-1: Creating Applications


Overview

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

In this practice solution, the steps to create applications from a spreadsheet, from scratch, and
instantly are provided.

Tasks
a.

Create an application named Tasks based on the tasks.txt file available in the
/home/oracle/labs/files folder. The file has tab-delimited information and the
first row contains the column names. Name the table where the data from the file is
uploaded to as Tasks. Ensure that the data is displayed as an interactive report and
can be edited, if required. Use Theme 1 for the application.
1)

le

b
fera

Navigate to Application Builder > Database Applications.

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
2) On the Application
Builder
n
o home page, click Create >.
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Building a Database Application


Chapter 4 - Page 3

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

3)

Select Database and click Next >.

4)

Select From Spreadsheet and click Next >.

le

b
fera

n
a
r
t
n-

a
c
n
a

no
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
5)
Select
ic file, comma separated (*.csv) or tab delimited and click Next >.
lUpload
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Building a Database Application


Chapter 4 - Page 4

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

6)

Click the Browse button or select the Text File field.

7)

Select the tasks.txt file from the /home/oracle/labs/files folder and


click Open.

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

8)

To specify that the data is tab delimited, enter \t in the Separator field. Ensure
that the First row contains column names check box is selected and click Next
>.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Building a Database Application


Chapter 4 - Page 5

le

b
fera

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

9)

For Table Name, enter TASKS. Note that you can see all the data sorted as rows
and columns. Click Next >.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

le nt G
c
a
r
10) Enter TASKS for Plural Name and
oclick Next
d>.e
u
t
@
i
e is S
b
a
b e th
a

ca to us
n
a
bi nse
(
i
e lice
bab

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Building a Database Application


Chapter 4 - Page 6

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

11) Ensure that Application Name is TASKS, Create Mode is Read and Write, and
Report Implementation is Interactive. Click Next >.

12) Select Theme 1.

le

b
fera

n
a
r
t
n-

Bi

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
e
13) Click Next >. aa
s
u
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

14) Click Create. The Tasks application is created.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Building a Database Application


Chapter 4 - Page 7

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

15) To view the application, click Run Application.

16) For Username and Password, use ORA<n> and ORA<n>, respectively (where n is
the number that you are assigned). Click Login.

le

b
fera

n
a
r
t
n-

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

17) The home page of the Tasks application is displayed. It displays an interactive
report by using the data from the flat file. Click Home from the developer toolbar to
return to the development environment.

a
c
n
a

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Building a Database Application


Chapter 4 - Page 8

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

b.

Create an application named Customers that has the Report and Form pages based
on the DEMO_CUSTOMERS table. Specify no tabs and no authentication for the
application. Use DD-MON-YYYY as the date format and use Theme 20.
1)

Navigate to the Application Builder home page and click Create >.

2)

Select Database and click Next >.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b is selected
3) Ensure that From Scratch
is and click Next >.
a
h
t
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Building a Database Application


Chapter 4 - Page 9

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

4)

Enter Customers and click Next >.

5)

Select Report and Form for page type. Click the up button for Table Name and
select DEMO_CUSTOMERS. Ensure that Implementation is Interactive and click Add
Page.

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

6)

Click Next >.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Building a Database Application


Chapter 4 - Page 10

le

b
fera

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

7)

Select No Tabs and click Next >.

8)

Accept the default and click Next >.

le

b
fera

n
a
r
t
n-

a
c
n
a

no
a
has
)
om uDD-MON-YYYY
ide
c
9) Select No Authentication for Authentication
Scheme,
format for

e nt G
l
c
Date, and click Next >.
ra de
o
i@ s Stu
e
b
i
a
h
t
b
a
e
a
us
c
n
o
t
a
bi nse
(
i
e lice
bab

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Building a Database Application


Chapter 4 - Page 11

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

10) Scroll down and select Theme 20.

le

b
fera

11) Click Next >.

n
a
r
t
n-

a
c
n
a

n
a
as
12) Review the information displayed and click Create.) h
e
m
d
o
i
ec nt Gu
l
c
ra de
o
i@ s Stu
e
b
i
a
h
t
b
a
e
a
us
c
n
o
t
a
bi nse
(
i
e lice
bab

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Building a Database Application


Chapter 4 - Page 12

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

13) On the Customers application home page, click the Run Application icon.

14) The Demo Customers interactive report page is displayed. Click the edit pencil
icon next to one of the customers.

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Building a Database Application


Chapter 4 - Page 13

le

b
fera

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

15) The Demo Customers form page is displayed. Click Home from the Developer
toolbar.

le

b
fera

n
a
r
t
n-

n
Bia

no
a
as
h
)
of the practices in
c. Create an instant application named Order Management.
In the e
rest
m
d
o
i
this course, you will complete this application by
pages,
u regions, processes
eccreating
G
l
t
and so on.
c
ra den
o
i@ home
Stupage and click Create >.
e
1) Navigate to the Application
Builderis
b
ba e th
a

ca to us
n
a
bi nse
(
i
abe lice
b
a A 2) Select Database for Application Type and click Next >.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Building a Database Application


Chapter 4 - Page 14

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

3)

Click the Instant Application link.

4)

Enter Order Management for Name and click Create.

le

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Building a Database Application


Chapter 4 - Page 15

b
fera

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

5)

An instant application with an empty Home page and the default Application
Express Authentication login page is created. You will complete this application in
the rest of the practices in this course.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Building a Database Application


Chapter 4 - Page 16

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

le

b
fera

n
a
r
t
n-

a
c
n
a

no
a
as
hLesson
Practices for
5:
)

e
m
Creating
uid
co Reports
e
G
l
c ent
a
r
Chapter
o tu5 d
@
i
e is S
b
a
b e th
a

ca to us
n
a
bi nse
(
i
e lice
bab

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 1

Practices for Lesson 5


Practices Overview

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

There are three practices for this lesson. In these practices, you build and manipulate an
interactive report, customize an interactive report, and create a SQL report and a wizard report.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 2

Practice 5-1: Building and Manipulating an Interactive Report


Overview

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

In this practice, you create and manipulate two interactive reports.

Assumptions
You have performed the previous practices or imported both the LAB03_SOLN.SQL and
LAB041_ORDER_MGMT_SOLN.SQL packaged applications.

Tasks
a.

Create an interactive report to display all the columns from the OEHR_CUSTOMERS
table on a new page in the Order Management application. Name the page Customers
and give the region the Customer Report. Perform the following customizations to the
report:
Create a filter on the city of Philadelphia.
Create a highlight where Credit Limit is greater than 2500.
Display only the customer name, address, and credit limit.
Delete the filter that you created previously.
Display the rows in ascending order by state.
Display only five rows to see how pagination works.

n
a
r
t
n-

a
c
n
Bia

no
a
has
)
om uide
c

e noft customers
G
clnumber
Create a Group By report to display
the
in a particular
a
r
e
o
d
province or state. Change the pagination
to
display
all
rows.
i@
Stu
e
Save the report as a private
reportis
called My Report.
b
th state.
ba to eits original
a
Reset the primary
report

us
nca rowtoview.
Displayiaasingle
(b nse
i
e
ice report on a new page in the Order Management application to
ab an interactive
l
b. bCreate
A display details (employee_id, first_name, last_name, manager_id, and

commission_pct) from the OEHR_EMPLOYEES table about who earns a commission.


Name the page and the report Employee Commissions. From the Create Report
wizard, create a breadcrumb for the page and select the Home page as the parent
page. After creating the report, make the following customizations to the report:
Management proposes to increase the commission of employees whose existing
commission percentage is less than or equal to 0.15. Create a computed column,
called New Commission, to display the new commission. The new commission
scheme includes:
Employees with a commission percentage of 0.1 will get an additional
commission of 0.15.
Employees with a commission percentage of 0.15 will get an additional
commission of 0.05.
Create a control break on Manager ID.
Display the maximum commission earned by employees under each manager.

Download the HTML report.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 3

le

b
fera

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

Save all the customizations that you have made to this report so that it is available
to other managers but is not the default report. Name the saved report as
Commission Proposal.
Reset the Primary Report.
Note: To use the print services functionality, BI Publisher must be running on the
server (instructor) machine.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 4

Practice 5-2: Customizing an Interactive Report


Overview

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

In this practice, you customize an interactive report that you created in the previous practice.

Assumptions
You have performed the previous practices or imported both the LAB03_SOLN.SQL and
LAB051_ORDER_MGMT_SOLN.SQL packaged applications.

Tasks
a.

Make the following customizations to the Employee Commissions report:

Hide EMPLOYEE_ID and change MANAGER_ID to be the FIRST_NAME and


LAST_NAME of the manager.

Remove the Highlight option from the Actions menu.


Add the PDF download format.
Remove the Single Row View icon for each row in the report.
Run the report and confirm the changes that you made.

a
c
n
a

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 5

n
a
r
t
n-

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

le

b
fera

Practice 5-3: Creating Classic Reports


Overview

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

In this practice, you create two classic reports and edit the attributes of the reports.

Assumptions
You have performed the previous practices or imported both the LAB03_SOLN.SQL and
LAB052_ORDER_MGMT_SOLN.SQL packaged applications.

Tasks
a.

b.

n
Bia

On a new page in the Order Management application, create a SQL report. Name the
new page and the report Top Tier Salary. The report should display the last name,
email, and salary of employees who earn between $5,000 and $12,000 from the
OEHR_EMPLOYEES table. The report should contain a search bar. Accept all other
defaults.
On a new page in the Order Management application, create a wizard report. Name
the page and the report Customer Address List. The report should display the address
information of the customers, such as the first and last names, address, city, and state
from the OEHR_CUSTOMERS table. Accept all other defaults.
Modify the Customer Address List report with the following requirements:
Change the report headings for CUST_FIRST_NAME and CUST_LAST_NAME to
First Name and Last Name, respectively.
Change the Pagination to Row Ranges X to Y of Z (with pagination).

n
a
r
t
n-

no
a
has
c.
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b andtadd
Review the query definition
isthe OEHR_COUNTRIES.COUNTRY_NAME
a
h
b
column to the report.
You
e will need to create a join.
a Hint:
s
a
u
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 6

le

b
fera

Practice Solution 5-1: Building and Manipulating an Interactive Report


Overview

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

In this practice, you create and manipulate two interactive reports.

Tasks
a.

Create an interactive report to display all the columns from the OEHR_CUSTOMERS
table on a new page in the Order Management application. Name the page Customers
and give the region the title Customer Report. Do not create a tab for the page now.
1) Navigate to the Order Management application home page and click Create Page >.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 7

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

2) Select Report and click Next >.

le

b
fera

n
a
r
t
n-

a
c
n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b his >.
a
3) Select Interactive Report
and clicktNext
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
A

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 8

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

4) Enter Customers for Page Name and Customer Report for Region Name and click
Next >.

5) Accept the default for tabs and click Next >.

le

b
fera

n
a
r
t
n-

n
Bia

no
a
s the Query Builder to
6) You can either directly enter the query to create the reporth
orause
)
create the query. Click Query Builder.
e
m
d
o
i
ec nt Gu
l
c
ra de
o
i@ s Stu
e
b
i
a
h
t
b
a
e
a
us
c
n
o
t
a
bi nse
(
i
abe lice
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 9

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

7) From the left pane, click the OEHR_CUSTOMERS table name.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
8) Click the Table Actions icon.
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA
9) Select the Check All check box and close the dialog box.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 10

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

10) Click the Return button.

le

b
fera

11) Click Next >.

a
c
n
a

n
a
r
t
n-

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 11

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

12) Click Finish.

le

13) The report is created. To view the report, click Run Page.

n
a
r
t
n-

n
Bia

b
fera

no
a
has
)
om uide
c

cle ent G
a
r
o tud
@
i
S for Username and Password, and click
e
14) If you the login window opens,
enter ora<n>
b
s
i
a
h
Login.
ab se t

a
nc to u
a
i
(b nse
i
e
ice
ab
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 12

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

15) The interactive report is displayed.

le

b
fera

Create a filter on the city of Philadelphia.


16) You want to show the records only for a particular city. Select City from the Column
Selector. Note that if you do not select a column, the search criteria you enter in the
next step will search all columns.

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

17) Enter phil in the search field and click Go. Note that the % wildcard is implied and is
not entered.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 13

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

18) A filter is applied and only the records that meet the search criteria are displayed.

Create a highlight where credit limit is greater than 2500.


19) To highlight only those customers whose credit limit is greater than 2500, click
Actions and select Format > Highlight.

a
c
n
a

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 14

n
a
r
t
n-

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

le

b
fera

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

20) Enter a name for the highlight, for example, Good Credit Rating. Specify a color for
the highlight, for example, select [yellow]. Select Credit Limit for Column, > for
Operator, and enter 2500 for Expression. Then, click Apply.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
21) The records that meet the criteria are highlighted.
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 15

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

Display only the customer name, address, and credit limit.


22) You do not want some of the columns to appear on the report. Click Actions and
select Select Columns.

le

b
fera

n
a
r
t
n-

a
c
n
Bia

no
a
has
)
om uide
c

le ntot G
cRemove
23) Shift-select the following columns and click
move them to the Do Not
a
r
e other
o
d
Display area. Note that you will still be
able touperform
tin the report. actions against these
@displayed
i
S
columns even though they areenot
b this
a
Customer Id
b
a use
Postal Code ca
n
o
t
a
i
Country
Id
b
e
i (Numberens
e
Phone
b
ic
a Language
l
b
Nls
A
Nls Territory
Cust Email
Account Mgr Id

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 16

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

24) Click Apply.

le

25) Only the columns that you selected appear in the report.

b
fera

n
a
r
t
n-

Bi

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Delete the filter that you created previously.


26) You want to delete the filter that you created earlier. Click the Remove Filter icon for
the City contains phil filter.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 17

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

Display the rows in ascending order by state.


27) You want to sort by State Province. Select the Column Header for State Province and
click the Sort Ascending icon.

le

b
fera

n
a
r
t
n-

n
Bia

no
a
The records are sorted by city in ascending order.
as
h
)
Display only five rows to see how pagination works. m
e
d
o
i
uin the report. Click Actions
cdisplayed
28) You want to change the number of rows thatle
are
G
t
c
> Rows Per Page > 5. Note that the default
isn15.
ra value
e
o
d
i@ s Stu
e
b
i
a
h
t
b
a
e
a
us
c
n
o
t
a
bi nse
(
i
abe lice
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 18

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

29) Note that only five rows are displayed. The pagination is automatically specified and
you can click the icon to move to the next page.

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 19

le

b
fera

Create a Group By report to display the number of customers in a particular province


or state. Change the pagination to display all rows.
30) To create a Group By report, click Actions and select Format > Group By.

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

31) You want to show a list of states and how many customers are contained in that state.
Select State Province for Group By Column, select Count for Functions, select
Customer Id for Column, and enter Number of Customers for the Label. Then click
Apply.

le

b
fera

n
a
r
t
n-

a
c
n
Bia

no
a
has
)
om uide
c

G
t
clethe report
32) Your Group By report is displayed. Because
does not have many rows, you
n
a
r
e Per Page and select All.
dRows
want to show them all. Click Actionsoand select
u
t
@
i
e is S
b
a
b e th
a

ca to us
n
a
bi nse
(
i
abe lice
b
A

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 20

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

33) The state provinces and the number of customers per state are displayed. To return to
the detail report, click the View Report icon.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 21

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

Save the report as a private report called My Report.


34) You want to save this report as a private report that is available only to you. Click
Actions and select Save Report.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
m uide
35) Enter My Report for Name and click Apply. co
cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

36) The report is saved. Select the Report drop-down list to see the list of reports.

Reset the primary report to its original state.


37) Select the Primary Report.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 22

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

38) To return to the default settings, click Actions and select Reset.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
39) Click Apply.
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a without
e customizations.
report
s
40) You see the original
a
u
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Display a single row view.


41) You can view a row at a time. Click a Single Row View icon for one of the rows.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 23

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

42) One row is displayed. You can click the > or < icons to scroll to the next or previous
row. You have completed this interactive report. Click the Application link at the
bottom of the page.

le

b
fera

n
a
r
t
n-

no
a
has
)
om uide
c

G
leOrder nManagement
b. Create an interactive report on a new page in the
application to display
t
c
a
r
e
details (employee_id, first_name, last_name,
and commission_pct)
o tudmanager_id,
@
from the OEHR_EMPLOYEES table about
who
earns
a
commission.
Name
the page and the
i
S
e
b
s
i
report Employee Commissions.
From
the
Create
Report
wizard,
create
a
breadcrumb
for
a
h
t
b
a
e
the page and select theaHome
page
s as the parent page.
u
ncservices
Note: To use theia
print
functionality,
BI Publisher must be running on the server
o
t
b
e
(
(instructor)imachine.
ns Management application page. Click Create Page >.
e
e
b
c
1) Navigate
to
the
Order
li
ba
A
a
c
n
a

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 24

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

2)

Select Report and click Next >.

le

b
fera

n
a
r
t
n-

a
c
n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
e Next >.
a and
s
a
u
3) Select Interactive
Report
click
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
A

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 25

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

4)

Enter Employee Commission for both Page Name and Region Name. Select
Breadcrumb for Breadcrumb and select Home for Parent Entry and click Next >.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

5) Accept the default and click Next >.


cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 26

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

6)

Enter the following SQL SELECT statement and click Next >. You can copy and paste
the SQL statement from /home/oracle/labs/files/commission.sql.
Alternatively, you can use the Query Builder button to create the report query.
SELECT employee_id, first_name, last_name, manager_id,
commission_pct
FROM OEHR_EMPLOYEES
WHERE commission_pct IS NOT NULL;

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

7) Click Finish.
cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

8)

Click Run Page to see the report that you just created.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 27

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

9)

If prompted, enter the login credentials.

10) Your report is displayed.

le

b
fera

n
a
r
t
n-

n
Bia

no
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
Management proposes to
aincrease
ethe commission of employees whose existing
s
a
u
c
commission percentage
is
less
than
equal to 0.15. Create a computed column
n totodisplay theornew
a
i
called New Commission
commission. The new commission
(b nse
i
scheme e
includes:
e
b
c
i
a
l
b
Employees with a commission percentage of 0.1 will get an additional
a A commission of 0.15.

Employees with a commission percentage of 0.15 will get an additional


commission of 0.05.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 28

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

11) To create a new computation, click Actions and select Format > Compute.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 29

12) Enter New Commission for Column Heading. The computation should add .15 to a
commission of .1 and .05 to a commission of .15. You will use the following CASE
statement to perform the computation.

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

CASE E WHEN 0.1 THEN E+0.15 WHEN 0.15 THEN E+0.05 ELSE E END
You can use the columns list, functions list, and keypad to enter the code in the
computation area or paste the previous CASE statement into the computation area.
When you select Commission Pct from Columns, notice that the letter corresponding
to the column appears in the computation area. This is the column alias. After entering
the code, click Apply.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 30

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

13) Note that the computed column now appears in the report.

le

b
fera

n
a
r
t
n-

n
Bia

no
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n on Manager
o
t
a
i
Create a control
break
ID.
b
e
(
s
i
n
14) Tobcreate
a control
break on the Manager ID, click the Manager Id column header and
ice Break
a ethe Control
l
b
click
icon. Alternatively, you can click Actions and select Format >
a A Control Break.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 31

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

15) Note that the column is eliminated and now appears before each breakpoint in the
report.

le

b
fera

n
a
r
t
n-

a
c
n
Bia

no
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
Display the maximum commission
earned by employees under each manager.
a
e

s
a
u
c tocommission
16) To find out then
maximum
earned by employees under each manager, click
a
i
Actions(and
select
Format
>
Aggregate.
b nse
i
e
ice
ab
l
b
A

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 32

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

17) Select Maximum from the function list. Select **New Commission (which is a
computed column) from the column list and click Apply.

18) The report now includes the maximum commission earned by employees under each
manager.

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 33

le

b
fera

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

Download the HTML report.


19) To download a report in multiple formats, click Actions and select Download.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
20) Click HTML.
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA
21) Click OK to view the report in a web browser.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 34

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

22) The HTML report is displayed on a new tab.

le

b
fera

n
a
r
t
n-

n
Bia

no
a
s it is available to
Save all the customizations that you made to this report so a
h that
Commission
other managers but is not the default report. Name the )
saved report
e
m
d
o
i
Proposal.
c t Gu
e
l
c
23) Click the Interactive report tab. To save a
that you made to this
nActions and
r all the customizations
e
d
report and make it available to other o
managers,
click
select Save Report.
@ Stu
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 35

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

24) Select As Default Reports Settings from the Save drop-down list.

25) You want to make this report available to other users. However, you do not want to
make it the default report. Select Alternative for Default Report Type, enter
Commission Proposal for Name, and click Apply.

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
26) The alternative report is nowblisted in the
is Reports drop-down list.
a
h
t
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA
Reset the Primary Report.
27) Select the Primary Report from the Reports drop-down list.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 36

le

b
fera

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

28) To reset this primary report to its original settings, click Actions and select Reset.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
29) Click Apply.
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( report
nsis reset to its original settings.
30) The
primary
e
e
b
c
li
ba
A
a

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 37

Practice Solution 5-2: Customizing an Interactive Report


Overview

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

In this practice, you customize the Employee Commission interactive report that you created in
the previous practice.

Tasks
a.

Make the following customizations to the Employee Commission report:


Hide the EMPLOYEE_ID column and change the MANAGER_ID to be the FIRST_NAME
and LAST_NAME of the manager.
1)

Navigate to the Employee Commission report page in the Order Management


application. Under Regions > Body, double-click Employee Commission report.

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
s
2) Click the
i (Source
ntab.
e
e
b
c
li
ba
A
a

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 38

le

b
fera

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

3)

Change the Region Source to the following query (located in


/home/oracle/labs/files/lab5-1.txt) and click Apply Changes.
SELECT e.employee_id,
e.first_name,
e.last_name,
(SELECT e1.first_name||' '||e1.last_name FROM
OEHR_EMPLOYEES e1 WHERE e1.employee_id = e.manager_id) as
"Manager",
e.commission_pct
FROM OEHR_EMPLOYEES e
WHERE e.commission_pct IS NOT NULL;

le

b
fera

n
a
r
t
n-

n
Bia

no
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o the changes to the columns in your interactive report.
t
a
i
b
4) A window
appears
to
confirm
e
i ( Changes.
ns
e
Click
Apply
e
b
c
li
ba
A
a

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 39

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

5)

In Region > Body, right-click Employee Commission report and select Edit Report
Attributes.

le

b
fera

n
a
r
t
n-

a
c
n
Bia

no
a
as
h
)
drop-down list for
6) Under Column Attributes, select Hidden from the Display
Text As
e
m
d
o
i
EMPLOYEE_ID.
ec nt Gu
l
c
ra de
o
i@ s Stu
e
b
i
a
h
t
b
a
e
a
us
c
n
o
t
a
bi nse
(
i
abe lice
b
A

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 40

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

Remove the Highlight option from the Actions menu.


7) Click the Search Bar tab.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 41

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

8)

Deselect the Highlight check box so that it is not displayed in the Actions menu.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
Add the PDF download format.
om uide
c

9) Click the Download tab.


cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
s as a PDF file, select the PDF check box.
i ( the
nreport
e
10) Tobdownload
e
c
li
ba
A
a

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 42

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

Remove the Single Row View icon for each row in the report.
11) Click the Link Column tab.

12) To not display the Single Row View, select Exclude Link Column from the Link
Column drop-down list.

le

b
fera

n
a
r
t
n-

a
c
n
Bia

n
a
has
)
om uide
c

13) Click Apply Changes.


cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
Run the report
and
confirm
(
s the changes that you made.
i
n
e
e
14) Click
ab Run. lic
b
A

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 43

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

15) Note that a Manager column is added to the report. The Single Row view is also
excluded from the report.

le

b
fera

n
a
r
t
n-

n
Bia

no
a
s
haoption
16) Click Actions and select Format. Notice that the Highlight
is not available.
)

e
m
co t Guid
e
l
c en
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 44

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

17) Click Actions and select Download.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
18) Notice that the PDF option is now available. Click PDF.
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 45

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

19) Select Open with and click OK.

le

b
fera

a
c
n
Bia

s
n
a
r
-thet BI
20) The PDF report is displayed. Note, if the PDF is not opening, ensure that
n
o
Publisher is running on the instructor machine.
n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
A

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 46

Practice Solution 5-3: Creating Classic Reports


Overview

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

In this practice, you create two classic reports and edit the attributes of the reports.

Tasks
a.

On a new page in the Order Management application, create a SQL report. Name the new
page and the report Top Tier Salary. The report should display the last name, email, and
salary of employees who earn between $5,000 and $12,000 from the OEHR_EMPLOYEES
table. The report should contain a search bar.
1) Navigate to the Order Management application page and click Create Page >.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 47

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

2)

Select Report and click Next >.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
eNext >.
aand uclick
s
a
3) Select Classic Report
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 48

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

4)

For Page Name, enter Top Tier Salary. Click Next >.

5)

Click Next >.

le

b
fera

6)

You will create the query by using Query Builder. Click Query Builder.

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

A
a
c
an 7)

Bi

n
a
r
t
n-

From the Object Selection pane, select OEHR_EMPLOYEES.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 49

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

8)

Select the LAST_NAME, EMAIL, and SALARY columns. For the SALARY column, enter
the condition BETWEEN 5000 AND 12000. Click in another field to confirm the
condition, and then click Return.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
9) Click Next >.
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 50

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

10) Enter Top Tier Salary for Region Name. Select Yes for Enable Search. Select the
LAST_NAME and EMAIL columns and click the > icon to search on those columns.
Click Next >.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
11) Click Finish.
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 51

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

12) Click Run Page.

13) Review the report. Note that you can make changes to the SQL with this report type.
Select Application <n>.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 52

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

b.

On a new page in the Order Management application, create a wizard report. Name the
page and the report Customer Address List. The report should display the address
information of the customers, such as the first and last names, address, city, and state from
the OEHR_CUSTOMERS table.
1) Navigate to the Order Management application home page and click Create Page >.

le

2)

n
a
r
t
n-

Select the Report option, and then click Next >.

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 53

b
fera

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

3)

Select Wizard Report, and then click Next >.

le

4)

Enter Customer Address List for Page and Region Title and click Next >.

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n and click
o Next >.
t
a
i
5) Accept the
default
b
e
i ( ens
e
b
ic
a
l
b
aA

6)

From the Table / View drop-down list, select OEHR_CUSTOMERS (table). Ctrl-click to
select CUST_FIRST_NAME, CUST_LAST_NAME, STREET_ADDRESS, CITY, and
STATE_PROVINCE. Click the > icon to move the columns to the Displayed Columns
area. Click Next >.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 54

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

le

7)

Accept the defaults and click Next >.

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
8) Click Create Report Page.
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

9)

Click the Run Page button to run the report that you just created.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 55

b
fera

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

10) Review the report. To make changes to the report, click the Edit Page <n> link.

le

b
fera

n
a
r
t
n-

no
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
e with the following requirements:
a Listusreport
c. Modify the Customer Address
a
c
nheadingstofor CUST_FIRST_NAME and CUST_LAST_NAME to First
Change the report
a
i
b
e
( Name,
srespectively.
Name andiLast
n
e
e
ic > Body, double-click Customer Address List to open the report
ab Regions
1) bUnder
l
A settings.
a
c
an

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 56

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

2)

Click the Source tab.

3)

Select the [Show Source] link.

4)

Note that you cannot edit the query definition here. Click the Report Attributes tab.

n
a
r
t
n-

a
c
n
Bia

no
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
5) Change
theliHeading
for CUST_FIRST_NAME to First Name and CUST_LAST_NAME to
c
a Name.
b
Last
A

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 57

le

b
fera

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

Change the Pagination to Row Ranges X to Y of Z (with pagination).


6) Click the Layout and Pagination tab.

7)

Select Row Ranges X to Y of Z (with pagination) for Pagination Scheme.

le

b
fera

n
a
r
t
n-

a
c
n
Bia

no
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
e the OEHR_COUNTRIES.COUNTRY_NAME column to
a andusadd
Review the query definition
a
c
n will need
the report. Hint:a
You
o to create a join.
t
i
b
e
s
8) Click the
tab.
i (QueryenDefinition
e
b
c
a
li
Ab

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 58

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

9)

Note that you can change the query from this tab. You want to add another column to
the query. Click Add/Remove Columns.

le

b
fera

n
a
r
t
n-

n
Bia

no
a
as
h
)
10) You want to add the country name to the report. Select
OEHR_COUNTRIES(table)
e
m
d
o
i
c G
uNo is selected for Show
from the drop-down list for Table / View Name.(Ensure
that
e
l
t
c
Related Tables Only.) Select COUNTRY_NAME
nthe Select Columns list and click
ra from
e
o
d
the > icon to select the column.
i@ s Stu
e
b
i
a
h
t
b
a
e
a
us
c
n
o
t
a
bi nse
(
i
abe lice
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 59

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

11) Click Next >.

le

b
fera

n
a
r
t
n-

12) Because you are selecting a column from a different table, you must specify a join.
Enter OEHR_CUSTOMERS.COUNTRY_ID =
OEHR_COUNTRIES.COUNTRY_ID and click Apply Changes.

n
Bia

no
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
s
i ( enchanges
e
13) You
can viewcthe
in the source. Double-click the Customer Address List
b
i
a
l
b
region again.
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 60

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

14) Click the Source tab and select [Show Source].

le

b
fera

15) Click the Run Page icon.

a
c
n
a

n
a
r
t
n-

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 61

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

16) Note the changes that you made to the report. Click Application <n>.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Creating Reports


Chapter 5 - Page 62

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

le

b
fera

n
a
r
t
n-

a
c
n
a

no
a
as
hLesson
Practices for
6:
)

e
m
Creating
uid
co Forms
e
G
l
c ent
a
r
Chapter
o tu6 d
@
i
e is S
b
a
b e th
a

ca to us
n
a
bi nse
(
i
e lice
bab

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 1

Practices for Lesson 6


Practices Overview

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

There are three practices for this lesson. In these practices, you create a form on a table, a
master detail form, and a tabular form.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 2

Practice 6-1: Creating a Form on a Table


Overview

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

In this practice, you create a form based on a table, and then link to the form from the Customer
Report that was created previously.

Assumptions
You have performed the previous practices or imported both the LAB03_SOLN.SQL and
LAB053_ORDER_MGMT_SOLN.SQL packaged applications.

Tasks
a.

a
c
n
Bia

Create a form based on the OEHR_CUSTOMERS table. The form page and region should
be titled Customer Details and contain the Customer First Name, Last Name, Email,
and Manager ID fields. The following are the other requirements:

Ensure that the primary key has the value of CUSTOMER_ID.

The source of the primary key is an existing sequence.


The Create, Save, and Delete buttons are required.

n
a
r
t
n-

no
a
Branch to Customers page for both: After Page Submit and
s Processing, and When
a
h
Cancel Button Pressed.
) de
m
Run the form for verification.
o
c t Gui
e
l
c en
a
r
o previously
b. Link the Customer Report that was created
the newly created Customer
tuisdclicked,tothe
@
i
S
Details form. When the Edit icon
in the report
user should be redirected
e
b
s
i
a
to the form and the details
populated
in
the
form.
After
you
create
the link, run the
h
b et
a

report and verify the


changes.
ca to us
n
a
bi nse
(
i
abe lice
b
A

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 3

le

b
fera

Practice 6-2: Creating a Master Detail Form


Overview

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

In this practice, you create a master detail form and make some modifications to it.

Assumptions
You have performed the previous practices or imported both the LAB03_SOLN.SQL and
LAB061_ORDER_MGMT_SOLN.SQL packaged applications.

Tasks
a.

a
c
n
Bia

On a new page called Master Detail Form, create a master detail form based on the
OEHR_ORDERS and OEHR_ORDER_ITEMS tables.

Include a report page called List of Orders on the master table.


Display the master table and detail table forms on a single page.

Exclude the ORDER_ID column in the OEHR_ORDERS_ITEMS table.

s
n
a
r
Use the Existing trigger option as the primary key source for the master
-t and detail
n
o
tables.
n
a
Include navigation based on the ORDER_ID column. as
) h de
m
ui the master region to
co name
b. On the Master Detail Form page, change thee
region
for
G
l
t region to Order Details.
cfor theedetail
Order Master and change the region name
n
a
r
@o Stud
i
e
b thethOrder
c. On the Master Detail page,
move
is Status item to appear before the Customer
a
b
ID in the Order Master
e change the label for Order Mode ID to Order Mode.
aregionuand
s
a
c
n
o
t
a
i
b
e
( of Orders
d. On theiList
page, change the region title to List of Orders. Do
ns (master report)
e
e
b
not
show
the
PROMOTION_ID
column.
Change the heading for Order Mode ID to Order
c
i
a and change
l
b
Mode
the
heading
for
Sales
Rep ID to Sales Rep.
A

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 4

le

b
fera

Practice 6-3: Creating a Tabular Form


Overview

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

In this practice, you create and manipulate a tabular form.

Assumptions
You have performed the previous practices or imported both the LAB03_SOLN.SQL and
LAB062_ORDER_MGMT_SOLN.SQL packaged applications.

Tasks
a.

On a new page called Update Email Address Information, create a tabular form that
displays CUST_FIRST_NAME, CUST_LAST_NAME, and CUST_EMAIL from the
OEHR_CUSTOMERS table. The CUST_EMAIL column should be the only updateable
column. Change the element width of the CUST_EMAIL column to 60.

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 5

le

b
fera

Practice Solution 6-1: Creating a Form on a Table


Overview

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

In this practice, you create a form based on a table, and then link to the form from the Customer
Report that you created earlier.

Tasks
a.

Create a form based on the OEHR_CUSTOMERS table. The form page and region should
be titled Customer Details and contain the Customer First Name, Last Name, Email,
and Manager ID fields. The following are the other requirements:
Ensure that the primary key has the value of CUSTOMER_ID.

The source of the primary key is an existing sequence.


The Create, Save, and Delete buttons are required.

Branch to Customers page for both: After Page Submit and Processing, and When
Cancel Button Pressed.

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

1.

n
a
r
t
n-

On the Order Management application home page, click Create Page >.

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 6

le

b
fera

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

2.

Select the Form option and click Next >.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
e or View option and click Next >.
a on ua sTable
a
3. Select the default
Form
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 7

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

4. Ensure that your schema is selected. From the list of tables, select OEHR_CUSTOMERS
(table). Click Next >.

5.

For Page Name and Region Title, enter Customer Details and click Next >.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
o tud
i@
e
6. Accept the default and clickb
Next
>. s S
i
a
h
t
b
a
e
a
us
c
n
o
t
a
bi nse
(
i
abe lice
b
aA
7.

For Primary Key Type, select Select Primary Key Column(s). Ensure that the primary
key has the value of CUSTOMER_ID and click Next >.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 8

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

8.

Because the source of the primary key is an existing sequence, select the Existing
sequence option. From the Sequence drop-down list, select OEHR_CUSTOMERS_SEQ
and click Next >.

le

b
fera

n
a
r
t
n-

n
Bia

no
a
hasand ACCOUNT_MGR_ID
)
9. Move CUST_FIRST_NAME, CUST_LAST_NAME, CUST_EMAIL,
e Use the > and <
m on utheidleft.
oare
to the right and ensure that the rest of the columns
c

G
icons to move the columns. Click Next >. cle
t
n
a
r
o tude
@
i
e is S
b
a
b e th
a

ca to us
n
a
bi nse
(
i
abe lice
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 9

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

10. You want to be able to cancel, create, save, and delete. Accept the default values and
click Next >.

le

a
c
n
Bia

rab
e
11. Click the arrow
icon to the right of both the boxes and select Customers in both
f
s
n
cases. Then click Next >.
a
r
-t
n
o
n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
12. Review the details and
e
aclickuFinish.
s
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
A

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 10

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

13. Click the Run Page icon.

14. Review the form. You will link this form from the Customer Report. To return to the
application home page, click the Application <n> link on the Developer toolbar.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 11

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

b.

Link the Customer Report that was created previously to the newly created Customer
Details form. When the Edit icon in the report is clicked, the user should be redirected to
the form and the details populated in the form. After you create the link, run the report and
verify the changes.
1. On the Order Management application home page, click the Customers icon.

le

b
fera

n
a
r
t
n-

a
c
n
Bia

no
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b Customer
is Report subregion and select Edit Report
2. Under Regions, right-clickathe
h
t
b
Attributes.
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
A

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 12

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

3.

Click the Link Column subtab.

4.

Instead of linking to a single row view, you want to link to a custom target page. Select
Link to Custom Target for Link Column.

le

5.

a
c
n
a

Select the [Icon 6] quick link for Link icon. Click the
select Customer Details.

b
fera

n
a
r
t
n-

icon to the right of Page and

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

6.

Click the

icon to the right of Item 1 Name. From the list in the pop-up window, click

the link corresponding to P<n>_CUSTOMER_ID. Similarly, click the


icon to the
right of the Item 1 Value box. From the list in the pop-up window, click the
#CUSTOMER_ID# link. When you have finished, click Apply Changes.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 13

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
7. Click the Run button.
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
a 8.A Click the Edit icon for any one of the rows.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 14

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

9.

Note that you are redirected to the Customer Details form and that the values are
automatically populated in the form. You can make changes and delete the active
record by using this form. To return to the application home page, click the
Application <n> link on the Developer toolbar.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 15

Practice Solution 6-2: Creating a Master Detail Form


Overview

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

In this practice, you create a Master Detail form based on the OEHR_ORDERS and
OEHR_ORDER_ITEMS tables and make some changes to it.

Tasks
b.

On a new page called Master Detail Form, create a master detail form based on the
OEHR_ORDERS and OEHR_ORDER_ITEMS tables.

Include a report page called List of Orders on the master table.


Display the master table and detail table forms on a single page.

Exclude the ORDER_ID column in the OEHR_ORDERS_ITEMS table.

Use the Existing trigger option as the primary key source for the master and detail
tables.
Include navigation based on the ORDER_ID column.

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

1.

n
a
r
t
n-

On the Order Management application home page, click Create Page >.

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 16

le

b
fera

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

2. Select the Form option and click Next >.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
eoption and click Next >.
a Form
s
a
u
3. Select the Master
Detail
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 17

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

4.

Ensure that your schema is selected. From the Table/View Name drop-down list,
select OEHR_ORDERS (table). Click the Move All icon to select all the columns in
the OEHR_ORDERS table. Click Next >.

le

b
fera

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

5.

n
a
r
t
n-

Ensure that your schema is selected. From the Table/View Name list, select
OEHR_ORDER_ITEMS. Select the ORDER_ID column and move it to the left by using
the < icon. Click Next >.

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 18

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

6.

For both the tables, select Select Primary Key Column(s) for Primary Key Type.
Select ORDER_ID and ORDER_ITEM_ID as the primary keys for the respective tables.
Click Next >.

le

b
fera

n
a
r
t
n-

a
c
n
Bia

no
a
has
)
m accept
otable,
idethe default value of
7. For the Primary Key Source of the OEHR_ORDERS
c
u

Existing trigger. Click Next >.


cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
A

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 19

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

8.

For the Primary Key Source of the OEHR_ORDER_ITEMS table, accept the default
value of Existing trigger and click Next >.

le

b
fera

9. Select the following values and click Next >.

Bi

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Include master row navigation?: Yes


Master Row Navigation Order: ORDER_ID
Include master report: Yes

n
a
r
t
n-

10.

Ensure that Edit detail as tabular form on same page is selected. Click Next >.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 20

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

11.

For the Page Attributes, change the Page Title for Oehr Orders on the master page to
List Of Orders. Also, under Create Breadcrumb Entry, change the Entry Name
(Master Report) from Oehr Orders to List of Orders, and then click Next >.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o Next >.
12. Accept theia
default andtclick
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 21

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

13.

Click Create.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
d icon.
14. To view the master detail form, click
tuPage
@othe Run
i
S
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA
15.

The master report is shown. Click the Edit icon next to one of the rows.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 22

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

16.

The Master detail form is shown. Review the information. Click Application <n> on
the Developer toolbar.

le

b
fera

n
a
r
t
n-

b.

a
c
n
Bia

no
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n page, change
On the Master Detail
o the region name for the master region to Order Master,
t
a
i
b
e
and changei the
region
name
(
s for the detail region to Order Details.
n
e
e
1. You
some changes to the master detail form. From the Order
ab want tolicmake
b
Management
application
page, click the Master Detail page.
A

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 23

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

2.

Right-click Regions and select Edit All.

le

b
fera

n
a
r
t
n-

n
Bia

no
a
3. Change the Region Name for the Oehr Orders region to Order
as Master and the Region
h
)
Name for Oehr Order Items details to Order Detailsm
and click Apply
e Changes.
d
o
i
ec nt Gu
l
c
ra de
o
i@ s Stu
e
b
i
a
h
t
b
a
e
a
us
c
n
o
t
a
bi nse
(
i
abe lice
b
aA
4.

Click the Edit Page icon in the top-right corner of the window.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 24

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

c.

On the Master Detail page, move the Order Status item to appear before the Customer ID
in the Order Master region and change the label for Order Mode ID to Order Mode.
1. You can reorder items very easily by using drag-and-drop. Drag
P<n>_ORDER_STATUS and drop it above P<n>_CUSTOMER_ID.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
o RuntPage
2. Notice that the item is moved. Click
ud icon.
@the
i
S
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 25

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

3.

Click the Show Edit Links on the Developer toolbar.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

G
le attribute.
t
4. Click the Edit icon for the Order Mode Id c
report
n
a
r
o tude
@
i
e is S
b
a
b e th
a

ca to us
n
a
bi nse
(
i
abe lice
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 26

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

5.

Change the label to Order Mode. Click Apply Changes.

le

b
fera

n
a
r
t
n-

n
Bia

no
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n Attributes
6. Close the Report
o window.
t
a
i
b
e
s browser to verify that the change was made to the form.
7. Click Refresh
i ( einnyour
e
b
c
li
ba
A
a

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 27

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

8.

Notice the Order Mode label has changed. Click Hide Edit Links on the Developer
toolbar.

le

b
fera

n
a
r
t
n-

n
Bia

no
a
has
)
om uide
c

cle ent G
a
r
9. Select the List of Orders breadcrumb
o to return
dto the Master Report.
u
t
@
i
e is S
b
a
b e th
a

ca to us
n
a
bi nse
(
i
abe lice
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 28

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

d.

On the List of Orders (master report) page, change the region title to List of Orders. Do not
show the PROMOTION_ID column. Change the heading for Order Mode ID to Order Mode,
and change the heading for Sales Rep ID to Sales Rep.
1. Click the Edit Page <n> link on the Developer toolbar.

le

b
fera

2.

a
c
n
a

Under Regions, right-click Oehr Orders and select Edit.

n
a
r
t
n-

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

3.

Change the Title to List of Orders and click the Report Attributes tab.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 29

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

4.

For the PROMOTION_ID column, deselect the Show check box. Change the Heading
for Order Mode Id to Order Mode and Sales Rep Id to Sales Rep and click Apply
Changes.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
5. To run the page, click the
Run button.
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 30

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

6.

Review the report. Note that PROMOTION_ID is no longer shown; the headings for
Order Mode and Sales Rep have changed; and the region title has changed to List of
Orders. Click the Application <n> link on the Developer toolbar.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 31

Practice Solution 6-3: Creating a Tabular Form


Overview

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

In this practice, you create and manipulate a tabular form.

Tasks
a.

1.

On a new page called Update Email Address Information, create a tabular form that
displays the CUST_FIRST_NAME, CUST_LAST_NAME, and CUST_EMAIL from the
OEHR_CUSTOMERS table. The CUST_EMAIL column should be the only updateable
column. Change the element width of the CUST_EMAIL column to 60.
From the Order Management application home page, click Create Page >.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

2. For the page type, select the Form option and


Next
G>.
t
cle click
n
a
r
o tude
@
i
e is S
b
a
b e th
a

ca to us
n
a
bi nse
(
i
abe lice
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 32

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

3.

Select the Tabular Form option and click Next >.

le

b
fera

n
a
r
t
n-

n
Bia

no
a
has For the Table/View
4. Ensure that your schema is selected in the Table/View)Owner field.
omthe drop-down
ide list. Select all
Name field, select OEHR_CUSTOMERS (table)
from
c
u

columns, except CUST_FIRST_NAME, CUST_LAST_NAME,


cle ent G and CUST_EMAIL from the
a
r
right and click the < icon.
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 33

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

5.

Ensure that the Update, Insert and Delete option is selected for Allowed Operations.
Click Next >.

le

b
fera

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

6.

n
a
r
t
n-

For Primary Key Type, select Select Primary Key Column(s). Select CUSTOMER_ID
for Primary Key Column 1 and click Next >.

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 34

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

7.

For Source Type, accept the default Existing trigger and click Next >.

le

b
fera

n
a
r
t
n-

a
c
n
Bia

no
a
as
8. For Updateable Columns, select CUST_FIRST_NAME andhCUST_LAST_NAME,
and
)

click the < icon.


om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
A
9.

Click Next >.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 35

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

10. On the Identify Page and Region Attributes page, enter Update Email Address
Information for both Page Name and Region Title. Click Next >.

le

11. Ensure that the Do not use tabs option is selected and click Next >.

n
Bia

no
a
has
)
om uide
c

cle ent G
a
r
o tud
@
i
12. For Button Labels and Branches,
accept the
S defaults and click Next >.
e
b
s
i
ba e th
a

ca to us
n
a
bi nse
(
i
abe lice
b
aA

n
a
r
t
n-

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 36

b
fera

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

13. Click Finish.

le

b
fera

n
a
r
t
n-

n
Bia

o
n
a
14. Click Run Page to view your new form.
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
ofield is smaller than required. Select the Edit Page <n> link
t
a
i
15. You notice
that
the
email
b
e
(
s
iDeveloper
ntoolbar.
e
onbthe
e
c
li
ba
A
a

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 37

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

16. Under Regions, right-click Update Email Address Information and select Edit
Report Attributes.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c
17. Click the Edit icon to the left of CUST_EMAIL.

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 38

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

18. Under Column Attributes, enter 60 for element width and click Apply Changes.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
19. Run the form to see the results.
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 39

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

20. Notice that the length of the Cust Email column has changed. Click Application <n>
on the Developer toolbar.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Creating Forms


Chapter 6 - Page 40

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

le

b
fera

n
a
r
t
n-

a
c
n
a

no
a
as
hLesson
Practices for
7:
)

e
m
id
Working
and
uPages
cowith
e
G
l
t
c
Regions
ra den
o
tu7
i@ Chapter
S
e
b
s
i
a
h
t
b
a
e
a
us
c
n
o
t
a
bi nse
(
i
e lice
bab

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Working with Pages and Regions


Chapter 7 - Page 1

Practices for Lesson 7


Practices Overview

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

In this practice, you create a variety of pages and regions and make modifications to them.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Working with Pages and Regions


Chapter 7 - Page 2

Practice 7-1: Working with Pages and Regions

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

Overview
In this practice, you create a report region on a Products page and modify the attributes of the
report. You create a sidebar region and a hide and show region, and add a footer to the
Customer Details page. Finally, you create a page zero with a region that appears on all the
pages in your application.

Assumptions
You have performed the previous practices or imported both the LAB03_SOLN.SQL and
LAB063_ORDER_MGMT_SOLN.SQL packaged applications.

Tasks
a.

Create a blank page called Products with a region called Products. Create a new tab
called Products by using the existing tab set for this page.

s
n
a
r
-t a Classic
b. Create a new report region called List of Products on the Products page.nUse
o
Report and display all the rows in the OEHR_PRODUCTS_INFORMATION
n table. Run the
a
report after it is created.
has
)
m uregion
oProduct
ide parent and displays
c. Modify the report so that it is a subregion underc
the
e nCategory
G ID, and List Price
t
only the Product ID, Product Name, Product
clStatus,
a
r
e 10 rows at a time and show the
columns in the report. Also, you wantoto display
donly
u
t
@
i
pagination in a select list. Aftereyou have performed
these tasks, run the report.
S
b
s
i
a
h
ab se t

a
d. Create a Hint sidebar
uon the right side of the Customer Details page that
nc region
o
t
a
i
includes the
following
HTML
b nse code (located in /home/oracle/labs/files/lab7(
i
1.txt):
be lice
a
b
A Use this page to enter and <br> maintain customer information.

a
c
n
Bia
e.

Add a footer to the Customer Details region on the Customer Details page so that the
following message (located in /home/oracle/labs/files/lab7-2.txt) appears
at the bottom of the region when a user enters this page:
<i>The record created or modified in this form is reflected in
the Customer Report.</i>

f.

le

b
fera

The client interacts with customers every day. Provide the client with a checklist that
includes the following (located in /home/oracle/labs/files/lab7-3.txt):

First Name <br>


Last Name <br>
Ask for Birthday <br>

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Working with Pages and Regions


Chapter 7 - Page 3

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

Social Security Number <br>

Insurance Provider<br>
This checklist is not displayed by default. The client is given an option to see the
checklist when desired. Create a Hide and Show region to meet these requirements.
g.

Create a region called In the News on a page zero page with the following code
(located in /home/oracle/labs/files/lab7-4.txt):
<html><body>
<table width="179" border="1">
<tr>
<td><p><strong>News and Events</strong></p>
<p> Visit us at &nbsp<a href="http://www.oracle.com">
www.oracle.com</a></p>
</td>
</tr>
</table>
</body></html>

a
c
n
a

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Working with Pages and Regions


Chapter 7 - Page 4

n
a
r
t
n-

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

le

b
fera

Practice Solution 7-1: Working with Pages and Regions

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

Overview
In this practice, you create a report region on a Products page, and modify the attributes of the
report. You create a sidebar region and a hide and show region, and add a footer to the
Customer Details page. Finally, you create a page zero with a region that appears on all pages
in your application.

Tasks
a.

Create a blank page called Products with a region called Products. Create a new tab
called Products by using the existing tab set for this page.
1) Navigate to the Order Management application home page and click Create Page >.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

2) Select Blank Page and click Next >.


cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

3)

Accept the default number and click Next >.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Working with Pages and Regions


Chapter 7 - Page 5

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

4)

Enter Products for Name and HTML Region 1. Click Next >.

le

b
fera

n
a
r
t
n-

a
c
n
Bia

no
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
bset andthcreate
is a new tab within the existing tab set
a
5) Select Use an existingb
tab
eTab Label and click Next >.
a foruNew
option. Enter Products
s
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
A

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Working with Pages and Regions


Chapter 7 - Page 6

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

6)

Click Finish.

7)

Click the Edit Page icon.

le

n
a
r
t
n-

b.

a
c
n
Bia

b
fera

no
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
is on the Products page. Use a SQL report
abList ofthProducts
Create a new report regionacalled
b
e
s
a
and display all the rows
in the OEHR_PRODUCTS_INFORMATION
table. Run the report after
u
c
n
o
t
a
it is created.
bi Definition
(
se page, click Create and select Region on this page.
i
n
1) On the
Page
e
e
ic
ab
l
b
A

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Working with Pages and Regions


Chapter 7 - Page 7

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

2)

Select the Report option, and click Next >.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
e and click Next >.
a option
s
a
u
3) Select the Classic
Report
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Working with Pages and Regions


Chapter 7 - Page 8

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

4)

Enter List of Products for Title and click Next >.

5)

Click the Query Builder button.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Working with Pages and Regions


Chapter 7 - Page 9

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

6)

Scroll down and select OEHR_PRODUCT_INFORMATION from the Object Selection


pane.

le

b
fera

n
a
r
t
n-

a
c
n
Bia

no
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
7) The selected object appears
bin thetDesign
is pane. Click the Table Actions icon on the
a
h
b
top-left corner of theOEHR_PRODUCT_INFORMATION
table.
a
e
s
a
u
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
A

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Working with Pages and Regions


Chapter 7 - Page 10

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

8)

Select the Check All check box and click Return. This enables you to select all the
columns for your query. Notice that all the columns are listed in the bottom pane.

le

b
fera

n
a
r
t
n-

a
c
n
Bia

no
a
has
)
om uide
c

cle ent G
a
r
o tud
@
i
e
9) Notice that a query is built that
contains
allSthe columns in the
b
s
i
a
h
t Click the Create Region button.
OEHR_PRODUCT_INFORMATION
ab setable.

a
nc to u
a
i
(b nse
i
e
ice
ab
l
b
A

10) Test your page and its new query. Click the Run button.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Working with Pages and Regions


Chapter 7 - Page 11

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

11) The report is displayed. (Note: If you had to re-login, the Home page is displayed.
Click the Products tab to view the report.) Select the Edit Page link on the Developer
toolbar.

le

b
fera

n
a
r
t
n-

c.

a
c
n
Bia

no
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b onlyththeisProduct ID, Product Name, Product Status,
a
Modify the report so that it displays
b
ein the report. Also, you want to display only 10 rows at
acolumns
Category ID, and List Price
s
a
u
c
a time and show a
to in a select list. After you have performed these tasks, run
i thenpagination
e
the report. i (b
nsa few changes to the report. Right-click List of Products and select
e
e
b
1) You
want
to
make
c
i
a
AbEdit. l

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Working with Pages and Regions


Chapter 7 - Page 12

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

2)

Select Products for Parent Region so that this region becomes a subregion of the
Products parent.

le

3)

Click the Report Attributes tab.

n
a
r
t
n-

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

A
4)
a
c
n
a

On the Report Attributes page, deselect the check boxes in the Show column that
correspond to the following, and then click the Layout and Pagination tab.

PRODUCT_DESCRIPTION

WEIGHT_CLASS

SUPPLIER_ID

MIN_PRICE

CATALOG_URL

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Working with Pages and Regions


Chapter 7 - Page 13

b
fera

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

le

b
fera

n
a
r
t
n-

n
Bia

no
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
5) From the list of links displayed
below
a
e the Pagination Scheme select list, click [Select
s
a
List].
u
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Working with Pages and Regions


Chapter 7 - Page 14

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

6)

In the Number of Rows column, enter 10 and click Apply Changes.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
7) Run the page to view your changes. Click the Run button. as
) h de
m
co t Gui
e
l
c en
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Working with Pages and Regions


Chapter 7 - Page 15

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

8)

Notice that the List of Products region is now contained within the Products parent
region, that only the columns that you specified are shown, and that the pagination is
now in a select list. Select the Application <n> link on the Developer toolbar.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Working with Pages and Regions


Chapter 7 - Page 16

d.

Create a Hint sidebar region on the right side of the Customer Details page that includes
the following HTML code (located in /home/oracle/labs/files/lab7-1.txt):
Use this page to enter and <br> maintain customer information.

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

1)

You want to make some changes to the Customer Details page. Click the Customer
Details page.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
o thetuComponent
d
2) Switch to the Component View by
View icon.
@clicking
i
S
e
b
s
i
a
h
t
b
a
e
a
us
c
n
o
t
a
bi nse
(
i
abe lice
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Working with Pages and Regions


Chapter 7 - Page 17

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

3)

Under Regions, click the Create icon.

le

b
fera

4)

a
c
n
a

For the region type, select the HTML option and click Next >.

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Working with Pages and Regions


Chapter 7 - Page 18

n
a
r
t
n-

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

5)

Select HTML again and click Next >.

6)

For Display Attributes, enter Hint for Title and select Sidebar Region for Region
Template.

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
se
aaPointuicon.
c
7) Click the Find n
Display
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Working with Pages and Regions


Chapter 7 - Page 19

le

b
fera

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

8)

You want this region to be positioned in Region Position 3. Select the Region
Position 3 link.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
9) Click Next >.
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Working with Pages and Regions


Chapter 7 - Page 20

10) In Enter HTML Text Region Source, enter the following and click Create Region.

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

Use this page to enter and <br> maintain customer information.

11) Run the page by clicking the Run Page icon.

le

b
fera

n
a
r
t
n-

n
Bia

no
a
has
)
e right side of the
12) Notice the Hint region is now displayed as a sidebar
region on
ompage.
idthe
c
u

page. You want to make some more changes


to
the
Click
e nt G the Edit Page link on
l
c
the Developer toolbar.
ra de
o
i@ s Stu
e
b
i
a
h
t
b
a
e
a
us
c
n
o
t
a
bi nse
(
i
abe lice
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Working with Pages and Regions


Chapter 7 - Page 21

e.

Add a footer to the Customer Details region on the Customer Details page so that the
following message (located in /home/oracle/labs/files/lab7-2.txt) appears at
the bottom of the region when a user enters this page:

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

<i>The record created or modified in this form is reflected in the


Customer Report.</i>
1)

Under Regions, select Customer Details.

le

b
fera

n
a
r
t
n-

n
Bia

no
a
has
)
om uide
c

G
t
clistleof links
n
a
2) Click the Header and Footer tab from rthe
at
e the top of the page.
o
d
u
t
i@ s S
e
b
i
a
h
t
b
a
e
a
us
c
n
o
t
a
bi nse
(
i
abe lice
b
aA
3)

Enter the following in the Region Footer field and click Apply Changes.
<i> The record created or modified in this form is reflected in
the Customer Report. </i>

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Working with Pages and Regions


Chapter 7 - Page 22

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

4)

le

Test the page by clicking the Run Page icon on the top-right corner.

n
a
r
t
n-

n
Bia

b
fera

no
a
has
)
om uide
c

G
le another
5) The footer text is displayed. You want to create
region that is based on the
t
c
n
a
r
e
hide and show region template. Clickothe Edit Page
link
on the Developer toolbar.
d
u
t
@
i
e is S
b
a
b e th
a

ca to us
n
a
bi nse
(
i
abe lice
b
aA

6)

Switch to the Tree View. Click the Tree View icon.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Working with Pages and Regions


Chapter 7 - Page 23

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

f.

The client interacts with customers every day. Provide the client with a checklist that
includes the following (located in /home/oracle/labs/files/lab7-3.txt):

First Name <br>

Last Name <br>

Ask for Birthday <br>

Social Security Number <br>

Insurance Provider<br>
This checklist is not displayed by default. The client is given an option to see the checklist
when desired. Create a Hide and Show region to meet these requirements.
1)

Right-click the Regions node and click Create.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Working with Pages and Regions


Chapter 7 - Page 24

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

2)

Select the HTML option, and click Next >.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Working with Pages and Regions


Chapter 7 - Page 25

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

3)

Select HTML again and click Next >.

4)

In the Title field, enter Check List and select Hide and Show Region for Region
Template. Select Customer Details for Parent Region and click Next >.

n
a
r
t
n-

a
c
n
Bia

no
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
5) In the HTML source box, enter
b the tfollowing
is text and click Create Region:
a
h
b
e
First Name <br> aa
s
u
c
n
o
Last Name i<br>
t
a
b
e
(
s
Ask e
fori Birthday
n<br>
e
b
c
a
li Number <br>
AbSocial Security
Insurance Provider<br>

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Working with Pages and Regions


Chapter 7 - Page 26

le

b
fera

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

6)

On the Page Definition page, click the Run icon.

7)

Notice the subregion for Check List. Click the Expand icon to show the contents of the
region.

le

b
fera

n
a
r
t
n-

a
c
n
Bia

no
a
has
)
om uide
c

cle ent G
a
r
tudthe Application <n> link on the
@o S
i
8) The contents of the region areedisplayed.
Click
b this
Developer toolbar.
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
A

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Working with Pages and Regions


Chapter 7 - Page 27

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

g.

Create a region called In the News on a page zero page with the following code (located
in /home/oracle/labs/files/lab7-4.txt):
<html><body>
<table width="179" border="1">
<tr>
<td><p><strong>News and Events</strong></p>
<p> Visit us at &nbsp<a href="http://www.oracle.com">
www.oracle.com</a></p>
</td>
</tr>
</table></body></html>
1)

le

b
fera

Click Create Page >.

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Working with Pages and Regions


Chapter 7 - Page 28

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

2)

Select the Page Zero option and click Next >.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
3) Click Finish. nca
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

4)

Right-click the Regions node and click Create.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Working with Pages and Regions


Chapter 7 - Page 29

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

5)

Select HTML and click Next >.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
e >.
a clickuNext
s
a
6) Select HTML again
and
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Working with Pages and Regions


Chapter 7 - Page 30

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

7)

For Title, enter In the News. For Display Point, click the quick link [Pos. 3]. Click
Next >.

le

8)

a
c
n
a

b
fera

n
a
r
t
n-

In the Enter HTML Text Region Source field, enter the following code and click Create
Region. You can copy and paste the code from
/home/oracle/labs/files/lab7-4.txt.

no
a
<html><body>
has
)
<table width="179" border="1">
om uide
c

<tr>
le nt G
c
a
r
<td><p><strong>News and Events</strong></p>
de
u
t
@o href="http://www.oracle.com">
i
<p> Visit us at e
&nbsp<a
S
b
s
i
www.oracle.com</a></p>
a
h
ab se t

</td>
a
nc to u
a
</tr>
i
(b nse
i
</table>
e
ab
lice
b</body></html>

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Working with Pages and Regions


Chapter 7 - Page 31

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

9)

Click the Run Application button.

10) The home page is displayed with the In the News region. Click the Products tab.

le

b
fera

n
a
r
t
n-

n
Bia

no
a
has
)
11) Note that the In the News region appears on this page
de the Application
om too.uiClick
c

<n> link on the Developer toolbar.


cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Working with Pages and Regions


Chapter 7 - Page 32

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

le

b
fera

n
a
r
t
n-

a
c
n
a

no
a
as
hLesson
Practices for
8:
)

e
m
Understanding
co t GuidSession State
e
l
c Debugging
n
a
and
r
e
o
d
tu8
i@ Chapter
S
e
b
s
i
a
h
t
b
a
e
a
us
c
n
o
t
a
bi nse
(
i
e lice
bab

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Understanding Session State and Debugging


Chapter 8 - Page 1

Practices for Lesson 8


Practices Overview

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

There are two practices for this lesson. In these practices, you examine how session state and
debugging works in an Application Express application.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Understanding Session State and Debugging


Chapter 8 - Page 2

Practice 8-1: Understanding Session State

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

Overview
In this practice, you add a Create button to the Customers page. The button redirects to the
Customer Details page when it is clicked. You clear the cache so that when the button is
clicked, the Customer Details form is empty. You review what is in session state and also add
the current value for first name and last name to the Customer Details region header.

Assumptions
You have performed the previous practices or imported both the LAB03_SOLN.SQL and
LAB071_ORDER_MGMT_SOLN.SQL packaged applications.

Tasks
a.

n
Bia

On the Customers page in the Order Management application, add a Create region
button that navigates to the Customer Details page when it is clicked.

s
n
a
r
-tCreate
b. Run the page and view an existing record. Click Cancel, and then click the
n
o
button. What do you observe?
n
a
as
h
)
c. Edit the button and clear the cache for the Customerm
Details page.
e
d
o
i
ec nt Gu
l
c
d. Edit an existing record and view the session
ra state.
eWhy do all the values for all the
o
d
u
items on the Customer Details page
not
appear?
t
i@ s S
e
b
i
a
h
t
b
a
e
e. Change the Link Column
the
s Customer Report to include the value for the
a onitem.
u
c
P<n>_CUST_FIRST_NAME
n
o
ia se t
b
(
n
eiCustomer
ice Details page, change the title of the Customer Details region to use
f. bOn
abthe
l
a A the following (located in /home/oracle/labs/files/lab8-1.txt). Be sure to
change P<n> to your page number.

&P<n>_CUST_FIRST_NAME. &P<n>_CUST_LAST_NAME. Customer Details


g.

le

b
fera

Run the page. What do you observe?

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Understanding Session State and Debugging


Chapter 8 - Page 3

Practice 8-2: Debugging Your Application


Overview

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

In this practice, you enable debugging for your application, run a page, turn debug on, make a
change, and then view the results.

Assumptions
You have performed the previous practices or imported both the LAB03_SOLN.SQL and
LAB081_ORDER_MGMT_SOLN.SQL packaged applications.

Tasks
a.

Enable Debugging for the Order Management application.

b.

Run the Customer Details page. Make sure that a record is in session state. If the page
is empty, click Cancel and select a customer from the report.

c.

n
Bia

n
a
r
t
n-

Turn debug on.

n
a
as
hChanges.
d. Make a change to the customer last name and click Apply
)
e
m
d
o
i
ec nt Gu
l
e. View the Debug results. What do you observe?
c
ra de
o
i@ s Stu
e
b
i
a
h
t
b
a
e
a
us
c
n
o
t
a
bi nse
(
i
abe lice
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Understanding Session State and Debugging


Chapter 8 - Page 4

le

b
fera

Practice Solution 8-1: Understanding Session State

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

Overview
In this practice, you add a Create button to the Customers page. The button redirects to the
Customer Details page when it is clicked. You clear the cache so that when the button is
clicked, the Customer Details form is empty. You review what is in session state and also add
the current value for first name and last name to the Customer Details region header.

Tasks
a.

On the Customers page in the Order Management application, add a Create region
button that navigates to the Customer Details page when it is clicked.

1)

Navigate to the Order Management application home page and select the
Customers Page.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Understanding Session State and Debugging


Chapter 8 - Page 5

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

2)

You want to create a region button for the Create function. Right-click the Customer
Report region and select Create Region Button.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
as
h
)
3) Select the [Create] quick pick for Button Name and m
click Next >.
e
d
o
i
ec nt Gu
l
c
ra de
o
i@ s Stu
e
b
i
a
h
t
b
a
e
a
us
c
n
o
t
a
bi nse
(
i
abe lice
b
aA
4)

Select Right of Interactive Report Search Bar for Position and click Next >.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Understanding Session State and Debugging


Chapter 8 - Page 6

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

5)

Select Redirect to Page in this Application for Action, select your Customer Details
page number, and click Create Button.

le

b
fera

b.

n
Bia

n
a
r
t
n-

Run the page and view an existing record. Click Cancel, and then click the Create button.
What do you observe?

n
a
has
)
1) Run the page. Click the Run icon.
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( is displayed.
2) The e
report
ns Click the Edit icon for one of the rows.
e
b
c
li
ba
A
a

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Understanding Session State and Debugging


Chapter 8 - Page 7

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

3)

Note that the Customer Details form reflects the data for the customer that you chose.
Click Cancel.

le

4)

a
c
n
Bia

Click the Create button.

b
fera

n
a
r
t
n-

no
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
5) Note that the values are
on the page. You want to change this so that you
a still cached
e cache
s
a
receive an empty
page
where
the
is cleared. Click the Cancel button.
u
c
n
o
t
a
i
(b nse
i
e
ice
ab
l
b
A

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Understanding Session State and Debugging


Chapter 8 - Page 8

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

6)

On the Customer Report page, click the Edit Page link on the Developer toolbar.

le

b
fera

n
a
r
t
n-

c.

a
c
n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
tudDetails page.
@theoCustomer
i
Edit the button and clear the cacheefor
S
b this
a
b
eand select Edit.
a button
s
a
1) Right-click the CREATE
u
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
A

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Understanding Session State and Debugging


Chapter 8 - Page 9

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

2)

Click the Action When Button Clicked tab.

3)

For Clear Cache, enter the page number of the Customer Details page. This is the
same page number that is displayed in the Page field. Click Apply Changes.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
nClick thetRun
o icon.
a
i
4) Run the page.
b
e
i ( ens
e
b
ic
a
l
b
aA
5)

Click Create again.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Understanding Session State and Debugging


Chapter 8 - Page 10

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

6)

Note that the values are no longer cached and the form is now empty. Also note that
the application does not display the Delete or Apply Changes button; it displays the
Create button instead. Click Cancel.

le

b
fera

no
a
has
)
1) Click the Edit icon for one of the rows.
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
a 2)A The values for the record are displayed. Click the Session link on the Developer

d.

n
Bia

n
a
r
t
n-

Edit an existing record and view the session state. Why do all the values for all the items on
the Customer Details page not appear?

toolbar.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Understanding Session State and Debugging


Chapter 8 - Page 11

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

3)

Notice that the only value in session state is P<n>_CUSTOMER_ID. This value is
hidden on this page but the remaining values are displayed based on this value. The
reason why the other values are not in session state is because they have not been
submitted to the page. The current values are stored in &P<n>_<item_name>. You
examine how this works later in this practice.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
4) Switch back to your Customer
e page and click Cancel.
a usDetails
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Understanding Session State and Debugging


Chapter 8 - Page 12

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

5)

Click the Edit Page link on the Developer toolbar.

le

b
fera

n
a
r
t
n-

no
a
has
)
om uide
c

G
leto include
e. Change the Link Column on the Customer Report
the value for the
t
c
n
a
r
e
P<n>_CUST_FIRST_NAME item.
@o Stud
i
e
bvalue for
is
a
h
t
1) You want to review how
the
P<n>_CUSTOMER_ID
populated in session
b
e and select Edit Report isAttributes.
a uReport
s
a
state. Right-clickcCustomer
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
A
a
c
an

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Understanding Session State and Debugging


Chapter 8 - Page 13

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

2)

Click the Link Column tab if it is not already displayed.

3)

Note that the name and value for Item 1 is the CUSTOMER_ID. This is how the value is
passed when the Edit icon is clicked. You want to add another item/value. Click the
Find Item icon for Item 2.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

4)

Select P<n>_CUST_FIRST_NAME.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Understanding Session State and Debugging


Chapter 8 - Page 14

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

5)

Click the Find Item icon for Value 2.

6)

Select the current value #CUST_FIRST_NAME#.

le

b
fera

n
a
r
t
n-

n
Bia

no
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
is session state now, as well as the Customer
7) The Customer First Nameaisbpassedhinto
t
b
ID. Click Apply Changes.
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA
8)

Click Run Page.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Understanding Session State and Debugging


Chapter 8 - Page 15

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

9)

Move your cursor over the Edit button for a row in your report. Notice on the status bar
that CUSTOMER_ID and CUST_FIRST_NAME are being passed in the URL. Click the
Edit icon.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
ian linke ontothe Developer toolbar.
10) Click the(b
Session s
ei licen
b
a
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Understanding Session State and Debugging


Chapter 8 - Page 16

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

11) Notice that this time, the P<n>_CUST_FIRST_NAME value is also passed.

le

b
fera

n
a
r
t
n-

f.

no
a
has
)
om uide
c

le nt G
c
a
r
e Edit Page link on the Developer
12) Switch back to the Customer Detailso
page. Click
dthe
u
t
@
toolbar.
i
e is S
b
a
b e th
a

ca to us
n
a
bi nse
(
i
e licDetails
e page, change the title of the Customer Details region to use the
On the
bCustomer
a
b
following
(located in /home/oracle/labs/files/lab8-1.txt). Be sure to change
A

a P<n> to your page number.


c
n
Bia
&P<n>_CUST_FIRST_NAME.

&P<n>_CUST_LAST_NAME. Customer Details

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Understanding Session State and Debugging


Chapter 8 - Page 17

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

1)

You want to populate the Title with the current values for First Name and Last Name.
Right-click the Customer Details Region and select Edit.

le

b
fera

n
a
r
t
n-

n
Bia

no
a
as
h
)
in
2) Change the title from Customer Details to the following
(located
e
m
d
o
i
/home/oracle/labs/files/lab8-1.txt),
u<n> with the Customer
ecreplacing
G
l
t
Details page number: Click Apply Changes.
c
ra den
o
&P<n>_CUST_FIRST_NAME. &P<n>_CUST_LAST_NAME.
Customer Details
@ Stu
i
e
bthe period
Note: In the preceding text,
is(.) at the end of the item name is required.
a
h
t
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

g.

Run the page. What do you observe?


1)

Click the Run Page icon.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Understanding Session State and Debugging


Chapter 8 - Page 18

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

2)

Note that the Customer Name for the record being displayed is contained in the title.
Click the Application <n> link on the Developer toolbar.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Understanding Session State and Debugging


Chapter 8 - Page 19

Practice Solution 8-2: Debugging Your Application


Overview

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

In this practice, you enable debugging for your application, run a page, turn debug on, make a
change, and view the results of debugging.

Tasks
a.

Enable Debugging for the Order Management application.

1)

You must make sure that Debugging is set to Yes for your application. Navigate to the
Order Management application home page and click Edit Application Properties.

le

b
fera

n
a
r
t
n-

n
Bia

no
a
has
)
om uide
c

2) Under Properties, select Yes for Debuggingle


Apply
G Changes.
t
c and click
n
a
r
o tude
@
i
e is S
b
a
b e th
a

ca to us
n
a
bi nse
(
i
abe lice
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Understanding Session State and Debugging


Chapter 8 - Page 20

b.

Run the Customer Details page. Make sure that a record is in session state. If the page is
empty, click Cancel and select a customer from the report.

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

1)

c.

Click Run Page and make sure that you are running the Customer Details page.

Turn debug on.


1)

On the Developer toolbar, click Debug.

le

b
fera

n
Bia

n
a
has
)
1) Change the last name and click Apply Changes.
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

d.

e.

Make a change to the customer last name and click Apply Changes.

n
a
r
t
n-

View the Debug results. What do you observe?


1)

Notice the change that you made in the report. To view the debug messages, click the
View Debug link on the Developer toolbar.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Understanding Session State and Debugging


Chapter 8 - Page 21

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

2)

A filter is created for the page that you are currently on. Because you made the
change to a different page, click the Remove Filter icon for the page filter.

3)

Select the View Identifier number from the list. Notice that one entry is for the
rendering of the page and one entry is for processing the page.

le

b
fera

n
a
r
t
n-

n
Bia

no
a
4) The debug messages are displayed. If you place your cursor
one of the bars in
hasoverexample,
the graph, you see the task being performed. In the screenshot
you see that
)

eof time. Click


m length
d
o
i
a row process is being performed and it took theclongest
the bar in
t Gu
e
l
the chart to go to the details in the following
report:
c en
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a the lmessage
5) bNotice
that is displayed. Also note that, higher up in the list, the sessions
a A state values are being set on the page.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Understanding Session State and Debugging


Chapter 8 - Page 22

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

le

b
fera

n
a
r
t
n-

a
c
n
a

no
a
as
hLesson
Practices for
9:
)

e
m
id Buttons
Adding
uand
coItems
e
G
l
c ent
a
r
Chapter
o tu9 d
@
i
e is S
b
a
b e th
a

ca to us
n
a
bi nse
(
i
e lice
bab

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 1

Practices for Lesson 9

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

Practices Overview
There are three practices for this lesson. In these practices, you create a variety of items,
manipulate the way they work, and change the layout on the page. You also create a page that
allows you to upload a file, and then view and download it.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 2

Practice 9-1: Adding Items and Buttons


Overview

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

In this practice, you create a Customer Feedback form that contains some items and two
buttons. You create a button on the Customers Report to link to the feedback form.

Assumptions
You have performed the previous practices or imported both the LAB03_SOLN.SQL and
LAB082_ORDER_MGMT_SOLN.SQL packaged applications.

Tasks
a.

Create a new blank page called Customer Feedback.

b.

Add the following items to the form:


Customer ID
Feedback
Added On

a
c
n
Bia

Text Field
Text Area
Date Picker

le

n
a
r
t
n-

no
a
as
h
)

c. Add a button on the Customers page to redirect to the


CustomereFeedback
page.
m
d
o
i
c
u
e nt G
l
c
d. Add an Apply button on the Customer Feedback
ra dpage.
e
o
u
t
@
i
S
e iFeedback
bCustomer
s
e. Add a Cancel button on b
the
page to redirect to the Customers
a
h
t
a
e

page.
ca to us
n
a
bi nse
(
i
abe lice
b
A

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 3

b
fera

Practice 9-2: Manipulating Items


Overview

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

In this practice, you add some additional item types (select list and cascading LOV) and modify
the way the fields in the Customer Details form are displayed.

Assumptions
You have performed the previous practices or imported both LAB03_SOLN.SQL and
LAB091_ORDER_MGMT_SOLN.SQL packaged applications.

Tasks
Modify the Customer Details page as follows:
a. Modify the Account Manager item to be a select list with the following query (located in
/home/oracle/labs/files/lab9-1.txt):

le

rab
e
select LAST_NAME||', '||FIRST_NAME display_value, EMPLOYEE_ID
f
s
n
return_value
a
r
-t
n
from OEHR_EMPLOYEES
o
n
a
where DEPARTMENT_ID=80
order by 1
has
)
om uide
c

Gfollowing label and values:


tthe
b. Add a quick pick list to the Account Manager
cleitemewith
n
a
r
Label
Value
@o Stud
i
e
b172 this
a
Bates, Elizabeth
b
a u145se
Russell, John nca
o
t
a
i
b
e
Cambrault,
Gerald
148
(
s
i
n
e
e
ic
ab
l
b
A

a c.
c
n
Bia

d.

Add a select list item called Country that contains the following query (located in
/home/oracle/labs/files/lab9-2.txt). This item should allow nulls.
select COUNTRY_NAME display_value, COUNTRY_ID return_value
from OEHR_COUNTRIES
order by 1

Add another item, City, based on the Country item that you just created with the
following query (located in /home/oracle/labs/files/lab9-3.txt). Select the
Country item as the cascading LOV.
Note: You may need to change the query so that you do not have multiple rows.
select CITY display_value, CITY return_value
from OEHR_LOCATIONS
where country_id = :P<n>_COUNTRY_ID
order by 1

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 4

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

e.

Change the layout of the form so that First Name, Last Name, and Email appear on the
same line, and the First Name label appears above the First Name field.

f.

Change the Account Manager of an existing customer record.


Note: You must navigate to the customer report and edit one of the records.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 5

Practice 9-3: Creating an Upload and Download Page

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

Overview
In this practice, you create a form in an HTML region with a file upload item and a button. The
button will submit the page and return the user to the same page. Also, you create a report on
the document table that has links to download documents. Provide links to download the
documents in the report.

Assumptions
You have performed the previous practices or imported both the LAB03_SOLN.SQL and
LAB092_ORDER_MGMT_SOLN.SQL packaged applications.

Tasks
a.

Create a blank page on page 802 called Upload Download Files with an HTML region
called Submit File that contains a File Browse item type on the source type
WWV_FLOW_FILES. Create a Submit button and upload the oralogo.gif file from the
/home/oracle/labs/files directory.
Note that every time you upload a script in SQL Workshop or upload a file in Shared
Components for an application, the reference to the file is placed in the
WWV_FLOW_FILES table.

n
a
r
t
n-

n
Bia

no
a
has
)
om uide
c

GFiles with the following SQL


t
b. Create an Interactive Report sub region called
cleUploaded
n
a
r
query (located in /home/oracle/labs/files/lab9-4.txt):
o tude
@
i
S
e APEX_APPLICATION_FILES
SELECT id, filename FROM
b
s
i
a
h
t
order by created_on
ab desc
e

s
a
nc to u
a
i
e a link on the ID column to download the file.
(breportntoscreate
c. Modifyithe
e
e
ic
ab
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 6

le

b
fera

Practice Solution 9-1: Adding Items and Buttons


Overview

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

In this practice, you create a Customer Feedback form that contains some items and two
buttons. You create a button on the Customers report to link to the feedback form.

Tasks
a.

Create a new page and region called Customer Feedback, which has a breadcrumb to
the Customers page.
1) Navigate to the Order Management application home page and click Create Page >.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c
2) Select Blank Page and click Next >.

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

3)

Accept the default and click Next >.


Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 7

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

4)

In the Name field, enter Customer Feedback. Click Next >.

le

b
fera

5)

n
Bia

Accept the default and click Next >.

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
6) Click Finish.
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 8

n
a
r
t
n-

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

7)

You want to create a region on this page. Click the Edit Page icon.

8)

Right-click Regions and select Create.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 9

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

9)

Select the HTML region type and click Next >.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
e >.
a clickuNext
s
a
10) Select HTML again
and
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 10

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

11) For Title, enter Customer Feedback, accept the defaults for other fields, and click
Next >.

le

12) Click Create Region.

n
a
r
t
n-

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
baform:
b. Add the following items toa
the
e
s
a
u
c
Customer ID
Text
n Field to
a
i
b
Feedback i (
Text
Area
se
n
e
e
Added
abOn licDate Picker
b
A
a
c
an

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 11

b
fera

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

1)

You want to create some page items in the Customer Feedback region. Right-click
Customer Feedback and select Create Page Item.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
as
h
)
2) Select Text Field for Item Type and click Next >. m
e
d
o
i
ec nt Gu
l
c
ra de
o
i@ s Stu
e
b
i
a
h
t
b
a
e
a
us
c
n
o
t
a
bi nse
(
i
abe lice
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 12

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

3)

Enter P<n>_CUSTOMER_ID for Item Name and click Next >.

4)

Accept the defaults and click Next >.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
5) Accept the defaults and click
bNext t>.his
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 13

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

6)

Select Database Column for Source Type and click Create Item.

le

b
fera

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

7)

n
a
r
t
n-

You want to add some additional items but you will use the drag-and-drop layout editor
this time. Right-click Customer Feedback and select Drag & Drop Layout.

Bi

8)

Drag the Text Area item type to the second line in the drag-and-drop layout area.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 14

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

9)

Change the Item Name to P<n>_FEEDBACK and the Label to Feedback.

10) Drag the Date Picker item to the third row on the page. Change the Item Name to
P<n>_ADDED_ON and the Label to Added On. Click Next >.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
11) Click Apply
Changes.
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 15

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

12) You can also drag and drop an item to reposition the item in the list. Drag the
P<n>_ADDED_ON item and drop it right above the P<n>_FEEDBACK item.

le

b
fera

n
a
r
t
n-

no
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
e Customers page to this page. Click the
14) You want to createaaa
button on
the
s
u
c
Applicationa
<n>
n link ontothe Developer toolbar.
i
b
(
se
i
n
e
e
ic
ab
l
b
A
13) Run the page. Click the Run icon.

a
c
n
Bia

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 16

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

c.

Add a button on the Customers page to redirect to the Customer Feedback page.
1)

Click the Customers page icon.

2)

Right-click the Customer Report region and select Create Region Button.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic enter Customer Feedback and click Next >.
a Button lName,
3) bFor
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 17

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

4)

Select Right of Interactive Report Search Bar for Position and click Next >.

5)

For Action, select the Redirect to Page in this Application and click the
the right of the Page field.

icon to

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
6) Select the
Customer
Feedback
page from the list.
b
e
(
s
i
n
e
e
ic
ab
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 18

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

7)

Click Create Button.

le

8)

To run the page, click Run.

b
fera

n
a
r
t
n-

Bi

no
a
has
)
om uide
c

G
t
9) Click the Customer Feedback button. cle
n
a
r
o tude
@
i
e is S
b
a
b e th
a

ca to us
n
a
bi nse
(
i
e button
d. Add anbApply
eon the Customer Feedback page.
c
i
a
l
b
1) You are redirected to the Customer Feedback page that you created earlier. You want
A
a
to create an Apply button on this page. Click the Edit Page link on the Developer
c
an
toolbar.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 19

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

2)

Right-click the Customer Feedback region and select Create Region Button.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
3) Click the [Apply] quick link for Button Name and click Nexta
h >.s
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA
4)

Accept the default and click Next >.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 20

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

5)

e.

Accept the default action to submit the page and click Create Button.

Add a Cancel button on the Customer Feedback page to redirect to the Customers page.
1)

You also want to create a Cancel button. Right-click Region Buttons and select
Create.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic quick pick and click Next >.
a the [Cancel]
l
2) bClick
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 21

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

3)

Accept the default and click Next >.

4)

Select Redirect to Page in this Application for Action and enter the page number for
the Customers page (in this case, 2) in the Page field. Click Create Button.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
nClick Run.to
a
i
5) Run the page.
b
(
se
i
n
e
e
ic
ab
l
b
aA
6)

The Apply and Cancel buttons were created successfully. Click the Application <n>
link.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 22

Practice Solution 9-2: Manipulating Items


Overview

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

In this practice, you add some additional items and modify the way the fields in the Customer
Details form are displayed.

Tasks
a.

Modify the Account Manager item to be a select list with the following query (located in
/home/oracle/labs/files/lab9-1.txt):

select LAST_NAME||', '||FIRST_NAME display_value, EMPLOYEE_ID


return_value
from OEHR_EMPLOYEES
where DEPARTMENT_ID=80
order by 1

n
Bia

s
n
a
r
1) Navigate to the Order Management application home page and select the
-tCustomer
n
o
Details page.
n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

2)

3)

Run the page.

You will change the Account Manager item to a select list and also add a quick pick
list. Click the Edit Page link on the Developer toolbar.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 23

le

b
fera

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

le

4)

n
a
r
t
n-

Right-click the P<n>_ACCOUNT_MGR_ID item and select Edit.

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 24

b
fera

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

5)

Click the Select List quick pick, change the label to Account Manager, and click the
List of Values tab.

le

b
fera

n
a
r
t
n-

a
c
n
Bia

no
a
has
)
om uide
c

G in the Sales department.


t
cleof managers
6) You want to build a dynamic list of the rnames
n
a
de
Enter the following query (located@
in o
/home/oracle/labs/files/lab9-1.txt)
to
u
t
i
S
e
display the last name and first
name, and
EMPLOYEE_ID. Select Yes for Display
is- inreturn
ab Manager
h
t
b
Null Value and enter -aSelect
the Null Display Value field.
e

s
a
u
c
select LAST_NAME||',
'||FIRST_NAME
display_value, EMPLOYEE_ID
n
o
t
a
i
return_value
(b nse
i
e
from
OEHR_EMPLOYEES
b
ce
i
a
l
b
A where DEPARTMENT_ID=80
order by 1

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 25

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

b.

Add a quick pick list to the Account Manager item with the following labels and values:
Label

Value

Bates, Elizabeth

172

Russell, John

145

Cambrault, Gerald

148

1)

Click the Quick Picks tab.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 26

2)

Select Yes for Show Quick Picks. Enter the following labels and values and click
Apply Changes.

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

Label

Value

Bates, Elizabeth

172

Russell, John

145

Cambrault, Gerald

148

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
3) Click Run.
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 27

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

4)

Click the Account Manager drop-down list to see the list of account managers.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
5) Click the
i (Russell,
nsJohn quick pick link.
e
e
b
c
li
ba
A
a

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 28

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

6)

Notice how the name is selected for Account Manager. You want to add some
additional items. Click the Edit Page link on the Developer toolbar.

le

b
fera

n
a
r
t
n-

no
a
has
)
select COUNTRY_NAME display_value, COUNTRY_ID
om return_value
ide
c
u

from OEHR_COUNTRIES
cle ent G
a
r
order by 1
@o Stud
i
e
b this
a
b
1) Under the CustomerDetails
right-click Items and select Create Page Item.
a region,
e
s
a
nc to u
a
i
(b nse
i
e
ice
ab
l
b
aA

c.

n
Bia

Add a select list item called Country that contains the following query (located in
/home/oracle/labs/files/lab9-2.txt). This item should allow nulls.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 29

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

2)

Select the Select List item type and click Next >.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b ItemtName
3) Enter P<n>_COUNTRY_IDafor
is and click Next >.
h
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA
4)

Accept the defaults and click Next >.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 30

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

5)

Accept the defaults and click Next >.

6)

Enter the following SQL in the List of Values Query area (located in
/home/oracle/labs/files/lab9-2.txt). Enter - Select Country - for Null
Display Value and click Next >.
select COUNTRY_NAME display_value, COUNTRY_ID return_value
from OEHR_COUNTRIES
order by 1

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 31

n
a
r
t
n-

le

b
fera

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

7)

Select Database Column for Source Type. Notice that the COUNTRY_ID column is
automatically inserted. Click Create Item.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
8) Run the page. Click Run.
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 32

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

9)

Notice that the Country Id item shows a select list of country names. You want to
create an item that is based on the country selected (cascading LOV). Click the Edit
Page link on the Developer toolbar.

le

b
fera

n
a
r
t
n-

Bi

no
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
d. Add another item, City,
n basedtoon the Country item that you just created with the following
a
i
b
query (located
in
/home/oracle/labs/scripts/lab9-3.txt).
Select the Country
(
se
icascading
n
e
item asbthe
LOV.
e
ic to change the query so that you do not have multiple rows.
aYou maylneed
Note:
b
A
a
c
select
CITY display_value, CITY return_value
an
from OEHR_LOCATIONS
where country_id = :P<n>_COUNTRY_ID
order by 1

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 33

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

1)

Right-click Items and select Create Page Item.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
2) Select the Select List item type and click Next >.
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 34

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

3)

Enter P<n>_CITY for Item Name and click Next >.

4)

Accept the defaults and click Next >.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
5) Accept the defaults and click Next
@>.o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA
6)

Enter the following SQL in the List of Values Query (located in


/home/oracle/labs/files/lab9-3.txt). Enter Select City in Null
Display Value and select P<n>_COUNTRY_ID for the Cascading LOV Parent Item(s)
and Page Items to Submit fields. Note that this item will be refreshed when the value of
P<n>_COUNTRY_ID is changed. Click Next. Be sure to change P<n> to your page
number.
select CITY display_value, CITY return_value
from OEHR_LOCATIONS
where country_id = :P<n>_COUNTRY_ID
order by 1

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 35

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

G Item.
le clicknCreate
t
cand
7) Select Database Column for Source Type
a
r
o tude
@
i
e is S
b
a
b e th
a

ca to us
n
a
bi nse
(
i
abe lice
b
aA

8)

Click Run.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 36

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

9)

Select Japan from the list of countries. Click the City drop-down list to see that only
the cities from Japan are shown. You want to make some changes to the layout of the
page. Click the Edit Page link on the Developer toolbar.

le

b
fera

n
a
r
t
n-

no
a
has
)
e appear on the
m and
e. Change the layout of the form so that First Name, LastoName,
idEmail
c
u

same line, and the First Name label appears above


Name field.
G
le the First
t
c
n
a
r
1) Right-click the Customer Details region
o andtuselect
de Drag & Drop Layout.
@
i
e is S
b
a
b e th
a

ca to us
n
a
bi nse
(
i
abe lice
b
A
a
c
an

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 37

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

2)

Drag the P<n>_CUST_LAST_NAME item to the right of the


P<n>_CUST_FIRST_NAME item on the same line.

le

b
fera

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

3)

Drag the P<n>_CUST_EMAIL item to the right of the P<n>_CUST_LAST_NAME item


so that all three items appear on the same line.

Bi

4)

n
a
r
t
n-

Click Next >.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 38

5)

Change the following labels and click Apply Changes.


Item

Label

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

P<n>_CUST_FIRST_NAME First Name


P<n>_CUST_LAST_NAME

Last Name

P<n>_EMAIL

Email

P<n>_COUNTRY_ID

Country

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
6) Click the Run Page icon.
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 39

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

7)

Notice that the item lengths extend the page too far to the right. You can change the
way the item is displayed and where the label is positioned. Click the Edit Page link on
the Developer toolbar.

le

b
fera

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

8)

Right-click the P<n>_CUST_FIRST_NAME item and select Edit.

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 40

n
a
r
t
n-

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

9)

Under Displayed, change the Width to 20; and under Label, select Above for
Horizontal/Vertical Alignment. Click Apply Changes.

le

b
fera

n
a
r
t
n-

a
c
n
Bia

no
a
has
)
om uide
c

cle ent G
a
r
@o Studof items is to use the Edit All feature.
10) Another way to change multiple
characteristics
i
e
bEdit All.
is
Right-click Items and select
a
h
t
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
A

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 41

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

11) Change the Width for P<n>_CUST_LAST_NAME and P<n>_CUST_EMAIL to 20 and


click Apply Changes.

le

b
fera

n
a
r
t
n-

a
c
n
Bia

no
a
has
)
om uide
c
12) Click the Run Page icon.

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
( the three
ithat
ns text fields are smaller and that the label for First Name is above
e
13) Notice
e
b
c
a
li than to the left of it. Notice that Account Manager, Country, and City are
Abthe field rather
a little off the center. You want them to appear right below the first name item. To do
this, you must add a start and stop table item right above the Account Manager item.
Click the Edit Page link on the Developer toolbar.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 42

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

14) Right-click the Customer Details region and select Drag & Drop Layout.

le

b
fera

n
a
r
t
n-

n
Bia

no
a
15) Click the Stop and Start HTML Layout Table item icon, and
asdrag and drop it right
h
)
above the P<n>_ACCOUNT_MGR_ID item.
e
m
d
o
i
ec nt Gu
l
c
ra de
o
i@ s Stu
e
b
i
a
h
t
b
a
e
a
us
c
n
o
t
a
bi nse
(
i
abe lice
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 43

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

16) Release the cursor when a line appears between the second and third existing lines.

le

b
fera

n
a
r
t
n-

17) Click Next >.

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

A
a
18) Click Apply Changes.
c
an

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 44

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

19) Click the Run Page icon.

20) Notice that the fields line up independently from the first line (with the three items).

le

b
fera

n
a
r
t
n-

no
a
has
)
om uide
c

G
f. Change the Account Manager of an existing customer
le record.
t
n
rac anddedit
Note: You must navigate to the customeroreport
one
e of the records.
u
t
i@ s S
e
b
i you must go back to the report, and then edit
a the tform,
h
1) Because you want to populate
b
a
e
a record. Click Cancel.
a
us
c
n
o
t
a
bi nse
(
i
abe lice
b
A
a
c
an

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 45

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

2)

Click the Edit icon for one of the rows.

3)

Click one of the quick pick links for Account Manager.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
4) Click Applyia
Changes.
t
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 46

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

5)

The action was processed. Click Application <n> link on the Developer toolbar.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 47

Practice Solution 9-3: Creating an Upload and Download Page

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

Overview
In this practice, you create a form in an HTML region with a file upload item and a button. The
button will submit the page and return the user to the same page. Also, you create a report on
the document table that has links to download documents. Provide links to download the
documents in the report.

Tasks
a.

Create a blank page on page 802 called Upload Download Files with an HTML region
called Submit File that contains a File Browse item type on the source type
WWV_FLOW_FILES. Create a Submit button and upload the oralogo.gif file from the
/home/oracle/labs/files directory.
Note that every time you upload a script in SQL Workshop or upload a file in Shared
Components for an application, the reference to the file is placed in the WWV_FLOW_FILES
table.
1) Navigate to the Order Management application home page and click Create Page >.

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 48

le

b
fera

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

2)

For page type, select the Blank Page option and click Next >.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a
e802 and click Next >.
field,
s
a
u
c
3) In the Page Number
enter
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

4)

For Page Name, enter Upload Download Files and click Next >.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 49

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

5)

Leave the defaults for the Tabs and click Next >.

6)

Click Finish.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
7) Click the Edit Page icon.
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA
8)

Right-click Regions and select Create.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 50

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

9)

For Region, select the HTML option and click Next >.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
e >.
a clickuNext
s
a
10) Select HTML again
and
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 51

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

11) For Title, enter Submit File and click Next >.

le

b
fera

12) Click Create Region.

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
13) Right-click the Submit File b
region andis
select Create Page Item.
a
h
t
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 52

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

14) For Item Type, select File Browse and click Next >.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this and click Next >.
15) For Item Name, enter P802_FILE_NAME
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA
16) Accept the defaults and click Next >.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 53

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

17) Select the Table WWV_FLOW_FILES Storage Type option. Note that every time you
upload a script in SQL Workshop or upload a file in Shared Components for an
application, the reference to the file is placed in the WWV_FLOW_FILES table. Click
Next >.

18) Click Create Item.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 54

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

19) You want to create a Submit button that will perform the upload. Right-click the Submit
File region and select Create Region Button.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
as
h
)
20) Click the [Submit] quick pick and click Next >.
e
m
d
o
i
ec nt Gu
l
c
ra de
o
i@ s Stu
e
b
i
a
h
t
b
a
e
a
us
c
n
o
t
a
bi nse
(
i
abe lice
b
aA
21) Accept the defaults and click Next >.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 55

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

22) Click Create Button.

23) Run the page. Click Run.

le

n
a
r
t
n-

24) Click Browse.

n
Bia

b
fera

no
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
25) Select the /home/oracle/labs/files/oralogo.gif
file and click Open.
a
c
n
o
ia se t
b
(
ei licen
b
a
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 56

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

26) Click Submit to upload files.

27) The file is submitted. At this point, you want to create a report to show the list of files
that are uploaded already. Click the Edit Page link on the Developer toolbar.

le

b
fera

n
a
r
t
n-

no
a
b. Create an Interactive Report sub region called Uploaded Files withsthe following SQL query
(located in /home/oracle/labs/files/lab9-4.txt): ) ha
e
m
d
o
i
SELECT id, filename FROM APEX_APPLICATION_FILES
ec nt Gu
l
order by created_on desc
c
ra de
o
@ Stu
i
e
b
1) You will create the report a
as a sub region.
is Right-click the Submit File region and
h
t
b
select Create Sub Region.
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
A
a
c
an

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 57

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

2)

For the region type, select Report and click Next >.

le

b
fera

n
a
r
t
n-

n
Bia

no
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
e Interactive Report and click Next >.
a uselect
s
a
3) For Report Implementation,
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 58

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

4)

For Title, enter Uploaded Files and click Next >.

5)

When you use the file upload item type, the files that you upload are stored in a table
called wwv_flow_file_objects$. Every workspace has access to this table
through a view called APEX_APPLICATION_FILES. Enter the following SQL query
(located in /home/oracle/labs/scripts/lab9-4.txt) and click Create Region.
select ID, FILENAME from APEX_APPLICATION_FILES
order by CREATED_ON desc

a
c
n
a

n
a
r
t
n-

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

6)

Run the page to see the files that you uploaded. (Note: Your files may differ slightly.)
Click Run.

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 59

le

b
fera

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

7)

The report that you just created shows all the documents that have been uploaded.
Note that your list may be different depending on what you uploaded. Next, you
provide a link to download the document. Click the Edit Page link on the Developer
toolbar.

le

b
fera

n
a
r
t
n-

c.

a
c
n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
e ID column to download the file.
aa linkuonsthe
a
Modify the report to create
c
n
o
t
a
i
b
e
s
i ( theenUploaded
e
1) Double-click
Files region.
b
c
i
a
l
b
A

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 60

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

2)

Click the Report Attributes tab.

3)

In Column Attributes, click the Edit icon next to the ID column.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
4) Click the Link tab.
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 61

5)

In the Link Text field, enter Download. From the Target drop-down list, select URL. In
the URL field, enter the following: p?n=#ID# and click Apply Changes.

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

Note that #ID# passes the value contained in the column, where ID is the column
alias.

le

b
fera

n
a
r
t
n-

n
Bia

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
6) Run the page to see the results.
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
ic
a
l
b
aA

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 62

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

7)

The report is displayed with a link to download the file. Click the Application <n> link
on the Developer toolbar.

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 63

Unauthorized reproduction or distribution prohibited Copyright 2011, Oracle and/or its affiliates

le

b
fera

n
a
r
t
n-

a
c
n
a

n
a
has
)
om uide
c

cle ent G
a
r
@o Stud
i
e
b this
a
b
a use
a
c
n
o
t
a
i
b
e
i ( ens
e
b
lic
ba

Bi

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Adding Items and Buttons


Chapter 9 - Page 64

Anda mungkin juga menyukai