DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_DE_RESULT_SETS_API

Source


1 Package Body PQH_DE_RESULT_SETS_API as
2 /* $Header: pqrssapi.pkb 115.1 2002/12/03 20:43:18 rpasapul noship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := 'PQH_DE_RESULT_SETS_API.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |--------------------------< Insert_RESULT_SETS >--------------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure Insert_RESULT_SETS
13   (p_validate                      in     boolean  default false
14   ,p_effective_date                in     date
15   ,p_gradual_value_number_from     in     number
16   ,p_gradual_value_number_to       in     number
17   ,p_grade_id                      in     number
18   ,p_result_set_id                 out nocopy    number
19   ,p_object_version_number         out nocopy    number
20   ) is
21   --
22   -- Declare cursors and local variables
23   --
24 
25   l_proc  varchar2(72)    := g_package||'Insert_RESULT_SETS';
26   l_object_Version_Number PQH_DE_RESULT_SETS.OBJECT_VERSION_NUMBER%TYPE;
27   L_Effective_Date        Date;
28   l_RESULT_SET_ID         PQH_DE_RESULT_SETS.RESULT_SET_ID%TYPE;
29 
30 begin
31   hr_utility.set_location('Entering:'|| l_proc, 10);
32   --
33   -- Issue a savepoint
34   --
35 
36 
37       savepoint Insert_RESULT_SETS;
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    PQH_DE_RESULT_SETS_BK1.Insert_RESULT_SETS_b
47    (p_effective_date             => L_Effective_Date
48    ,p_gradual_value_number_from  => p_gradual_value_number_from
49    ,p_gradual_value_number_to    => p_gradual_value_number_to
50    ,P_grade_id                   => P_grade_id  );
51 
52 
53   exception
54     when hr_api.cannot_find_prog_unit then
55       hr_api.cannot_find_prog_unit_error
56         (p_module_name => 'CREATE_RESULT_SETS'
57         ,p_hook_type   => 'BP'
58         );
59   end;
60   --
61   -- Validation in addition to Row Handlers
62   --
63   --
64 
65   -- Process Logic
66      pqh_rss_ins.ins
67     (p_effective_date               => l_Effective_date
68     ,p_gradual_value_number_from    => p_gradual_value_number_from
69     ,p_gradual_value_number_to      => p_gradual_value_number_to
70     ,p_grade_id                     => p_grade_id
71     ,p_result_set_id                => l_result_set_id
72     ,p_object_version_number        => l_OBJECT_VERSION_NUMBER
73     );
74 
75   --
76   -- Call After Process User Hook
77   --
78   begin
79 
80 
81         PQH_DE_RESULT_SETS_BK1.Insert_RESULT_SETS_a
82            (p_effective_date               => l_Effective_date
83            ,p_gradual_value_number_from    => p_gradual_value_number_from
84            ,p_gradual_value_number_to      => p_gradual_value_number_to
85            ,p_grade_id                     => p_grade_id
86            ,p_result_set_id                => p_result_set_id
87            ,p_object_version_number        => l_OBJECT_VERSION_NUMBER  );
88 
89   exception
90     when hr_api.cannot_find_prog_unit then
91       hr_api.cannot_find_prog_unit_error
92         (p_module_name => 'CREATE_RESULT_SETS'
93         ,p_hook_type   => 'AP'
94         );
95   end;
96   --
97   -- When in validation only mode raise the Validate_Enabled exception
98   --
99   if p_validate then
100     raise hr_api.validate_enabled;
101   end if;
102   --
103   -- Set all output arguments
104   --
105   P_RESULT_SET_ID           := l_RESULT_SET_ID;
106   p_object_version_number   := l_object_version_number;
107 
108   --
109   hr_utility.set_location(' Leaving:'||l_proc, 70);
110 exception
111   when hr_api.validate_enabled then
112     --
113     -- As the Validate_Enabled exception has been raised
114     -- we must rollback to the savepoint
115     --
116      rollback to Insert_RESULT_SETS;
117     --
118     -- Only set output warning arguments
119     -- (Any key or derived arguments must be set to null
120     -- when validation only mode is being used.)
121     --
122     p_RESULT_SET_ID          := null;
123     p_object_version_number  := null;
124     hr_utility.set_location(' Leaving:'||l_proc, 80);
125 
126   when others then
127       p_RESULT_SET_ID          := null;
128     p_object_version_number  := null;
129     --
130     -- A validation or unexpected error has occured
131     --
132     rollback to Insert_RESULT_SETS;
133     hr_utility.set_location(' Leaving:'||l_proc, 90);
134     raise;
135 end Insert_RESULT_SETS;
136 
137 --
138 -- ----------------------------------------------------------------------------
139 -- |--------------------------< Update_RESULT_SETS >--------------------------|
140 -- ----------------------------------------------------------------------------
141 
142 procedure Update_RESULT_SETS
143   (p_validate                      in  boolean  default false
144 ,p_effective_date               in     date
145   ,p_result_set_id                in     number
146   ,p_object_version_number        in out nocopy number
147   ,p_gradual_value_number_from    in     number    default hr_api.g_number
148   ,p_gradual_value_number_to      in     number    default hr_api.g_number
149   ,p_grade_id                     in     number    default hr_api.g_number
150   ) is
151 
152   l_proc  varchar2(72)      := g_package||'Update_RESULT_SETS';
153   l_object_Version_Number   PQH_DE_RESULT_SETS.OBJECT_VERSION_NUMBER%TYPE := P_Object_version_Number;
154   L_Effective_Date          Date;
155 
156 Begin
157   hr_utility.set_location('Entering:'|| l_proc, 10);
158   --
159   -- Issue a savepoint
160   --
161   savepoint Update_RESULT_SETS;
162   --
163   -- Truncate the time portion from all IN date parameters
164   --
165      l_effective_date := Trunc(p_effective_Date);
166   --
167   -- Call Before Process User Hook
168   --
169   begin
170 
171 PQH_DE_RESULT_SETS_BK2.Update_RESULT_SETS_b
172      (p_effective_date              => L_Effective_Date
173       ,p_gradual_value_number_from  => p_gradual_value_number_from
174       ,p_gradual_value_number_to    => p_gradual_value_number_to
175       ,P_grade_id                   => P_grade_id
176       ,P_RESULT_SET_ID              => p_RESULT_SET_ID
177       ,p_object_version_number      => p_object_version_number);
178 
179 
180  exception
181     when hr_api.cannot_find_prog_unit then
182       hr_api.cannot_find_prog_unit_error
183         (p_module_name => 'UPDATE_TATIGKEIT_DETAILS'
184         ,p_hook_type   => 'BP'
185         );
186   end;
187 
188    pqh_rss_upd.upd
189       (p_effective_date              => L_Effective_Date
190       ,p_gradual_value_number_from  => p_gradual_value_number_from
191       ,p_gradual_value_number_to    => p_gradual_value_number_to
192       ,P_grade_id                   => P_grade_id
193       ,P_RESULT_SET_ID              => p_RESULT_SET_ID
194       ,p_object_version_number      => l_object_version_number);
195 
196 --
197 --
198   -- Call After Process User Hook
199   --
200   begin
201 
202 
203  PQH_DE_RESULT_SETS_BK2.Update_RESULT_SETS_a
204      (p_effective_date              => L_Effective_Date
205       ,p_gradual_value_number_from  => p_gradual_value_number_from
206       ,p_gradual_value_number_to    => p_gradual_value_number_to
207       ,P_grade_id                   => P_grade_id
208       ,P_RESULT_SET_ID              => p_RESULT_SET_ID
209       ,p_object_version_number      => p_object_version_number);
210 
211   exception
212     when hr_api.cannot_find_prog_unit then
213       hr_api.cannot_find_prog_unit_error
214         (p_module_name => 'UPDATE_RESULT_SETS'
215         ,p_hook_type   => 'AP'
216         );
217   end;
218   --
219   -- When in validation only mode raise the Validate_Enabled exception
220   --
221   if p_validate then
222     raise hr_api.validate_enabled;
223   end if;
224   --
225   -- Set all output arguments
226   --
227 
228   p_object_version_number  := l_object_version_number;
229 
230   --
231   hr_utility.set_location(' Leaving:'||l_proc, 70);
232 exception
233   when hr_api.validate_enabled then
234     --
235     -- As the Validate_Enabled exception has been raised
236     -- we must rollback to the savepoint
237     --
238     rollback to Update_RESULT_SETS;
239     --
240     -- Only set output warning arguments
241     -- (Any key or derived arguments must be set to null
242     -- when validation only mode is being used.)
243     --
244     hr_utility.set_location(' Leaving:'||l_proc, 80);
245 
246   when others then
247     p_object_version_number  := l_object_version_number;
248     --
249     -- A validation or unexpected error has occured
250     --
251     rollback to Update_RESULT_SETS;
252     hr_utility.set_location(' Leaving:'||l_proc, 90);
253     raise;
254 end Update_RESULT_SETS;
255 
256 --
257 -- ----------------------------------------------------------------------------
258 -- |-------------------< delete_RESULT_SETS >------------------------------|
259 -- ----------------------------------------------------------------------------
260 procedure delete_RESULT_SETS
261   (p_validate                 in     boolean  default false
262    ,p_RESULT_SET_ID           In     Number
263   ,p_object_version_number    In     number) is
264 
265  --
266 
267   -- Declare cursors and local variables
268   --
269   l_proc           varchar2(72) := g_package||'delete_RESULT_SETS';
270   --
271 begin
272   hr_utility.set_location('Entering:'|| l_proc, 10);
273   --
274   -- Issue a savepoint
275   --
276   savepoint delete_RESULT_SETS;
277   --
278   -- Call Before Process User Hook
279   --
280   begin
281   PQH_DE_RESULT_SETS_BK3.Delete_RESULT_SETS_b
282   (p_RESULT_SET_Id                 =>   p_RESULT_SET_Id
283   ,p_object_version_number         =>   p_object_version_number);
284   exception
285     when hr_api.cannot_find_prog_unit then
286       hr_api.cannot_find_prog_unit_error
287         (p_module_name => 'delete_RESULT_SETS'
288         ,p_hook_type   => 'BP');
289   end;
290   --
291   -- Process Logic
292   --
293   pqh_rss_del.del
294   (p_RESULT_SET_id                          =>   p_RESULT_SET_Id
295   ,p_object_version_number                  =>   p_object_version_number
296   );
297   --
298   -- Call After Process User Hook
299   --
300   begin
301 
302   PQH_DE_RESULT_SETS_BK3.Delete_RESULT_SETS_a
303   (p_RESULT_SET_Id                 =>   p_RESULT_SET_Id
304   ,p_object_version_number         =>   p_object_version_number);
305 
306   exception
307     when hr_api.cannot_find_prog_unit then
308       hr_api.cannot_find_prog_unit_error
309         (p_module_name => 'DELETE_RESULT_SETS'
310         ,p_hook_type   => 'AP');
311   end;
312   --
313   -- When in validation only mode raise the Validate_Enabled exception
314   --
315   if p_validate then
316     raise hr_api.validate_enabled;
317   end if;
318   --
319   -- Set all output arguments
320   --
321   hr_utility.set_location(' Leaving:'||l_proc, 70);
322 exception
323   when hr_api.validate_enabled then
324     --
325     -- As the Validate_Enabled exception has been raised
326     -- we must rollback to the savepoint
327     --
328     rollback to delete_RESULT_SETS;
329     --
330     -- Only set output warning arguments
331     -- (Any key or derived arguments must be set to null
332     -- when validation only mode is being used.)
333     --
334     hr_utility.set_location(' Leaving:'||l_proc, 80);
335   when others then
336     --
337     -- A validation or unexpected error has occured
338     --
339     rollback to delete_RESULT_SETS;
340     hr_utility.set_location(' Leaving:'||l_proc, 90);
341     raise;
342 end delete_RESULT_SETS;
343 
344 end PQH_DE_RESULT_SETS_API;