Application Express User's Guide > Oracle Application Express ... > HTMLDB_ITEM > MULTI_ROW_UPDATE ...
MULTI_ROW_UPDATE Procedure |
Previous |
Next |
Use this procedure within a Multi Row Update process type. This procedure takes a string containing a multiple row update definition in the following format:
OWNER:TABLE:pk_column1,pk_idx:pk_column2,pk_idx2|col,idx:col,idx...
Syntax
HTMLDB_ITEM.MULTI_ROW_UPDATE( p_mru_string IN VARCHAR2 DEFAULT) RETURN VARCHAR2;
Example
To use this procedure indirectly within an application-level process, you need to create a query to generate a form of database data. The following example demonstrates how to create a multiple row update on the emp
table.
SELECT empno, HTMLDB_ITEM.HIDDEN(1,empno), HTMLDB_ITEM.HIDDEN(2,deptno), HTMLDB_ITEM.TEXT(3,ename), HTMLDB_ITEM.SELECT_LIST_FROM_QUERY(4,job,'SELECT DISTINCT job FROM emp'), HTMLDB_ITEM.TEXT(5,sal), HTMLDB_ITEM.TEXT(7,comm), HTMLDB_ITEM.MD5_CHECKSUM(ename,job,sal,comm), deptno FROM emp WHERE deptno = 20
Note the call to HTMLDB_ITEM.MD5_CHECKSUM
, instead of HTMLDB_ITEM.MD5_HIDDEN
. Since HTMLDB_ITEM.MULTI_ROW_UPDATE
gets the checksum from HTMLDB_APPLICATION.G_FCS
, you need to call HTMLDB_ITEM.MD5_CHECKSUM
in order to populate HTMLDB_APPLICATION.G_FCS
when the page is submitted. Additionally, the columns in HTMLDB_ITEM.MD5_CHECKSUM
must be in the same order those in the MULTI_ROW_UPDATE
process. These updates can then processed (or applied to the database) using an after submit page process of Multi Row Update in a string similar to the following:
SCOTT:emp:empno,1:deptno,2|ename,3:job,4:sal,5:comm,7:,:,:,:,