Oracle APEX forms give developers a fast way to turn Oracle Database
tables into practical web applications. Whether you need an employee
directory, a product catalog, a purchase request screen, or a customer
management system, a form lets authorized users enter, review, and
modify information without working directly with SQL commands. Oracle
APEX combines a visual development environment with the capabilities of
Oracle Database and PL/SQL, making it particularly attractive for
building database-driven business applications.
In this Oracle APEX form tutorial, you will learn how to create a
complete employee maintenance form from scratch. We will define a table,
generate an interactive report and a form, configure page items, create
a list of values, implement validation, and test the insert, update, and
delete operations. We will also examine how automatic SQL processing
works and where custom PL/SQL code belongs in an application.
The tutorial uses Oracle APEX 24.2 as a reference. You can apply the
same principles in later releases, although certain wizard labels and
property locations may differ. The SQL examples use a modern Oracle
Database release that supports identity columns.
Figure 1. The employee form connects a database table with a report and a record editor. Original illustration.
What are Oracle APEX forms?
An Oracle APEX form is a collection of web page components that allow
users to interact with data. A typical form contains text fields, number
fields, date pickers, select lists, buttons, and validation rules. These
components are represented as page items in APEX, and their values can
be associated with columns in an Oracle Database table.
When a user opens an existing employee record, for example, the form
retrieves that employee’s information and displays it in editable
fields. When the user submits a new employee or saves a change, APEX
processes the submitted values and performs the configured database
operation. The application can also display feedback messages, highlight
invalid fields, and return the user to a report after processing
succeeds.
A form can be configured declaratively through Page Designer.
Developers select properties, define sources and conditions, and arrange
components within regions. SQL and PL/SQL are available when the
application requires specialized queries, calculations, business rules,
or calls to stored procedures. This combination makes APEX useful for
both straightforward data entry and sophisticated enterprise
applications.
For developers who are learning the database side of APEX, the Oracle PL/SQL tutorial provides a
foundation in SQL statements, data types, variables, procedures, and
other concepts used throughout this guide.
Types of forms in Oracle
APEX
Oracle APEX offers several approaches to editing application data.
Choosing the right one depends on the relationship between your tables,
the volume of records your users manage, and the workflow you want to
support.
Form type
Typical use
Form
Create or edit one database row, such as an employee profile.
Report with form
Search for records in a report and open an individual record for
editing.
Editable interactive grid
Review and edit multiple rows in a spreadsheet-like interface.
Master detail form
Manage a parent record and related child records, such as an order
and its line items.
A standard form is ideal when users need focused attention on one
record at a time. An interactive report with a form is a natural choice
for a maintenance application because users can filter, sort, search,
and find the required record before opening the form. Editable
interactive grids can be more efficient where a user routinely updates
many similar entries. Master detail pages suit relationships such as
invoices and invoice details or projects and tasks.
For our employee management example, we will create an interactive
report with a form. This gives us two complementary views: a searchable
employee list and an editor for a single employee. Oracle documents
these options in its guide
to APEX form types.
Prerequisites
for creating an Oracle APEX form
Before you begin, make sure that you can sign in to an Oracle APEX
workspace and have access to App Builder and SQL Workshop. Your
workspace should be associated with a database schema in which you are
permitted to create a table. An administrator may need to grant the
appropriate development privileges in a managed environment.
Basic knowledge of SQL is helpful because the structure of the
underlying table determines the type of information the form can store.
Understanding primary keys, column data types, and constraints will help
you configure an application that handles data consistently. You should
also be familiar with the difference between selecting rows and
modifying them. The PL/SQL DML
statements guide explains core operations such as INSERT, UPDATE,
and DELETE.
You can follow the example using a new APEX application or a
development application that already exists. The example uses its own
table named APEX_EMPLOYEES to reduce the chance of conflicting with a
sample EMP or EMPLOYEES table. If a table with that name already exists,
use a different name consistently or work in a separate sample
schema.
Step 1.
Create an Oracle Database table for the form
A reliable Oracle APEX form begins with a well-designed data source.
Our employee table needs an identifier, a name, an email address, a job
title, a hire date, a salary, and an employment status. Each employee
will occupy one row in the table.
In your APEX workspace, navigate to SQL Workshop, choose SQL
Commands, and run the following CREATE TABLE statement.
CREATE TABLE apex_employees (
employee_id NUMBER GENERATED BY DEFAULT ON NULL AS IDENTITY,
full_name VARCHAR2(100) NOT NULL,
email VARCHAR2(254) NOT NULL,
job_title VARCHAR2(80) NOT NULL,
hire_date DATE NOT NULL,
salary NUMBER(10,2) NOT NULL,
status VARCHAR2(12) DEFAULT 'ACTIVE' NOT NULL,
CONSTRAINT apex_emp_pk PRIMARY KEY (employee_id),
CONSTRAINT apex_emp_email_uk UNIQUE (email),
CONSTRAINT apex_emp_salary_ck CHECK (salary >= 0),
CONSTRAINT apex_emp_status_ck
CHECK (status IN ('ACTIVE', 'INACTIVE', 'ON_LEAVE'))
);
The EMPLOYEE_ID column provides a unique identity for every record.
Oracle generates its value when a new row is inserted with a null
identifier or without an identifier. APEX can use this primary key when
fetching, editing, or deleting a specific row. Users do not need to
choose the identifier themselves.
The VARCHAR2 columns store character data, while DATE stores the
employee’s hire date and NUMBER stores the salary. The precision and
scale of NUMBER(10,2) allow up to eight digits before the decimal point
and two after it. The NOT NULL constraints require essential information
to be present. The UNIQUE constraint prevents identical email strings
from being stored twice, and the CHECK constraints restrict salaries and
status values to valid ranges.
These database constraints remain effective even when information is
entered from a different application or SQL tool. They protect the table
at the database level and complement the application-level validations
we will configure later. If your business treats email addresses as
case-insensitive, define a consistent normalization policy and enforce
it in the database as well.
Figure 2. Database schema for the employee maintenance form.
Step 2. Insert sample
employee records
Sample data helps you verify the report and form before introducing
real information. Execute the following commands in SQL Workshop. If
your SQL Commands environment runs one statement at a time, run each
INSERT separately and commit the transaction where appropriate. You can
also use SQL Scripts to execute the complete script.
INSERT INTO apex_employees
(full_name, email, job_title, hire_date, salary, status)
VALUES
('Maya Patel', 'maya@example.com', 'Developer',
DATE '2024-03-11', 7200, 'ACTIVE');
INSERT INTO apex_employees
(full_name, email, job_title, hire_date, salary, status)
VALUES
('Alex Morgan', 'alex@example.com', 'Analyst',
DATE '2023-08-21', 5800, 'ON_LEAVE');
COMMIT;
You can confirm that the table contains the expected rows with this
query.
SELECT employee_id, full_name, email, job_title,
hire_date, salary, status
FROM apex_employees
ORDER BY employee_id;
The generated identity values may vary depending on your database and
earlier inserts. The exact numerical values do not matter as long as
each row has a distinct primary key. For additional examples of adding
records to Oracle tables, see PL/SQL INSERT.
Step 3. Create an
Oracle APEX application
Return to the APEX workspace home page and open App Builder. Select
Create to start a new application, or open an existing application if
you want to add the form to a project already under development. In the
application creation wizard, use Employee Management as the application
name and choose the appropriate parsing schema.
Create the application using the default Universal Theme and the
authentication settings that are appropriate for your workspace. For
this tutorial, a basic development application with authenticated access
is sufficient. When using the default navigation options, APEX can place
the employee report in the application’s menu so that users have a
convenient way to return to the list.
The newly created application’s home page serves as a starting point
for adding additional pages. You can add reports, forms, charts,
dashboards, and other components over time. Keeping the employee record
editor separate from the home page helps establish a clear navigation
structure, especially if the application later grows to include
departments and other human resources information.
Step 4.
Generate the interactive report and form
Open the Employee Management application in App Builder and select
Create Page. In the available component types, choose Interactive
Report. Enable the option to include a form page. In the APEX 24.2
Create Page Wizard, this option generates a report and a related form
together.
Configure the report using the local database as the data source and
select the APEX_EMPLOYEES table. Name the report Employees. Choose
Employee Details for the form page name. Where the wizard allows you to
choose the form’s page mode, a modal dialog makes a convenient record
editor because the underlying report remains in context. A normal page
works equally well when the editor needs more space.
Confirm EMPLOYEE_ID as the primary key when prompted. Select the
relevant columns and review the wizard’s settings before creating the
pages. APEX can generate the form region, database-mapped items, form
initialization and processing components, and navigation that connects
the report to the editor.
If you only need a standalone editor, select Form directly in the
Create Page Wizard and configure the local table source. The generated
editor will still need a clear route back to the application’s other
pages. Consult Oracle’s creating
a form documentation for the corresponding wizard options.
Figure 3. Conceptual mockup of the employee interactive report. The generated theme and controls may look different.
Step 5. Customize
page items in Page Designer
After creating your pages, open Employee Details in Page Designer.
Page Designer allows you to inspect and modify the structure of a page,
including its regions, items, buttons, validation rules, processes, and
branches. Select individual components to see the associated
properties.
Suppose the generated form page has page number 3. Its page items
will generally have names such as P3_EMPLOYEE_ID and P3_FULL_NAME. If
APEX assigned a different page number, use the actual item names from
your application in the following examples.
Database column
Example page item
Recommended item type
EMPLOYEE_ID
P3_EMPLOYEE_ID
Hidden
FULL_NAME
P3_FULL_NAME
Text Field
EMAIL
P3_EMAIL
Text Field with email input subtype if available
JOB_TITLE
P3_JOB_TITLE
Text Field
HIRE_DATE
P3_HIRE_DATE
Date Picker
SALARY
P3_SALARY
Number Field
STATUS
P3_STATUS
Select List
A hidden primary key item carries the identity of the selected
record. The fields that users will enter directly should have readable
labels, appropriate input types, and lengths consistent with the
database columns. Full Name, Email Address, Job Title, Hire Date,
Salary, and Employment Status are more natural labels than uppercase
database names.
Check that each generated item belongs to the form region and retains
its original database column mapping. This relationship helps the form
processing components associate the submitted values with the correct
columns in the table. Replacing a generated item or changing its source
requires care because an incorrect mapping can leave data blank or stop
changes from being persisted.
Arrange the items in a clear order. A user should encounter
identifying information first, followed by job-related details and
employment information. If the editor grows more complex, place related
fields into separate sections with descriptive headings. Consider a
one-column layout on narrower devices and leave enough space for error
messages beneath fields.
Figure 4. Conceptual mockup of the completed employee form. Required fields use an asterisk.
Step 6.
Create a list of values for the status field
A list of values, often abbreviated LOV, is a reusable or local
definition of the choices a user can select. Using an LOV for employment
status provides a consistent interface, reduces typing, and avoids
common spelling mistakes during data entry.
In Page Designer, select P3_STATUS and change its type to Select
List. Configure its List of Values as static values with the following
display labels and return values.
Display label
Return value
Active
ACTIVE
Inactive
INACTIVE
On leave
ON_LEAVE
The user sees a readable label, while the corresponding return value
is stored in the STATUS database column. Set the field as required and
disable the null display option if every employee must have a status.
Configure a default of ACTIVE for new records if the generated form does
not already present the database default. Test the form after saving
these settings so that editing an existing record preserves its current
status.
Static lists are appropriate when the available choices are short and
relatively stable. If your application uses a configurable table of
employment statuses, create a dynamic LOV based on a SQL query against
that table so that administrators can maintain the choices without
changing the form. Shared LOVs are convenient when multiple pages use
the same set of options.
Step 7. Configure form
validations
Validation ensures that submitted information meets the application’s
business rules before processing continues. APEX can validate individual
page items as well as conditions involving several values. Start with
declarative required-field settings for full name, email, job title,
hire date, salary, and status. Provide simple error messages telling the
user which value needs attention.
Add a server-side validation for P3_SALARY to require a nonnegative
amount. In Page Designer, use the Processing tree to create a validation
and choose the PL/SQL Expression type. The following example assumes the
Number Field returns a valid numeric value and use of an ordinary salary
format.
:P3_SALARY >= 0
Set an associated item of P3_SALARY and an error message such as
Salary must be zero or greater. If your application uses a formatted or
internationalized numeric input, verify how the submitted item is
converted to a number in your workspace and test decimal and grouping
separators. Ensure that invalid numeric input is handled by the item or
validation before calculation.
A separate validation can use a simple regular expression to catch
obviously malformed email addresses. Create another PL/SQL Expression
validation associated with P3_EMAIL.
Use a message such as Enter a valid email address. This is a
practical lightweight format check for the example and does not
establish that the address exists or belongs to the employee. Avoid
applying overly restrictive patterns that reject legitimate addresses.
For production workflows, define the level of verification required by
the business.
The database UNIQUE constraint also checks that the same email string
is not inserted twice. APEX can provide a clearer message through
appropriate error handling. When you need additional validations,
consider which rules belong in the database and which are specific to
the form. A rule required by every application that writes to the table
should be enforced centrally wherever practical.
Step 8. Understand
automatic row processing
The generated form uses APEX components to coordinate data retrieval
and data modification. When a record is opened with its identifier, the
form initialization process obtains the row’s current values. When the
user submits the form successfully, the form’s automatic row processing
process performs the appropriate data manipulation operation based on
the submitted request and configured behavior.
Review the Processing tree in Page Designer. Locate the generated
Form – Automatic Row Processing (DML) process and verify that it
references the employee form region. Examine the generated buttons for
creating, saving, canceling, and deleting records and confirm that their
conditions and actions correspond to the intended operations. The exact
labels and process names can vary by version and wizard settings.
When creating an employee, the primary key is initially null and
Oracle assigns an identity value during insertion. When saving an
existing employee, the previous primary key identifies which row should
be updated. Deleting a record removes the row identified by that key,
provided the application permits the operation and no database rule
prevents deletion.
Automatic processing represents the same fundamental SQL operations
you would write manually. The PL/SQL UPDATE tutorial
explains how UPDATE statements modify existing rows, while the DML guide covers the
common operations used by applications.
Figure 5. A simplified form submission lifecycle, including the validation error path.
Step 9. Use
custom PL/SQL logic when necessary
Many Oracle APEX forms can use their generated DML process for all
routine record maintenance. Custom PL/SQL becomes valuable when the
application must perform a business calculation, invoke an existing
database service, or coordinate an operation involving additional
tables. For example, an organization may store employee changes in a
separate audit system or require an approval workflow before certain
fields can be changed.
The following illustrative PL/SQL expression or code fragment can be
adapted to a computation or process that normalizes the employee’s name
before the form’s DML executes.
BEGIN
:P3_FULL_NAME := TRIM(:P3_FULL_NAME);
END;
If you implement this as a process, choose a suitable execution point
and sequence before the generated DML process. Also consider applying
normalization before validations that depend on the normalized value,
and validate that the trimmed name is not empty. APEX computations,
validations, and processes have different execution points, so confirm
the order with Page Designer and runtime debugging.
For shared business operations, a stored procedure may be preferable
to copying the same multi-step code into several pages. A procedure can
accept parameters, execute business logic, and be invoked by the
application. Learn the fundamentals in the PL/SQL procedure tutorial
and the PL/SQL
anonymous block guide.
Use bind variables such as :P3_EMPLOYEE_ID when referring to form
item values in SQL or PL/SQL. Bind variables allow values to be supplied
separately from SQL text. Avoid constructing SQL statements by
concatenating untrusted form input. Let the application’s transaction
handling coordinate related changes and avoid unnecessary commits within
a process that participates in a larger unit of work. For errors that
need to be handled in PL/SQL, see PL/SQL exception
handling.
Step 10. Run and test
the employee form
Save the application and open the Employees report in runtime mode
using the Run Page or Run Application control. Your sample employees
should appear. Use the generated create button to open a blank form,
enter a valid employee, and submit it. Verify that the new record
appears after the report is refreshed.
Next, open an existing employee through the report’s edit link and
change the job title or salary. Save the changes and reopen the same
record to confirm that the updated values persisted. Verify that changes
affect only the selected employee. If the tutorial application includes
a delete button, test deletion using a disposable sample record with no
related data and confirm any expected confirmation dialog or
message.
Try leaving a required field empty, entering a negative salary,
entering a malformed email address, and reusing an existing email.
Ensure that validation errors are understandable, that the application
does not report success when the submission fails, and that rejected
changes are not persisted. Test both initial record creation and
updates, because a rule can behave differently depending on whether a
primary key already exists.
If a modal form closes successfully but the report still displays old
values, review the generated report refresh logic. A Dialog Closed
dynamic action can refresh the report region after a successful dialog
operation. Confirm that canceling the dialog also behaves appropriately
and does not accidentally submit changes. Check the report again after
reopening the application in a new session.
Best practices
for Oracle APEX form development
Use database constraints to protect important data relationships and
business rules. Keep application validations focused on presenting
helpful feedback, and make required fields easy to identify. Label
inputs in plain language and use appropriate input types to make data
entry more accurate on desktop and mobile devices.
Apply authorization to pages, actions, and relevant backend logic so
that users can perform only the operations allowed by their roles. For
example, some employees may be permitted to view records but not update
salaries or delete profiles. Consider whether sensitive information
should be displayed at all to a particular audience, and enforce
row-level access rules where users may only manage a subset of
records.
Enable suitable lost update detection for forms that several users
may edit concurrently. This helps protect against a user silently
replacing changes saved by someone else while the original form was
open. Test concurrent updates in separate sessions and design useful
feedback for conflicts. Oracle describes related settings in its APEX
developing forms guide.
Keep form layouts straightforward. Place the primary action where
users can find it easily, provide a clear cancel path, and use
consistent terminology across the report and form. Review keyboard
navigation and form labels. Test the editor with long names, narrow
screens, and the date and numeric formats used by the application’s
audience.
Common Oracle
APEX form problems and solutions
If a generated form opens with blank values when editing an existing
employee, inspect the report edit link and verify that it passes the
employee identifier to the form’s primary key item. Confirm the form
initialization process and the source mapping for the blank fields. An
incorrectly cleared item or mismatched page number may also explain the
problem.
If a form fails to save, review required values, validation results,
the enabled processing components, and the button action. Confirm that
the DML process points to the intended form region. Check for database
constraint errors and correct the underlying input or application
configuration. APEX’s runtime Debug option can help trace the processing
steps in a development environment.
If a status select list displays an unexpected value, compare its
return values with the database values and the check constraint. Ensure
that existing data matches the LOV definition. If dates or salaries
produce conversion errors, verify the item format mask and the
application’s date or number format settings. Consistent configuration
across display, validation, and storage reduces avoidable conversion
problems.
If edits appear in the database but not in an interactive report,
check whether a report filter excludes the changed record, whether the
report needs refreshing, or whether the application points to the
expected table or schema. A direct SELECT query in SQL Workshop can help
confirm which rows are actually stored.
Frequently
asked questions about Oracle APEX forms
Can I
create an Oracle APEX form without writing PL/SQL?
Yes. App Builder can generate a database-backed form and the related
processes using declarative settings. SQL knowledge is useful for
defining the database objects and writing data queries. PL/SQL becomes
helpful when the application needs business logic that goes beyond the
generated processes.
How do I
create a form from an existing database table?
Open your application, select Create Page, choose Form, and configure
the local database table as its source. Select the appropriate primary
key and complete the wizard. For a searchable record list with editing
capabilities, create an Interactive Report and enable Include Form Page.
Review the generated components before running the application.
Can an Oracle
APEX form update multiple tables?
Yes. Master detail forms support parent-child relationships, and
custom processing can coordinate modifications across additional related
tables. The appropriate design depends on the data model, business
rules, and transaction requirements. A stored procedure can also
encapsulate complex multi-table operations for consistent use across
different pages.
What
is the difference between a form and an interactive report?
An interactive report displays a collection of records and gives
users tools for searching, filtering, and sorting. A form presents the
fields of an individual record for data entry and editing. Combining the
two provides a convenient record maintenance experience. An editable
interactive grid is another option when multiple records should be
edited within a table-like layout.
Is Oracle APEX the same
as Oracle Forms?
Oracle APEX and Oracle Forms are distinct Oracle development
technologies. APEX produces browser-based applications through a
low-code development environment and uses Oracle Database as a
foundation. Oracle Forms is an established technology with its own
development and runtime architecture. Organizations evaluating
modernization should consider their current application logic, user
interface requirements, deployment architecture, and data model.
Conclusion
Creating Oracle APEX forms is an effective way to make Oracle
Database information accessible through a web application. In this
example, a single employee table became the foundation of an interactive
report, a record editor, and a complete set of create, read, update, and
delete operations. By using Page Designer, lists of values, validations,
and automatic row processing, you can implement a consistent workflow
and extend it with custom PL/SQL as business requirements evolve.
The same approach works for customer records, inventory items,
project details, service requests, and many other applications. Start
with the data model, generate the pages, adapt the fields to the user’s
needs, and verify the full create and edit workflows using
representative input. Continue exploring the Oracle PL/SQL tutorial to develop the
SQL and PL/SQL skills needed for more advanced APEX projects.