Oracle on the Web - Part 3 - Using Applications in HTML DB - Page 2
June 8, 2005
Some preliminary steps
I used the EMPLOYEES table in the HR sample schema that comes with Oracle9i and later. You may have to unlock the HR account (and set a password). Login as HR and grant select on EMPLOYEES to PUBLIC (or the user OBE). Login as OBE and create a table named HR_EMPLOYEES using CTAS (create table as select). The user OBE should have a table with 107 rows (it is a larger version of Scott's EMP table).
Back in HTML DB, navigate to the Home page and click the Build icon. In the list of available applications, select the Collection Showcase.
To add a page to this application, click on the Wizards tab on the top of the page. At the next window, click Tabular Form in the Forms area.
Select the OBE schema and click Next. The flowchart to the left shows where you are in the process.
At the next page, click on the flashlight or search button to see the available tables and views. Select the HR_EMPLOYEES table (it should be at the bottom of the list), and then click Next.
Select all of the columns.
At the next page, I allowed everything but the employee ID number and the hire date to be updateable. Select the EMPLOYEE_ID column for the primary key.
At this page, you have to select a display type. I chose the alternating colors (and changed the Region Title from Tabular Form to ACME Employees and added a different page name).
Skip the tabs page by clicking Next. At the Buttons Label page, "Cancel" for cancel and "Submit" for submit works for me.
At the Identify Branching page, the choices you make (which do not really matter in this example) are where you are sent after a successful submit or a failure. I chose pages 5 and 1. Click Next to move on to the Confirm page, and when finished reviewing the selections, click Finish.
Let's run the page and see what we get. Click Run Page.
You should see a page similar to what is shown below (the one below already reflects a change mentioned next).
Neena (employee 101) was married last week, and her new last name is Smith. The boxed fields are what can be updated, so enter the updates and click Submit. Depending on your branch page choice, you may not come back to this page. Regardless of the branching destination, you should see a confirmation of the change at the top of the destination window.
Overall, creating the tabular form was not too painful. As you can see, the choices under the Wizards tab are fairly extensive. Like other Oracle applications, these wizards are meant to be run only once (modifications are made using other means).
The following wizards build complete page(s). These wizards are one-time generators. The wizards generate multiple attributes, for example, a report wizard generates one page, one region, and multiple buttons. After generation, page attributes can be customized to your exact needs.
In the next article, we will cover the steps to upgrade HTML DB to version 1.6 (including the patch), and look at creating a different web application and validate Mr. Kyte's claim that "It is just too easy." In the meantime, install the Web Service demo and note its similarity to the look and feel of the Ask Tom Web site.