Creating An Application Using Oracle Database 10g Express Edition
Creating An Application Using Oracle Database 10g Express Edition
Purpose
This tutorial shows you how to create an application using Oracle Database 10g Express Edition (XE).
Time to Complete
Approximately 30 minutes
Topics
Overview
Prerequisites
Saving SQL for Use in Applications
Creating a Report Drill Down
Adding a Tabular Form
Editing Application Objects
Applying a New Theme
Summary
Learn More
Viewing Screenshots
Place the cursor over this icon to load and view all the screenshots for this tutorial. (Caution: This action loads all
screenshots simultaneously, so response time may be slow depending on your Internet connection.)
Note: Alternatively, you can place the cursor over an individual icon in the following steps to load and view only the screenshot
associated with that step. You can hide an individual screenshot by clicking it.
Overview
Oracle Application Express is installed in Oracle Database 10g Express Edition as the primary tool for managing the database and
building Web-based applications. Oracle Application Express is a rapid web application development tool for the Oracle database.
Using only a web browser and limited programming experience, you can develop professional applications that are both fast and
secure. The deployed applications require only a browser and access to an Oracle database running Application Express.
Prerequisites
1. Download and install Oracle Database 10g Express Edition from OTN.
2. Open a SQL*Plus window and login as SYS or SYSTEM. Execute the following statement:
In this topic, you create a query that joins 3 tables using the Query Builder. Perform the following steps:
1. Select Start > Programs > Oracle Database 10g Express Edition > Go to Database Home Page.
3. To create your query, click the down arrow next to SQL > Query Builder and then select Create.
4. Select Departments.
5. Select Locations.
6. Select Countries.
7. You need to create a join between the tables so that you can query the data. Select
DEPARTMENTS.LOCATION_ID.
8. With the column selected, drag and drop your mouse on the LOCATIONS.LOCATION_ID column.
9. A line that joins DEPARTMENTS and LOCATIONS is displayed. Now you want to create another join between
LOCATIONS and COUNTRIES. Select LOCATIONS.COUNTRY_ID and drag it to COUNTRIES.COUNTRY_ID.
10. The join is created between LOCATIONS and COUNTRIES. Now you select the columns you want to select when
the query is run. Select the checkboxes in front of each of the following columns and then click Run.
DEPARTMENTS.DEPARTMENT_ID
DEPARTMENTS.DEPARTMENT_NAME
LOCATIONS.CITY
LOCATIONS.STATE_PROVINCE
COUNTRIES.COUNTRY_NAME
11. The results are shown. You want to save this query so you can use it in your application later in this tutorial. Click
Save.
12. Enter Department Locations for the name and click Save.
13. The query is now saved. Click Home to return to the XE Home Page.
Now you can create an Application using Application Builder that contains 2 reports and a form. Perform the following steps:
1. From the XE Home page, click the down arrow next to Application Builder > Create Application and then select
Create Application.
4. You want to use the query you created in the previous topic. Select SQL Query for Page Source, enter
Departments for the Page Name and click Query Builder.
5. Click the Saved SQL tab.
10. Select Departments (1), then select the up arrow for Table Name.
11. Select the EMPLOYEES table.
14. Select DEPARTMENT_NAME for the Link Column, select DEPARTMENT_ID for the Parent Report Column 1, select
the DEPARTMENT_ID for the Report Column, deselect Use Theme-Specific edit button and click Apply Changes.
15. Select the Departments Page Name link for Page 1.
16. Change the Show parameter for DEPARTMENT_ID to No and click Apply Changes.
17. You have created all the pages necessary at this point. Click Next > .
20. Accept the default Authentication and Language Type and click Next > .
23. Your application, Login page and 3 user-defined pages have been created. Click Run Application.
24. The login Page appears. Enter hr for the Username and Password and click Login.
25. The List of Departments (Report) is shown. Select one of the Department links.
26. A List of Employees (Report) for the Department is shown. Select the Edit icon in front of one of the Employees.
1. From the developer links at the bottom of the page, click Edit Page 3.
2. To create a new page, click Create > .
3. Make sure Region on this Page is selected, and click Next >.
4. To specify the component that is going to be added to the page, select the Form option. Click Next >.
11. Select EMPLOYEE_ID for the Primary Key column 1 and click Next >.
12. Select the Existing sequence option. This results in a new Sequence selection list being displayed. From the
Selection drop-down list, select EMPLOYEES_SEQ and click Next >.
13. The columns on the form that are updateable are listed and selected. Click Next >.
14. Change the Region Title to Job History and make sure the Page is set to 3. Then, click Next >.
16. Change When Cancel Button Pressed Branch to this Page to 2 and click Next >.
21. Add the following WHERE clause at the end of the SELECT statement. Then click the Top arrow.
23. To see the new page that displays all the projects, click the Run Page 3 ( )icon.
24. The Form is now shown with the list of Jobs an Employee has had.
Back to Topic List
Although the Master-Detail form is fully functional, the looks can be improved. Perform the following tasks in this topic:
4. Refresh your browser. Notice that the Calendar icon appears next to the Hire Date field. Click the Calendar icon.
5. The calendar widget appears. Click Close.
8. For Create List of Values, keep the default value From Scratch, and click Next >.
9. For Name, enter jobid. For Type, change to Dynamic. Then click Next >.
11. To return to the page, click the Run Page 3 icon at the top right.
12. Click the Edit icon ( ) to the right of Job Id .
14. Under the List of Values section, select JOBID from the Named LOV drop-down list. Click the Top icon ( ).
15. Under the Page Item section, select Select List from the Display As drop-down list. Click Apply Changes.
16. Click the Refresh button in your browse and notice that you know have a drop down list for Job Id. Select the arrow
to see the list of Jobs to choose from.
17. Click Hide Edit Links.
Back to Topic List
1. Click the Edit Application link from the Developer Links at the bottom of the page.
2. Click the down arrow next to Shared Components > User Interface > Themes.
3. To create a new theme, click Create > .
4. Accept the default From the Repository and click Next >.
5. From the Theme options, select the Theme 10 option. Click Next >.
6. Click Create.
9. Notice that the page displays the compatibility between the two themes. This utility checks whether there is a
template in the new theme to replace each of the templates in the current theme. The check marks in the Status
column indicate that the templates are compatible. Click Next >.
12. The color scheme has changed. Click the Departments breadcrumb.
13. Notice that the entire appearance of your application has changed.
Back to Topic List
Summary
Learn More
To learn more about Application Express Development and how to customize the application you built in this tutorial, refer to the
following:
Oracle® Database Express Edition 2 Day Plus Application Express Developer Guide
Oracle Application Express OTN Site