75: ff.formula_name,
76: ff.business_group_id,
77: ff.effective_start_date,
78: ff.effective_end_date
79: from ff_formulas_f ff
80: ,ff_compiled_info_f ffci
81: where ff.formula_id = ffci.formula_id
82: and ff.effective_start_date = ffci.effective_start_date
83: and ff.effective_end_date = ffci.effective_end_date
120: ff.formula_name,
121: ff.business_group_id,
122: ff.effective_start_date,
123: ff.effective_end_date
124: from ff_formulas_f ff
125: ,ff_compiled_info_f ffci
126: where ff.formula_id = ffci.formula_id
127: and ff.effective_start_date = ffci.effective_start_date
128: and ff.effective_end_date = ffci.effective_end_date
155: Name : Get Cache Formula
156: /* =====================================================================
157: Name : Get Cache Formula
158: Purpose : Gets the formula_id from a cached pl/sql table to prevent
159: a full table scan on ff_formulas_f for each person in the
160: payroll run.
161: Returns : formula_id if found, otherwise 0.
162: ---------------------------------------------------------------------*/
163: function get_cache_formula(p_formula_name in varchar2,
190: end get_cache_formula;
191: /* =====================================================================
192: Name : Get Cache Formula (overloaded)
193: Purpose : Gets the formula_id from a cached pl/sql table to prevent
194: a hit on ff_formulas_f for each person in the
195: payroll run.
196: Returns : formula_id if found, otherwise 0.
197: ---------------------------------------------------------------------*/
198: function get_cache_formula(p_formula_id in number,
199: p_calculation_date in date)
200: return varchar2 is
201:
202: ff_rec number;
203: l_formula_name ff_formulas_f.formula_name%TYPE;
204:
205: begin
206: --
207:
223: --
224: /* =====================================================================
225: Name : Get Formula
226: Purpose : Gets the formula_id from a cached pl/sql table to prevent
227: a full table scan on ff_formulas_f for each person in the
228: payroll run.
229: Returns : formula_id if found, otherwise null.
230: ---------------------------------------------------------------------*/
231: function get_formula(p_formula_name in varchar2,
271: end get_formula;
272: /* =====================================================================
273: Name : Get Formula (overloaded)
274: Purpose : Gets the formula_name from a cached pl/sql table to prevent
275: a hit on ff_formulas_f for each PTO formula used.
276: Returns : formula_name if found, otherwise null.
277: ---------------------------------------------------------------------*/
278: function get_formula(p_formula_id in number,
279: p_calculation_date in date)
278: function get_formula(p_formula_id in number,
279: p_calculation_date in date)
280: return varchar2 is
281:
282: l_formula_name ff_formulas_f.formula_name%TYPE;
283:
284: begin
285: --
286: if g_formulas_cached = FALSE then
336: --
337: hr_utility.set_location(l_proc, 5);
338:
339:
340: -- Get the formula ID from a a plsql table instead of ff_formulas_f
341: -- to improve performance of batch processes.
342: l_formula_id := get_formula (
343: p_formula_name => p_formula_name,
344: p_business_group_id => p_business_group_id,
482: ------------------------
483: -- Get the formula id --
484: ------------------------
485:
486: -- Get the formula ID from a a plsql table instead of ff_formulas_f
487: -- to improve performance of batch processes.
488: l_formula_id := get_formula (
489: p_formula_name => p_formula_name,
490: p_business_group_id => p_business_group_id,
519:
520: /* Gets the FF name when a FF is not compiled. */
521: cursor csr_get_ff_name is
522: select ff.formula_name
523: from ff_formulas_f ff
524: where ff.formula_id = p_formula_id
525: and p_calculation_date between
526: ff.effective_start_date and ff.effective_end_date;
527:
524: where ff.formula_id = p_formula_id
525: and p_calculation_date between
526: ff.effective_start_date and ff.effective_end_date;
527:
528: l_formula_name ff_formulas_f.formula_name%TYPE;
529: l_proc varchar2(72) := g_package||'run_formula';
530: l_inputs ff_exec.inputs_t;
531: l_outputs ff_exec.outputs_t;
532: --
535: hr_utility.set_location('Entering '||l_proc, 5);
536:
537: -- Cache this formula. The purpose of this is to fetch the formula name
538: -- (if the formula does not exist or is not compiled it is listed in the
539: -- error message). It is cached to prevent frequent hits on ff_formulas_f
540: -- and ff_compiled_info_f.
541: l_formula_name := get_formula (
542: p_formula_id => p_formula_id,
543: p_calculation_date => p_calculation_date