[Home] [Help]
PACKAGE BODY: APPS.AME_CONFIG_VAR_SWI
Source
1 Package Body ame_config_var_swi As
2 /* $Header: amcfvswi.pkb 120.0 2005/09/02 03:55 mbocutt noship $ */
3 --
4 -- Package variables
5 --
6 g_package varchar2(33) := 'ame_config_var_swi.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |----------------------< update_ame_config_variable >----------------------|
10 -- ----------------------------------------------------------------------------
11 PROCEDURE update_ame_config_variable
12 (p_validate in number default hr_api.g_false_num
13 ,p_application_id in number
14 ,p_variable_name in varchar2
15 ,p_variable_value in varchar2 default hr_api.g_varchar2
16 ,p_object_version_number in out nocopy number
17 ,p_start_date out nocopy date
18 ,p_end_date out nocopy date
19 ,p_return_status out nocopy varchar2
20 ) is
21 --
22 -- Variables for API Boolean parameters
23 l_validate boolean;
24 --
25 -- Variables for IN/OUT parameters
26 l_object_version_number number;
27 --
28 -- Other variables
29 l_proc varchar2(72) := g_package ||'update_ame_config_variable';
30 Begin
31 hr_utility.set_location(' Entering:' || l_proc,10);
32 --
33 -- Issue a savepoint
34 --
35 savepoint update_ame_config_variable_swi;
36 --
37 -- Initialise Multiple Message Detection
38 --
39 hr_multi_message.enable_message_list;
40 --
41 -- Remember IN OUT parameter IN values
42 --
43 l_object_version_number := p_object_version_number;
44 --
45 -- Convert constant values to their corresponding boolean value
46 --
47 l_validate :=
48 hr_api.constant_to_boolean
49 (p_constant_value => p_validate);
50 --
51 -- Register Surrogate ID or user key values
52 --
53 --
54 -- Call API
55 --
56 ame_config_var_api.update_ame_config_variable
57 (p_validate => l_validate
58 ,p_application_id => p_application_id
59 ,p_variable_name => p_variable_name
60 ,p_variable_value => p_variable_value
61 ,p_object_version_number => p_object_version_number
62 ,p_start_date => p_start_date
63 ,p_end_date => p_end_date
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 update_ame_config_variable_swi;
88 --
89 -- Reset IN OUT parameters and set OUT parameters
90 --
91 p_object_version_number := l_object_version_number;
92 p_start_date := null;
93 p_end_date := null;
94 p_return_status := hr_multi_message.get_return_status_disable;
95 hr_utility.set_location(' Leaving:' || l_proc, 30);
96 when others then
97 --
98 -- When Multiple Message Detection is enabled catch
99 -- any Application specific or other unexpected
100 -- exceptions. Adding appropriate details to the
101 -- Multiple Message List. Otherwise re-raise the
102 -- error.
103 --
104 rollback to update_ame_config_variable_swi;
105 if hr_multi_message.unexpected_error_add(l_proc) then
106 hr_utility.set_location(' Leaving:' || l_proc,40);
107 raise;
108 end if;
109 --
110 -- Reset IN OUT and set OUT parameters
111 --
112 p_object_version_number := l_object_version_number;
113 p_start_date := null;
114 p_end_date := null;
115 p_return_status := hr_multi_message.get_return_status_disable;
116 hr_utility.set_location(' Leaving:' || l_proc,50);
117 end update_ame_config_variable;
118 -- ----------------------------------------------------------------------------
119 -- |----------------------< delete_ame_config_variable >----------------------|
120 -- ----------------------------------------------------------------------------
121 PROCEDURE delete_ame_config_variable
122 (p_validate in number default hr_api.g_false_num
123 ,p_application_id in number
124 ,p_variable_name in varchar2
125 ,p_object_version_number in out nocopy number
126 ,p_start_date out nocopy date
127 ,p_end_date out nocopy date
128 ,p_return_status out nocopy varchar2
129 ) is
130 --
131 -- Variables for API Boolean parameters
132 l_validate boolean;
133 --
134 -- Variables for IN/OUT parameters
135 l_object_version_number number;
136 --
137 -- Other variables
138 l_proc varchar2(72) := g_package ||'delete_ame_config_variable';
139 Begin
140 hr_utility.set_location(' Entering:' || l_proc,10);
141 --
142 -- Issue a savepoint
143 --
144 savepoint delete_ame_config_variable_swi;
145 --
146 -- Initialise Multiple Message Detection
147 --
148 hr_multi_message.enable_message_list;
149 --
150 -- Remember IN OUT parameter IN values
151 --
152 l_object_version_number := p_object_version_number;
153 --
154 -- Convert constant values to their corresponding boolean value
155 --
156 l_validate :=
157 hr_api.constant_to_boolean
158 (p_constant_value => p_validate);
159 --
160 -- Register Surrogate ID or user key values
161 --
162 --
163 -- Call API
164 --
165 ame_config_var_api.delete_ame_config_variable
166 (p_validate => l_validate
167 ,p_application_id => p_application_id
168 ,p_variable_name => p_variable_name
169 ,p_object_version_number => p_object_version_number
170 ,p_start_date => p_start_date
171 ,p_end_date => p_end_date
172 );
173 --
174 -- Convert API warning boolean parameter values to specific
175 -- messages and add them to Multiple Message List
176 --
177 --
178 -- Convert API non-warning boolean parameter values
179 --
180 --
181 -- Derive the API return status value based on whether
182 -- messages of any type exist in the Multiple Message List.
183 -- Also disable Multiple Message Detection.
184 --
185 p_return_status := hr_multi_message.get_return_status_disable;
186 hr_utility.set_location(' Leaving:' || l_proc,20);
187 --
188 exception
189 when hr_multi_message.error_message_exist then
190 --
191 -- Catch the Multiple Message List exception which
192 -- indicates API processing has been aborted because
193 -- at least one message exists in the list.
194 --
195 rollback to delete_ame_config_variable_swi;
196 --
197 -- Reset IN OUT parameters and set OUT parameters
198 --
199 p_object_version_number := l_object_version_number;
200 p_start_date := null;
201 p_end_date := null;
202 p_return_status := hr_multi_message.get_return_status_disable;
203 hr_utility.set_location(' Leaving:' || l_proc, 30);
204 when others then
205 --
206 -- When Multiple Message Detection is enabled catch
207 -- any Application specific or other unexpected
208 -- exceptions. Adding appropriate details to the
209 -- Multiple Message List. Otherwise re-raise the
210 -- error.
211 --
212 rollback to delete_ame_config_variable_swi;
213 if hr_multi_message.unexpected_error_add(l_proc) then
214 hr_utility.set_location(' Leaving:' || l_proc,40);
215 raise;
216 end if;
217 --
218 -- Reset IN OUT and set OUT parameters
219 --
220 p_object_version_number := l_object_version_number;
221 p_start_date := null;
222 p_end_date := null;
223 p_return_status := hr_multi_message.get_return_status_disable;
224 hr_utility.set_location(' Leaving:' || l_proc,50);
225 end delete_ame_config_variable;
226 end ame_config_var_swi;