How-To Document

How To Create a Tabular Form

Date: 10-DEC-2004

Based on Oracle Application Express (formerly HTML DB) version 1.6

Introduction

A tabular form enables users to update multiple rows in a table at the same time. The Tabular Form Wizard creates a tabular form with a built-in multiple row update process. This built in process does optimistic locking behind the scene to maintain the data integrity.

Creating a Tabular Form Using a Wizard

The Tabular Form Wizard creates a form to perform update, insert, and delete operations on multiple rows in a database table. Additionally, the wizard creates multiple row update process that checks for MD5 checksum values before doing the update in order to prevent lost updates.

The following procedure creates a tabular form on the EMP table that is created when you provision an Oracle HTML DB workspace.

To create a tabular form:

  1. Navigate to the Workspace home page.

  2. From the Applications list, select Sample Application.
  3. Click Create Page >.
  4. For Create New Page, select Page with Component and click Next >.
  5. For Select Component Type, select Form and click Next >.
  6. For Create Page, select Tabular Form and click Next >.
  7. For Table/View Owner, select the owner of the EMP table and click Next >.
  8. For Table / View Name, enter EMP and click Next >.
  9. For Select Columns, select:

    ENAME, JOB, HIREDATE, SAL, COMM

    Note: These columns were limited to make the example fit onto the screen better. For a real form, you would want to include additional columns.

    Click Next >.

  10. For Primary Key Column 1, keep the default of EMPNO and click Next >.
  11. For Source Type, Keep the default of Existing Trigger and click Next >.
  12. For Updateable Columns, select:

    JOB, HIREDATE, SAL, COMM

    Click Next >.

  13. For Identify Page and Region Attributes:

    1. For Page, enter 800.
    2. For Page Name, enter Tabular Form on EMP.
    3. For Region Name, enter Tabular Form on EMP.
    4. Click Next >.
  14. For Identify Tab, keep the default of Do not use tabs and click Next >.
  15. For Button Labels, for the Submit Button Label, enter Apply Changes. Keep the other defaults and click Next >.
  16. For Identify Branching, keep the defaults and click Next >.
  17. Review your selections and click Finish.
  18. Select Run Page. (See Figure 1.)

    If you have already run the application in this session, you will be taken directly to the page. If you haven't, you will need to login to the application using the directions listed on the login page (use the demo user). Once you have logged in, you will be taken to the first page defined by the application, not your new page. You will need to change your url to navigate to page 800. To do this, just change the second parameter, the page identifier, after the 'f?p=' to 800 (e.g. change from 'f?p=100:1:...' to 'f?p=100:800:...').

Figure 1: Tabular Form on the EMP Table

Tabular Form on the EMP Table

This illustration shows a tabular form on the EMP table being run. The tabular form contains four buttons. Cancel, Delete, and Apply Changes display in the upper right corner and Add Row displays at the bottom. Additionally, a check box appears to the left of each row enabling the user to select one row at a time, or users can select all rows at once by selecting the check box to the left of the column headings. The checkbox is used in concert with the Delete button to identify the row(s) for deletion.

Edit Restrictions on Wizard Generated Tabular Forms

You should not modify the select list of a SQL statement of a tabular form after it has been generated. Doing so can result in a checksum error when altering data of the form and applying updates. Consider the following example:

select ename from emp

Note that this should not be altered to:

select lower(ename) from emp