This section describes how to use automatic Data Manipulation Language (DML) in Oracle Application Express to update or delete rows of a table.
When you use automatic Data Manipulation Language (DML) in Oracle Application Express to update or delete rows of a table, a transaction is initiated to first lock the row, verify if it has changed since it was displayed on the page, and then finally issue the actual
DELETE statement for the row.
In some environments where locking of rows is prevalent, you may want to control the DML operation and determine if the DML operation:
waits for a specified period of time
You can set the value of an application substitution string, an application item, or a page item to
APEX_DML_LOCK_WAIT_TIME to control the DML operation. APEX_DML_LOCK_WAIT_TIME supports the following values:
NULL (the default), results in the same behavior as previous versions of Oracle Application Express, that is, wait indefinitely.
0 fails immediately if the row is locked by another database session.
> 0 and the row is locked, waits for the specified number of seconds.
When set in an application, the value for
APEX_DML_LOCK_WAIT_TIME applies to all
DELETE DML operations using Automatic DML in the entire application. To control a specific Automatic DML process, update the value of
APEX_DML_LOCK_WAIT_TIME before the Automatic DML process and reset it after the Automatic DML process. Note that this does not affect updates and deletes using tabular forms.
You can also set the value of an application substitution string, an application item, or a page item to
FSP_DML_LOCK_ROW to control the DML operation.
FSP_DML_LOCK_ROW supports the following values:
If the value is set to
FALSE, then no
SELECT FOR UPDATE is issued.
If the value is anything other than
FALSE, the default behavior of
SELECT FOR UPDATE is performed when issuing an
DELETE DML operation using Automatic DML.