Oracle Application Express: Developing Database Web Applications
Oracle Application Express: Developing Database Web Applications
Oracle Application Express: Developing Database Web Applications
Hands-On-Labs Guide
HOL 2-1: Loading the Tables and Data: In this lab, you will use SQL Workshop to create the
underlying database objects and data required for you to build the Demo Projects application.
HOL 2-2: Creating a Lookup Table: In this lab, you will create a tabled named HARDWARE
and load data into the table. Then, you create a lookup table.
2
Oracle Application Express: Developing Database Web Applications
It is essential to have at least the tables defined in order for the Create Application wizard to
generate pages in your application. In this hands-on-lab, you create the required database objects,
and populate the tables with sample data.
1. Use SQL Workshop to upload a script that creates the tables for the Demo Projects application.
Perform the following steps:
b) Click Upload.
3
Oracle Application Express: Developing Database Web Applications
Open.
Click Upload.
f) Click the Run icon to the right of the script you uploaded.
4
Oracle Application Express: Developing Database Web Applications
5
Oracle Application Express: Developing Database Web Applications
h) Scroll down to view the results of the script that you just ran.
2. Currently the tables you created do not have any data. A script has been provided that creates an
Oracle database package which can be run at any time to insert or reset the data in the tables.
Use SQL Workshop to upload a script that you can use to populate table data. Perform the
following steps:
c) Locate the Project_Data.sql file, and double-click the file or click the file and then click
Open.
Click Upload.
d) Click the Run icon to the right of the script you uploaded (top row).
6
Oracle Application Express: Developing Database Web Applications
7
Oracle Application Express: Developing Database Web Applications
begin
demo_projects_data_pkg.load_sample_data;
end;
d) Click Run.
4. Use the Object Browser within SQL Workshop to review all of the database objects, such as the
tables and packages you created, available in the underlying Oracle database schema which is
associated with the Application Express workspace you logged into. Perform the following
steps:
a) At the top of the page, select SQL Workshop and then select Object Browser.
8
Oracle Application Express: Developing Database Web Applications
Note: There are a number of other tables listed, outside of those you created using the script
file above.
9
Oracle Application Express: Developing Database Web Applications
e) Click Body to review the primary PL/SQL rather than the specification.
10
Oracle Application Express: Developing Database Web Applications
Note: This package includes complex PL/SQL code to insert images and replicate users
entering in records. It is not important that you understand the PL/SQL code in this
package, as you will not normally have to populate data in this matter. Generally, you
would create the tables with no data and then use the application you build to insert the
records.
11
Oracle Application Express: Developing Database Web Applications
In this hands-on-lab, you use the Data Workshop utility to create a table and populate the table with
data. Once this table is created, you also create a lookup table.
4. Locate the hardware.csv file, and then drag and drop the file to the Load Data dialog.
Alternatively, in the Load Data dialog, click Choose File, and then double-click
the hardware.csv file.
12
Oracle Application Express: Developing Database Web Applications
5. Enter Hardware for Table Name, accept the remaining defaults and click Load Data.
6. The new table is now created and is populated with the data. Click View Table.
13
Oracle Application Express: Developing Database Web Applications
14
Oracle Application Express: Developing Database Web Applications
Now you see a report of the data contained in the Hardware table.
8. You want to create a lookup table now. Perform the following steps:
15
Oracle Application Express: Developing Database Web Applications
16
Oracle Application Express: Developing Database Web Applications
17
Oracle Application Express: Developing Database Web Applications
18