Including Balance Values in Reports

This section describes the PL/SQL interface for the GB balance function that enables you to access balance values for inquiry and reporting tools.

Advantages

Using this PL/SQL function to retrieve balance values has several advantages:

The Balance Function

The interface to the function is flexible and easy to use. Hard coded knowledge of contexts within the function are kept to a minimum and the balance function is controlled as follows:

Although one interface is used to directly call the GB Balance value function, the PL/SQL code resides in three packages:

Function: Get balance value (Assignment Action mode):

function get_balance (p_assignment_action_id	in	number,
					p_defined_balance_id	in	number)
return number;

Function: Get balance value (Date mode):

function get_balance (p_assignment_id		in	number,
					p_defined_balance_id	in	number,
					p_effective_date	in 	date)
return number;

The balance value is returned by these functions. The parameters required for the function have been kept to a minimum.

Example

Supposing we take an assignment action id of 12345 and a defined balance id of 111:

l_balance := hr_dirbal.get_balance (12345, 111); 

This would return a balance value, using the Assignment Action mode call to the package.

Supposing we take an assignment id of 2, the same defined balance id, and an arbitrary date:

l_balance := hr_dirbal.get_balance (2,111,to_date('01/01/1998','DD/MM/YYYY'));

This would return a balance value, using the Date mode call to the package.