[Home] [Help]
PACKAGE BODY: APPS.PER_SOLUTION_TYPE_API
Source
1 Package Body per_solution_type_api as
2 /* $Header: pesltapi.pkb 115.2 2003/01/04 00:37:18 ndorai noship $ */
3 --
4 -- Package Variables
5 --
6 g_package varchar2(33) := 'PER_SOLUTION_TYPE_API.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |--------------------------< CREATE_SOLUTION_TYPE >-----------------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_solution_type
13 (p_validate in boolean default false
14 ,p_effective_date in date
15 ,p_solution_type_name in varchar2
16 ,p_solution_category in varchar2 default null
17 ,p_updateable in varchar2 default null
18 ,p_object_version_number out nocopy number
19 ) is
20 --
21 -- Declare cursors and local variables
22 --
23 l_proc varchar2(72) := g_package||'CREATE_SOLUTION_TYPE';
24 l_effective_date date;
25 l_solution_type_name PER_SOLUTION_TYPES.SOLUTION_TYPE_NAME%TYPE;
26 l_object_version_number PER_SOLUTION_TYPES.OBJECT_VERSION_NUMBER%TYPE;
27 --
28 begin
29 hr_utility.set_location('Entering:'|| l_proc, 10);
30 --
31 savepoint CREATE_SOLUTION_TYPE;
32 --
33 -- Register user key values
34 --
35 per_slt_ins.set_base_key_value
36 (p_solution_type_name => p_solution_type_name
37 );
38 --
39 -- Truncate the time portion from all IN date parameters
40 --
41 l_effective_date := trunc(p_effective_date);
42 --
43 -- Call Before Process User Hook
44 --
45 begin
46 PER_SOLUTION_TYPE_BK1.CREATE_SOLUTION_TYPE_b
47 (p_effective_date => l_effective_date
48 ,p_solution_type_name => p_solution_type_name
49 ,p_solution_category => p_solution_category
50 ,p_updateable => p_updateable
51 );
52 exception
53 when hr_api.cannot_find_prog_unit then
54 hr_api.cannot_find_prog_unit_error
55 (p_module_name => 'CREATE_SOLUTION_TYPE_b'
56 ,p_hook_type => 'BP'
57 );
58 end;
59 --
60 --
61 per_slt_ins.ins
62 (p_effective_date => l_effective_date
63 ,p_solution_type_name => l_solution_type_name
64 ,p_solution_category => p_solution_category
65 ,p_updateable => p_updateable
66 ,p_object_version_number => l_object_version_number
67 );
68 --
69 -- Call After Process User Hook
70 --
71 begin
72 PER_SOLUTION_TYPE_BK1.CREATE_SOLUTION_TYPE_a
73 (p_effective_date => l_effective_date
74 ,p_solution_type_name => p_solution_type_name
75 ,p_solution_category => p_solution_category
76 ,p_updateable => p_updateable
77 ,p_object_version_number => p_object_version_number
78 );
79 exception
80 when hr_api.cannot_find_prog_unit then
81 hr_api.cannot_find_prog_unit_error
82 (p_module_name => 'CREATE_SOLUTION_TYPE_a'
83 ,p_hook_type => 'AP'
84 );
85 end;
86 --
87 -- When in validation only mode raise the Validate_Enabled exception
88 --
89 if p_validate then
90 raise hr_api.validate_enabled;
91 end if;
92 --
93 -- Set all output arguments
94 --
95 p_object_version_number := l_object_version_number;
96 --
97 hr_utility.set_location(' Leaving:'||l_proc, 70);
98 exception
99 when hr_api.validate_enabled then
100 --
101 -- As the Validate_Enabled exception has been raised
102 -- we must rollback to the savepoint
103 --
104 rollback to CREATE_SOLUTION_TYPE;
105 --
106 -- Only set output warning arguments
107 -- (Any key or derived arguments must be set to null
108 -- when validation only mode is being used.)
109 --
110 p_object_version_number := null;
111 --
112 hr_utility.set_location(' Leaving:'||l_proc, 80);
113 when others then
114 --
115 -- A validation or unexpected error has occured
116 --
117 rollback to CREATE_SOLUTION_TYPE;
118 hr_utility.set_location(' Leaving:'||l_proc, 90);
119 raise;
120 end CREATE_SOLUTION_TYPE;
121 --
122
123
124 -- ----------------------------------------------------------------------------
125 -- |-----------------------< UPDATE_SOLUTION_TYPE >---------------------------|
126 -- ----------------------------------------------------------------------------
127 --
128 procedure update_solution_type
129 (p_validate in boolean default false
130 ,p_effective_date in date
131 ,p_solution_type_name in varchar2
132 ,p_solution_category in varchar2 default hr_api.g_varchar2
133 ,p_updateable in varchar2 default hr_api.g_varchar2
134 ,p_object_version_number in out nocopy number
135 ) is
136 --
137 -- Declare cursors and local variables
138 --
139 l_proc varchar2(72) := g_package||'UPDATE_SOLUTION_TYPE';
140 l_effective_date date;
141 l_object_version_number PER_SOLUTION_TYPES.OBJECT_VERSION_NUMBER%TYPE;
142 --
143 begin
144 hr_utility.set_location('Entering:'|| l_proc, 10);
145 --
146 savepoint UPDATE_SOLUTION_TYPE;
147 --
148 -- Store initial value for OVN in out parameter.
149 --
150 l_object_version_number := p_object_version_number;
151 --
152 -- Truncate the time portion from all IN date parameters
153 --
154 l_effective_date := trunc(p_effective_date);
155 --
156 -- Call Before Process User Hook
157 --
158 begin
159 PER_SOLUTION_TYPE_BK2.UPDATE_SOLUTION_TYPE_b
160 (p_effective_date => l_effective_date
161 ,p_object_version_number => p_object_version_number
162 ,p_solution_type_name => p_solution_type_name
163 ,p_solution_category => p_solution_category
164 ,p_updateable => p_updateable
165 );
166 exception
167 when hr_api.cannot_find_prog_unit then
168 hr_api.cannot_find_prog_unit_error
169 (p_module_name => 'UPDATE_SOLUTION_TYPE_b'
170 ,p_hook_type => 'BP'
171 );
172 end;
173 --
174 --
175 per_slt_upd.upd(
176 p_effective_date => l_effective_date
177 ,p_object_version_number => l_object_version_number
178 ,p_solution_type_name => p_solution_type_name
179 ,p_solution_category => p_solution_category
180 ,p_updateable => p_updateable
181 );
182 --
183 -- Call After Process User Hook
184 --
185 begin
186 PER_SOLUTION_TYPE_BK2.UPDATE_SOLUTION_TYPE_a
187 (p_effective_date => l_effective_date
188 ,p_object_version_number => p_object_version_number
189 ,p_solution_type_name => p_solution_type_name
190 ,p_solution_category => p_solution_category
191 ,p_updateable => p_updateable
192 );
193 exception
194 when hr_api.cannot_find_prog_unit then
195 hr_api.cannot_find_prog_unit_error
196 (p_module_name => 'UPDATE_SOLUTION_TYPE_a'
197 ,p_hook_type => 'AP'
198 );
199 end;
200 --
201 -- When in validation only mode raise the Validate_Enabled exception
202 --
203 if p_validate then
204 raise hr_api.validate_enabled;
205 end if;
206 --
207 --
208 -- Set all output arguments
209 --
210 p_object_version_number := l_object_version_number;
211 --
212 hr_utility.set_location(' Leaving:'||l_proc, 70);
213 exception
214 when hr_api.validate_enabled then
215 --
216 -- As the Validate_Enabled exception has been raised
217 -- we must rollback to the savepoint
218 --
219 rollback to UPDATE_SOLUTION_TYPE;
220 --
221 -- Only set output warning arguments
222 -- (Any key or derived arguments must be set to null
223 -- when validation only mode is being used.)
224 --
225 hr_utility.set_location(' Leaving:'||l_proc, 80);
226 when others then
227 --
228 -- A validation or unexpected error has occured
229 --
230 rollback to UPDATE_SOLUTION_TYPE;
231 hr_utility.set_location(' Leaving:'||l_proc, 90);
232 raise;
233 end UPDATE_SOLUTION_TYPE;
234
235
236 -- ----------------------------------------------------------------------------
237 -- |-----------------------< DELETE_SOLUTION_TYPE >---------------------------|
238 -- ----------------------------------------------------------------------------
239 --
240 procedure delete_solution_type
241 (p_validate in boolean default false
242 ,p_solution_type_name in varchar2
243 ,p_object_version_number in number
244 ) is
245 --
246 -- Declare cursors and local variables
247 --
248 l_proc varchar2(72) := g_package||'DELETE_SOLUTION_TYPE';
249 --
250 begin
251 hr_utility.set_location('Entering:'|| l_proc, 10);
252 --
253 savepoint DELETE_SOLUTION_TYPE;
254 --
255 -- Call Before Process User Hook
256 --
257 begin
258 PER_SOLUTION_TYPE_BK3.DELETE_SOLUTION_TYPE_b
259 (p_solution_type_name => p_solution_type_name
260 ,p_object_version_number => p_object_version_number
261 );
262 exception
263 when hr_api.cannot_find_prog_unit then
264 hr_api.cannot_find_prog_unit_error
265 (p_module_name => 'DELETE_SOLUTION_TYPE_b'
266 ,p_hook_type => 'BP'
267 );
268 end;
269 --
270 per_slt_del.del
271 (p_solution_type_name => p_solution_type_name
272 ,p_object_version_number => p_object_version_number
273 );
274 --
275 begin
276 PER_SOLUTION_TYPE_BK3.DELETE_SOLUTION_TYPE_a
277 (p_solution_type_name => p_solution_type_name
278 ,p_object_version_number => p_object_version_number
279 );
280 exception
281 when hr_api.cannot_find_prog_unit then
282 hr_api.cannot_find_prog_unit_error
283 (p_module_name => 'DELETE_SOLUTION_TYPE_a'
284 ,p_hook_type => 'AP'
285 );
286 end;
287 --
288 -- When in validation only mode raise the Validate_Enabled exception
289 --
290 if p_validate then
291 raise hr_api.validate_enabled;
292 end if;
293 --
294 hr_utility.set_location(' Leaving:'||l_proc, 70);
295 exception
296 when hr_api.validate_enabled then
297 --
298 -- As the Validate_Enabled exception has been raised
299 -- we must rollback to the savepoint
300 --
301 rollback to DELETE_SOLUTION_TYPE;
302 --
303 hr_utility.set_location(' Leaving:'||l_proc, 80);
304 when others then
305 --
306 rollback to DELETE_SOLUTION_TYPE;
307 --
308 hr_utility.set_location(' Leaving:'||l_proc, 90);
309 --
310 raise;
311 --
312 end DELETE_SOLUTION_TYPE;
313
314 --
315 end per_solution_type_api;