Databases Reference
In-Depth Information
Figure 3-30. A success message from making the change shown in Figure 3-29
Updating a Collection via an On-Demand Process
Since a collection is only a snapshot of the original data, you can use a different approach for an update.
You can create some JavaScript code and combine that with an On-Demand Process to update the
collection when a single Tabular Form item changes. The validation of the collection values will be done
only if you decide to save the collection back to the source. You will include only some basic validations
for numeric and date columns in this code.
The code you need to write for this demonstration consists of
One procedure for updating a collection member
Two small JavaScript functions
Three application items you will use for parsing parameters: T_COL_VAL_ITEM,
T_COL_SEQ_ITEM, T_COL_ATTR_ITEM
One On-Demand Process to call your procedure
Note Always use the same prefix for application items. In this case you are using T_, but you could use any
other letter or any combination of letters in the front.
The procedure code you will add to your package is shown in Listing 3-11.
Listing 3-11 . Tabular Form—Collection— Update on Demand
PROCEDURE update emp coll member (
p seq id IN NUMBER,
p attribute number IN NUMBER,
p attribute value IN VARCHAR2
);
PROCEDURE update emp coll member (
Search WWH ::




Custom Search