Download Oracle HRMS US Implementation Guide

Transcript
In some cases you may want to write your pl/sql routines using the
public API procedures as building blocks. This allows you to write
routines specific to your business needs. For example, say that you have
a business requirement to apply a DateTracked update to a row and
then apply a DateTrack delete to the same row in the future. You could
write an ”update_and_future_del” procedure which calls two of the
standard APIs.
When calling each standard API, p_validate must be set to false. If true
is used the update procedure call is rolled back. So when the delete
procedure is called, it is working on the non–updated version the row.
However when p_validate is set to false, the update is not rolled back.
Thus, the delete call operates as if the user really wanted to apply the
whole transaction.
If you want to be able to check that the update and delete operation is
valid, you must issue your own savepoint and rollback commands. As
the APIs do not issue any commits, there is no danger of part of the
work being left in the database. It is the responsibility of the calling code
to issue commits. The following simulates some of the p_validate true
behavior.
Example
savepoint s1;
update_api_prc(.........);
delete_api_prc(..........);
rollback to s1;
You should not use our API procedure names for the savepoint names.
An unexpected result may occur if you do not use different names.
Understanding the p_effective_date Control Parameter
Most APIs which insert/update/delete data for at least one DateTrack
entity have a p_effective_date control parameter. This mandatory
parameter defines the date you want an operation to be applied from.
The pl/sql datatype of this parameter is date.
As the smallest unit of time in DateTrack is one day, the time portion of
the p_effective_date parameter is not used. This means that the change
always comes into affect just after midnight.
Some APIs have a more specific date for processing. For example, the
create_employee API does not have a p_effective_date parameter. The
p_hire_date parameter is used as the first day the person details come
into effect.
A – 64
Oracle HRMS US Implementation Guide