1 Package Body irc_prof_area_criteria_val_swi As
2 /* $Header: irpcvswi.pkb 120.0 2005/10/03 14:59 rbanda noship $ */
3 --
4 -- Package variables
5 --
6 g_package varchar2(33) := 'irc_prof_area_criteria_val_swi.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |-----------------------< create_prof_area_criteria >----------------------|
10 -- ----------------------------------------------------------------------------
11 PROCEDURE create_prof_area_criteria
12 (p_validate in number default hr_api.g_false_num
13 ,p_effective_date in date
14 ,p_search_criteria_id in number
15 ,p_professional_area in varchar2
16 ,p_prof_area_criteria_value_id in number
17 ,p_object_version_number out nocopy number
18 ,p_return_status out nocopy varchar2
19 ) is
20 --
21 -- Variables for API Boolean parameters
22 l_validate boolean;
23 --
24 -- Variables for IN/OUT parameters
25 --
26 -- Other variables
27 l_prof_area_criteria_value_id number;
28 l_proc varchar2(72) := g_package ||'create_prof_area_criteria';
29 Begin
30 hr_utility.set_location(' Entering:' || l_proc,10);
31 --
32 -- Issue a savepoint
33 --
34 savepoint create_prof_area_criteria_swi;
35 --
36 -- Initialise Multiple Message Detection
37 --
38 hr_multi_message.enable_message_list;
39 --
40 -- Remember IN OUT parameter IN values
41 --
42 --
43 -- Convert constant values to their corresponding boolean value
44 --
45 l_validate :=
46 hr_api.constant_to_boolean
47 (p_constant_value => p_validate);
48 --
49 -- Register Surrogate ID or user key values
50 --
51 irc_pcv_ins.set_base_key_value
52 (p_prof_area_criteria_value_id => p_prof_area_criteria_value_id
53 );
54 --
55 -- Call API
56 --
57 irc_prof_area_criteria_val_api.create_prof_area_criteria
58 (p_validate => l_validate
59 ,p_effective_date => p_effective_date
60 ,p_search_criteria_id => p_search_criteria_id
61 ,p_professional_area => p_professional_area
62 ,p_prof_area_criteria_value_id => l_prof_area_criteria_value_id
63 ,p_object_version_number => p_object_version_number
64 );
65 --
66 -- Convert API warning boolean parameter values to specific
67 -- messages and add them to Multiple Message List
68 --
69 --
70 -- Convert API non-warning boolean parameter values
71 --
72 --
73 -- Derive the API return status value based on whether
74 -- messages of any type exist in the Multiple Message List.
75 -- Also disable Multiple Message Detection.
76 --
77 p_return_status := hr_multi_message.get_return_status_disable;
78 hr_utility.set_location(' Leaving:' || l_proc,20);
79 --
80 exception
81 when hr_multi_message.error_message_exist then
82 --
83 -- Catch the Multiple Message List exception which
84 -- indicates API processing has been aborted because
85 -- at least one message exists in the list.
86 --
87 rollback to create_prof_area_criteria_swi;
88 --
89 -- Reset IN OUT parameters and set OUT parameters
90 --
91 p_object_version_number := null;
92 p_return_status := hr_multi_message.get_return_status_disable;
93 hr_utility.set_location(' Leaving:' || l_proc, 30);
94 when others then
95 --
96 -- When Multiple Message Detection is enabled catch
97 -- any Application specific or other unexpected
98 -- exceptions. Adding appropriate details to the
99 -- Multiple Message List. Otherwise re-raise the
100 -- error.
101 --
102 rollback to create_prof_area_criteria_swi;
103 if hr_multi_message.unexpected_error_add(l_proc) then
104 hr_utility.set_location(' Leaving:' || l_proc,40);
105 raise;
106 end if;
107 --
108 -- Reset IN OUT and set OUT parameters
109 --
110 p_object_version_number := null;
111 p_return_status := hr_multi_message.get_return_status_disable;
112 hr_utility.set_location(' Leaving:' || l_proc,50);
113 end create_prof_area_criteria;
114 -- ----------------------------------------------------------------------------
115 -- |-----------------------< delete_prof_area_criteria >----------------------|
116 -- ----------------------------------------------------------------------------
117 PROCEDURE delete_prof_area_criteria
118 (p_validate in number default hr_api.g_false_num
119 ,p_prof_area_criteria_value_id in number
120 ,p_object_version_number in number
121 ,p_return_status out nocopy varchar2
122 ) is
123 --
124 -- Variables for API Boolean parameters
125 l_validate boolean;
126 --
127 -- Variables for IN/OUT parameters
128 --
129 -- Other variables
130 l_proc varchar2(72) := g_package ||'delete_prof_area_criteria';
131 Begin
132 hr_utility.set_location(' Entering:' || l_proc,10);
133 --
134 -- Issue a savepoint
135 --
136 savepoint delete_prof_area_criteria_swi;
137 --
138 -- Initialise Multiple Message Detection
139 --
140 hr_multi_message.enable_message_list;
141 --
142 -- Remember IN OUT parameter IN values
143 --
144 --
145 -- Convert constant values to their corresponding boolean value
146 --
147 l_validate :=
148 hr_api.constant_to_boolean
149 (p_constant_value => p_validate);
150 --
151 -- Register Surrogate ID or user key values
152 --
153 --
154 -- Call API
155 --
156 irc_prof_area_criteria_val_api.delete_prof_area_criteria
157 (p_validate => l_validate
158 ,p_prof_area_criteria_value_id => p_prof_area_criteria_value_id
159 ,p_object_version_number => p_object_version_number
160 );
161 --
162 -- Convert API warning boolean parameter values to specific
163 -- messages and add them to Multiple Message List
164 --
165 --
166 -- Convert API non-warning boolean parameter values
167 --
168 --
169 -- Derive the API return status value based on whether
170 -- messages of any type exist in the Multiple Message List.
171 -- Also disable Multiple Message Detection.
172 --
173 p_return_status := hr_multi_message.get_return_status_disable;
174 hr_utility.set_location(' Leaving:' || l_proc,20);
175 --
176 exception
177 when hr_multi_message.error_message_exist then
178 --
179 -- Catch the Multiple Message List exception which
180 -- indicates API processing has been aborted because
181 -- at least one message exists in the list.
182 --
183 rollback to delete_prof_area_criteria_swi;
184 --
185 -- Reset IN OUT parameters and set OUT parameters
186 --
187 p_return_status := hr_multi_message.get_return_status_disable;
188 hr_utility.set_location(' Leaving:' || l_proc, 30);
189 when others then
190 --
191 -- When Multiple Message Detection is enabled catch
192 -- any Application specific or other unexpected
193 -- exceptions. Adding appropriate details to the
194 -- Multiple Message List. Otherwise re-raise the
195 -- error.
196 --
197 rollback to delete_prof_area_criteria_swi;
198 if hr_multi_message.unexpected_error_add(l_proc) then
199 hr_utility.set_location(' Leaving:' || l_proc,40);
200 raise;
201 end if;
202 --
203 -- Reset IN OUT and set OUT parameters
204 --
205 p_return_status := hr_multi_message.get_return_status_disable;
206 hr_utility.set_location(' Leaving:' || l_proc,50);
207 end delete_prof_area_criteria;
208 end irc_prof_area_criteria_val_swi;