Databases Reference
In-Depth Information
Checksum
APEX 4 Tabular Form wizard creates a hidden checksum item for every Tabular Form. This checksum
will be used for later automatic MRU and MRD processes. Using the Firebug extension of Firefox, you
can see that hidden item if you investigate the generated HTML, as shown in Figure 3-19.
Figure 3-19. Tabular Form— checksum
When talking about checksum and data integrity, you need to keep several issues in mind:
If you want to run your custom code, you will need to do a check and find out if
the data in a row has changed. It doesn't make sense to do an update on a row that
hasn't changed.
If the data has changed, you will need to compare the checksum of the original
data you loaded while rendering the page and the checksum of the current data in
the table for each row.
If a row has changed (if the old checksum in the g_fcs array is not the same as the
new checksum of the tabular form rows you calculate), you will need to do an
update.
However, you should be able to update only then if the original data in the table
hasn't been changed since the last fetch (old checksum in the g_fcs array is not the
same as the new checksum of the row in the table you need to calculate).
Otherwise, there should be an error displayed and you should stop the processing.
Validations
Following the rules outlined in the previous section, you can start extending your package by adding
some new functions:
The first function will compare the original checksum with the new generated
checksum for each row in the Tabular Form. It will return a BOOLEAN.
The second function will compare the original checksum with the checksum of the
data in the table for each row where the first function returns FALSE. It will return
a BOOLEAN as well.
Finally, the third function will be a validation function returning an error message
in case some of the rows you are trying to update have been changed by other
users. The second function returns FALSE.
Search WWH ::




Custom Search