[Home] [Help]
PACKAGE BODY: APPS.PQH_CEA_SHD
Source
1 Package Body pqh_cea_shd as
2 /* $Header: pqcearhi.pkb 115.5 2003/09/28 21:33:49 scnair ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' pqh_cea_shd.'; -- Global package name
9 -- ----------------------------------------------------------------------------
10 -- |---------------------------< constraint_error >---------------------------|
11 -- ----------------------------------------------------------------------------
12 Procedure constraint_error
13 (p_constraint_name in all_constraints.constraint_name%TYPE) Is
14 --
15 l_proc varchar2(72) := g_package||'constraint_error';
16 --
17 Begin
18 hr_utility.set_location('Entering:'||l_proc, 5);
19 --
20 If (p_constraint_name = 'PQH_COPY_ENTITY_ATTRIBS_FK1') Then
21 hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
22 hr_utility.set_message_token('PROCEDURE', l_proc);
23 hr_utility.set_message_token('STEP','5');
24 hr_utility.raise_error;
25 ElsIf (p_constraint_name = 'PQH_COPY_ENTITY_ATTRIBS_PK') Then
26 hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
27 hr_utility.set_message_token('PROCEDURE', l_proc);
28 hr_utility.set_message_token('STEP','10');
29 hr_utility.raise_error;
30 Else
31 hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
32 hr_utility.set_message_token('PROCEDURE', l_proc);
33 hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
34 hr_utility.raise_error;
35 End If;
36 --
37 hr_utility.set_location(' Leaving:'||l_proc, 10);
38 End constraint_error;
39 --
40 -- ----------------------------------------------------------------------------
41 -- |-----------------------------< api_updating >-----------------------------|
42 -- ----------------------------------------------------------------------------
43 Function api_updating
44 (
45 p_copy_entity_attrib_id in number,
46 p_object_version_number in number
47 ) Return Boolean Is
48 --
49 --
50 -- Cursor selects the 'current' row from the HR Schema
51 --
52 Cursor C_Sel1 is
53 select
54 copy_entity_attrib_id,
55 copy_entity_txn_id,
56 row_type_cd,
57 information_category,
58 information1,
59 information2,
60 information3,
61 information4,
62 information5,
63 information6,
64 information7,
65 information8,
66 information9,
67 information10,
68 information11,
69 information12,
70 information13,
71 information14,
72 information15,
73 information16,
74 information17,
75 information18,
76 information19,
77 information20,
78 information21,
79 information22,
80 information23,
81 information24,
82 information25,
83 information26,
84 information27,
85 information28,
86 information29,
87 information30,
88 check_information1,
89 check_information2,
90 check_information3,
91 object_version_number
92 from pqh_copy_entity_attribs
93 where copy_entity_attrib_id = p_copy_entity_attrib_id;
94 --
95 l_proc varchar2(72) := g_package||'api_updating';
96 l_fct_ret boolean;
97 --
98 Begin
99 hr_utility.set_location('Entering:'||l_proc, 5);
100 --
101 If (
102 p_copy_entity_attrib_id is null and
103 p_object_version_number is null
104 ) Then
105 --
106 -- One of the primary key arguments is null therefore we must
107 -- set the returning function value to false
108 --
109 l_fct_ret := false;
110 Else
111 If (
112 p_copy_entity_attrib_id = g_old_rec.copy_entity_attrib_id and
113 p_object_version_number = g_old_rec.object_version_number
114 ) Then
115 hr_utility.set_location(l_proc, 10);
116 --
117 -- The g_old_rec is current therefore we must
118 -- set the returning function to true
119 --
120 l_fct_ret := true;
121 Else
122 --
123 -- Select the current row into g_old_rec
124 --
125 Open C_Sel1;
126 Fetch C_Sel1 Into g_old_rec;
127 If C_Sel1%notfound Then
128 Close C_Sel1;
129 --
130 -- The primary key is invalid therefore we must error
131 --
132 hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
133 hr_utility.raise_error;
134 End If;
135 Close C_Sel1;
136 If (p_object_version_number <> g_old_rec.object_version_number) Then
137 hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
138 hr_utility.raise_error;
139 End If;
140 hr_utility.set_location(l_proc, 15);
141 l_fct_ret := true;
142 End If;
143 End If;
144 hr_utility.set_location(' Leaving:'||l_proc, 20);
145 Return (l_fct_ret);
146 --
147 End api_updating;
148 --
149 -- ----------------------------------------------------------------------------
150 -- |---------------------------------< lck >----------------------------------|
151 -- ----------------------------------------------------------------------------
152 Procedure lck
153 (
154 p_copy_entity_attrib_id in number,
155 p_object_version_number in number
156 ) is
157 --
158 -- Cursor selects the 'current' row from the HR Schema
159 --
160 Cursor C_Sel1 is
161 select copy_entity_attrib_id,
162 copy_entity_txn_id,
163 row_type_cd,
164 information_category,
165 information1,
166 information2,
167 information3,
168 information4,
169 information5,
170 information6,
171 information7,
172 information8,
173 information9,
174 information10,
175 information11,
176 information12,
177 information13,
178 information14,
179 information15,
180 information16,
181 information17,
182 information18,
183 information19,
184 information20,
185 information21,
186 information22,
187 information23,
188 information24,
189 information25,
190 information26,
191 information27,
192 information28,
193 information29,
194 information30,
195 check_information1,
196 check_information2,
197 check_information3,
198 object_version_number
199 from pqh_copy_entity_attribs
200 where copy_entity_attrib_id = p_copy_entity_attrib_id
201 for update nowait;
202 --
203 l_proc varchar2(72) := g_package||'lck';
204 --
205 Begin
206 hr_utility.set_location('Entering:'||l_proc, 5);
207 --
208 -- Add any mandatory argument checking here:
209 -- Example:
210 -- hr_api.mandatory_arg_error
211 -- (p_api_name => l_proc,
212 -- p_argument => 'object_version_number',
213 -- p_argument_value => p_object_version_number);
214 --
215 Open C_Sel1;
216 Fetch C_Sel1 Into g_old_rec;
217 If C_Sel1%notfound then
218 Close C_Sel1;
219 --
220 -- The primary key is invalid therefore we must error
221 --
222 hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
223 hr_utility.raise_error;
224 End If;
225 Close C_Sel1;
226 If (p_object_version_number <> g_old_rec.object_version_number) Then
227 hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
228 hr_utility.raise_error;
229 End If;
230 --
231 hr_utility.set_location(' Leaving:'||l_proc, 10);
232 --
233 -- We need to trap the ORA LOCK exception
234 --
235 Exception
236 When HR_Api.Object_Locked then
237 --
238 -- The object is locked therefore we need to supply a meaningful
239 -- error message.
240 --
241 hr_utility.set_message(801, 'HR_7165_OBJECT_LOCKED');
242 hr_utility.set_message_token('TABLE_NAME', 'pqh_copy_entity_attribs');
243 hr_utility.raise_error;
244 End lck;
245 --
246 -- ----------------------------------------------------------------------------
247 -- |-----------------------------< convert_args >-----------------------------|
248 -- ----------------------------------------------------------------------------
249 Function convert_args
250 (
251 p_copy_entity_attrib_id in number,
252 p_copy_entity_txn_id in number,
253 p_row_type_cd in varchar2,
254 p_information_category in varchar2,
255 p_information1 in varchar2,
256 p_information2 in varchar2,
257 p_information3 in varchar2,
258 p_information4 in varchar2,
259 p_information5 in varchar2,
260 p_information6 in varchar2,
261 p_information7 in varchar2,
262 p_information8 in varchar2,
263 p_information9 in varchar2,
264 p_information10 in varchar2,
265 p_information11 in varchar2,
266 p_information12 in varchar2,
267 p_information13 in varchar2,
268 p_information14 in varchar2,
269 p_information15 in varchar2,
270 p_information16 in varchar2,
271 p_information17 in varchar2,
272 p_information18 in varchar2,
273 p_information19 in varchar2,
274 p_information20 in varchar2,
275 p_information21 in varchar2,
276 p_information22 in varchar2,
277 p_information23 in varchar2,
278 p_information24 in varchar2,
279 p_information25 in varchar2,
280 p_information26 in varchar2,
281 p_information27 in varchar2,
282 p_information28 in varchar2,
283 p_information29 in varchar2,
284 p_information30 in varchar2,
285 p_check_information1 in varchar2,
286 p_check_information2 in varchar2,
287 p_check_information3 in varchar2,
288 p_object_version_number in number
289 )
290 Return g_rec_type is
291 --
292 l_rec g_rec_type;
293 l_proc varchar2(72) := g_package||'convert_args';
294 --
295 Begin
296 --
297 hr_utility.set_location('Entering:'||l_proc, 5);
298 --
299 -- Convert arguments into local l_rec structure.
300 --
301 l_rec.copy_entity_attrib_id := p_copy_entity_attrib_id;
302 l_rec.copy_entity_txn_id := p_copy_entity_txn_id;
303 l_rec.row_type_cd := p_row_type_cd;
304 l_rec.information_category := p_information_category;
305 l_rec.information1 := p_information1;
306 l_rec.information2 := p_information2;
307 l_rec.information3 := p_information3;
308 l_rec.information4 := p_information4;
309 l_rec.information5 := p_information5;
310 l_rec.information6 := p_information6;
311 l_rec.information7 := p_information7;
312 l_rec.information8 := p_information8;
313 l_rec.information9 := p_information9;
314 l_rec.information10 := p_information10;
315 l_rec.information11 := p_information11;
316 l_rec.information12 := p_information12;
317 l_rec.information13 := p_information13;
318 l_rec.information14 := p_information14;
319 l_rec.information15 := p_information15;
320 l_rec.information16 := p_information16;
321 l_rec.information17 := p_information17;
322 l_rec.information18 := p_information18;
323 l_rec.information19 := p_information19;
324 l_rec.information20 := p_information20;
325 l_rec.information21 := p_information21;
326 l_rec.information22 := p_information22;
327 l_rec.information23 := p_information23;
328 l_rec.information24 := p_information24;
329 l_rec.information25 := p_information25;
330 l_rec.information26 := p_information26;
331 l_rec.information27 := p_information27;
332 l_rec.information28 := p_information28;
333 l_rec.information29 := p_information29;
334 l_rec.information30 := p_information30;
335 l_rec.check_information1 := p_check_information1;
336 l_rec.check_information2 := p_check_information2;
337 l_rec.check_information3 := p_check_information3;
338 l_rec.object_version_number := p_object_version_number;
339 --
340 -- Return the plsql record structure.
341 --
342 hr_utility.set_location(' Leaving:'||l_proc, 10);
343 Return(l_rec);
344 --
345 End convert_args;
346 --
347 end pqh_cea_shd;