DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_PARENT_SPINES_PKG

Source


1 package body PER_PARENT_SPINES_PKG as
2 /* $Header: pepsp01t.pkb 115.2 2003/02/10 17:20:43 eumenyio ship $ */
3 
4 
5 procedure chk_unique_name(p_name IN VARCHAR2,
6                           p_rowid IN VARCHAR2,
7                           p_bgroup_id IN NUMBER) IS
8     l_exists VARCHAR2(1);
9 
10 cursor c1 is
11 select 'x'
12 from per_parent_spines
13 where upper(name) = upper(p_name)
14 and (p_rowid is null
15  or (p_rowid is not null and chartorowid(p_rowid) <> rowid))
16 and business_group_id + 0 = p_bgroup_id;
17 --
18 begin
19 --
20 hr_utility.set_location('per_parent_spines_pkg.chk_unique_name',1);
21 --
22 open c1;
23 --
24   fetch c1 into l_exists;
25 --
26   IF c1%found THEN
27     hr_utility.set_message(801, 'PER_7920_PAR_SPN_EXISTS');
28     close c1;
29     hr_utility.raise_error;
30   END IF;
31 --
32 close c1;
33 
34 end chk_unique_name;
35 
36 
37 
38 procedure stb_del_validation(p_pspine_id IN NUMBER) is
39     l_exists1 VARCHAR2(1);
40     l_exists2 VARCHAR2(1);
41     l_exists3 VARCHAR2(1);
42 
43 cursor c2 is
44 select 'x'
45 from per_spinal_points
46 where parent_spine_id = p_pspine_id;
47 --
48 cursor c3 is
49 select 'x'
50 from per_grade_spines_f
51 where parent_spine_id = p_pspine_id;
52 --
53 cursor c4 is
54 select 'x'
55 from pay_rates
56 where parent_spine_id = p_pspine_id;
57 --
58 begin
59 --
60 hr_utility.set_location('per_parent_spines_pkg.stb_del_validation',1);
61 --
62 open c2;
63 --
64   fetch c2 into l_exists1;
65 --
66   IF c2%found THEN
67     hr_utility.set_message(801, 'PER_7921_DEL_PAR_SPN_POINT');
68     close c2;
69     hr_utility.raise_error;
70   END IF;
71 --
72 close c2;
73 --
74 hr_utility.set_location('per_parent_spines_pkg.stb_del_validation',2);
75 --
76 open c3;
77 --
78   fetch c3 into l_exists2;
79 --
80   IF c3%found THEN
81     hr_utility.set_message(801, 'PER_7922_DEL_PAR_SPN_GRDSPN');
82     close c3;
83     hr_utility.raise_error;
84   END IF;
85 --
86 close c3;
87 --
88 hr_utility.set_location('per_parent_spines_pkg.stb_del_validation',3);
89 --
90 open c4;
91 --
92   fetch c4 into l_exists3;
93 --
94   IF c4%found THEN
95     hr_utility.set_message(801, 'PER_7923_DEL_PAR_SPN_RATE');
96     close c4;
97     hr_utility.raise_error;
98   END IF;
99 --
100 close c4;
101 --
102 end stb_del_validation;
103 
104 
105 
106 procedure get_id(p_pspine_id IN OUT NOCOPY NUMBER) is
107 
108 cursor c5 is
109 select per_parent_spines_s.nextval
110 from sys.dual;
111 --
112 begin
113 --
114 hr_utility.set_location('per_parent_spines_pkg.get_id',1);
115 --
116 open c5;
117 --
118   fetch c5 into p_pspine_id;
119 --
120 close c5;
121 --
122 end get_id;
123 
124 
125 
126 procedure get_name(p_incp IN VARCHAR2,
127                    p_dinc IN OUT NOCOPY VARCHAR2) is
128 
129 cursor c6 is
130 select meaning
131 from hr_lookups
132 where lookup_type = 'FREQUENCY'
133 and lookup_code = p_incp;
134 --
135 begin
136 --
137 hr_utility.set_location('per_parent_spines_pkg.get_name',1);
138 --
139 open c6;
140 --
141   fetch c6 into p_dinc;
142 --
143 close c6;
144 --
145 end get_name;
146 
147 
148 
149 
150 end PER_PARENT_SPINES_PKG;