1 PACKAGE BODY PER_JOB_EVALUATIONS_PKG as
2 /* $Header: pejbe01t.pkb 115.1 99/07/18 13:54:54 porting ship $ */
3 --
4 procedure system_measured_name(p_system_name in out varchar2,
5 p_system in varchar2,
6 p_measured_in_name in out varchar2,
7 p_measured_in in varchar2) is
8 --
9 cursor csr_system is select meaning
10 from hr_lookups
11 where lookup_type = 'EVAL_SYSTEM'
12 and lookup_code = p_system;
13 --
14 cursor csr_measured is select meaning
15 from hr_lookups
16 where lookup_type = 'EVAL_SYSTEM_MEAS'
17 and lookup_code = p_measured_in;
18 --
19 begin
20 --
21 -- Retrieve the system name
22 --
23 open csr_system;
24 fetch csr_system into p_system_name;
25 if (CSR_SYSTEM%NOTFOUND) then
26 hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
27 hr_utility.set_message_token('PROCEDURE','system_measured_name');
28 hr_utility.set_message_token('STEP','1');
29 end if;
30 close csr_system;
31 --
32 -- Retrieve the measured in name
33 --
34 open csr_measured;
35 fetch csr_measured into p_measured_in_name;
36 if (CSR_MEASURED%NOTFOUND) then
37 hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
38 hr_utility.set_message_token('PROCEDURE','system_measured_name');
39 hr_utility.set_message_token('STEP','1');
40 end if;
41 close csr_measured;
42 --
43 hr_utility.set_location('PER_JOB_EVALUATIONS_PKG.system_measured_name', 1);
44 --
45 end system_measured_name;
46 --
47 procedure get_next_sequence(p_job_evaluation_id in out number) is
48 --
49 cursor csr_id is select per_job_evaluations_s.nextval
50 from sys.dual;
51 --
52 begin
53 --
54 -- Get the next sequence number for job_avaluation_id
55 --
56 if (p_job_evaluation_id is null) then
57 --
58 open csr_id;
59 fetch csr_id into p_job_evaluation_id;
60 --
61 if (csr_id%NOTFOUND) then
62 CLOSE csr_id;
63 hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
64 hr_utility.set_message_token('PROCEDURE','get_next_sequence');
65 hr_utility.set_message_token('STEP','1');
66 end if;
67 --
68 close csr_id;
69 --
70 end if;
71 --
72 hr_utility.set_location('PER_JOB_EVALUATIONS_PKG.get_next_sequence', 1);
73 --
74 end get_next_sequence;
75 --
76 procedure check_evaluation_exists (p_job_id in number,
77 p_position_id in number,
78 p_job_evaluation_id in number,
79 p_system in varchar2,
80 p_date_evaluated in date,
81 p_rowid in varchar2,
82 p_evaluation_exists in out boolean) is
83 --
84 cursor csr_evaluation is select null
85 from per_job_evaluations je
86 where (job_evaluation_id <> p_job_evaluation_id
87 or p_job_evaluation_id is null)
88 and (je.job_id = p_job_id or p_job_id is null)
89 and (je.position_id = p_position_id
90 or p_position_id is null)
91 and nvl(je.system, 'NO SYSTEM') = nvl(p_system, 'NO SYSTEM')
92 and je.date_evaluated = p_date_evaluated;
93 --
94 g_dummy_number number;
95 --
96 begin
97 --
98 -- Check there is a duplcate evaluation record
99 --
100 open csr_evaluation;
101 fetch csr_evaluation into g_dummy_number;
102 p_evaluation_exists := csr_evaluation%FOUND;
103 close csr_evaluation;
104 --
105 --
106 hr_utility.set_location('PER_JOB_EVALUATIONS_PKG.check_evaluation_exists', 1);
107 --
108 end check_evaluation_exists;
109 --
110 END PER_JOB_EVALUATIONS_PKG;