1: Package Body hxc_hsd_ins as
2: /* $Header: hxchsdrhi.pkb 120.3 2005/09/23 10:44:51 sechandr noship $ */
3: --
4: -- ----------------------------------------------------------------------------
5: -- | Private Global Definitions |
4: -- ----------------------------------------------------------------------------
5: -- | Private Global Definitions |
6: -- ----------------------------------------------------------------------------
7: --
8: g_package varchar2(33) := ' hxc_hsd_ins.'; -- Global package name
9: g_debug boolean := hr_utility.debug_enabled;
10: --
11: -- The following global variables are only to be used by
12: -- the set_base_key_value and pre_insert procedures.
29: l_proc := g_package||'set_base_key_value';
30: hr_utility.set_location('Entering:'||l_proc, 10);
31: end if;
32: --
33: hxc_hsd_ins.g_object_id_i := p_object_id;
34: hxc_hsd_ins.g_object_type_i := p_object_type;
35: --
36: if g_debug then
37: hr_utility.set_location(' Leaving:'||l_proc, 20);
30: hr_utility.set_location('Entering:'||l_proc, 10);
31: end if;
32: --
33: hxc_hsd_ins.g_object_id_i := p_object_id;
34: hxc_hsd_ins.g_object_type_i := p_object_type;
35: --
36: if g_debug then
37: hr_utility.set_location(' Leaving:'||l_proc, 20);
38: end if;
183: Cursor C_Sel2 is
184: Select null
185: from hxc_seeddata_by_level
186: where object_id =
187: hxc_hsd_ins.g_object_id_i
188: or object_type =
189: hxc_hsd_ins.g_object_type_i;
190: --
191: l_proc varchar2(72);
185: from hxc_seeddata_by_level
186: where object_id =
187: hxc_hsd_ins.g_object_id_i
188: or object_type =
189: hxc_hsd_ins.g_object_type_i;
190: --
191: l_proc varchar2(72);
192: l_exists varchar2(1);
193: --
196: l_proc := g_package||'pre_insert';
197: hr_utility.set_location('Entering:'||l_proc, 5);
198: end if;
199: --
200: If (hxc_hsd_ins.g_object_id_i is not null or
201: hxc_hsd_ins.g_object_type_i is not null) Then
202: --
203: -- Verify registered primary key values not already in use
204: --
197: hr_utility.set_location('Entering:'||l_proc, 5);
198: end if;
199: --
200: If (hxc_hsd_ins.g_object_id_i is not null or
201: hxc_hsd_ins.g_object_type_i is not null) Then
202: --
203: -- Verify registered primary key values not already in use
204: --
205: Open C_Sel2;
217: --
218: -- Use registered key values and clear globals
219: --
220: p_rec.object_id :=
221: hxc_hsd_ins.g_object_id_i;
222: hxc_hsd_ins.g_object_id_i := null;
223: p_rec.object_type :=
224: hxc_hsd_ins.g_object_type_i;
225: hxc_hsd_ins.g_object_type_i := null;
218: -- Use registered key values and clear globals
219: --
220: p_rec.object_id :=
221: hxc_hsd_ins.g_object_id_i;
222: hxc_hsd_ins.g_object_id_i := null;
223: p_rec.object_type :=
224: hxc_hsd_ins.g_object_type_i;
225: hxc_hsd_ins.g_object_type_i := null;
226: Else
220: p_rec.object_id :=
221: hxc_hsd_ins.g_object_id_i;
222: hxc_hsd_ins.g_object_id_i := null;
223: p_rec.object_type :=
224: hxc_hsd_ins.g_object_type_i;
225: hxc_hsd_ins.g_object_type_i := null;
226: Else
227: --
228: -- No registerd key values, so select the next sequence number
221: hxc_hsd_ins.g_object_id_i;
222: hxc_hsd_ins.g_object_id_i := null;
223: p_rec.object_type :=
224: hxc_hsd_ins.g_object_type_i;
225: hxc_hsd_ins.g_object_type_i := null;
226: Else
227: --
228: -- No registerd key values, so select the next sequence number
229: --
338: hr_multi_message.end_validation_set;
339: --
340: -- Call the supporting pre-insert operation
341: --
342: hxc_hsd_ins.pre_insert(p_rec);
343: --
344: -- Insert the row
345: --
346: hxc_hsd_ins.insert_dml(p_rec);
342: hxc_hsd_ins.pre_insert(p_rec);
343: --
344: -- Insert the row
345: --
346: hxc_hsd_ins.insert_dml(p_rec);
347: --
348: -- Call the supporting post-insert operation
349: --
350: hxc_hsd_ins.post_insert
346: hxc_hsd_ins.insert_dml(p_rec);
347: --
348: -- Call the supporting post-insert operation
349: --
350: hxc_hsd_ins.post_insert
351: (p_rec
352: );
353: --
354: -- Call to raise any errors on multi-message list
392: --
393: -- Having converted the arguments into the hxc_hsd_rec
394: -- plsql record structure we call the corresponding record business process.
395: --
396: hxc_hsd_ins.ins
397: (l_rec
398: );
399: --
400: --
402: hr_utility.set_location(' Leaving:'||l_proc, 10);
403: end if;
404: End ins;
405: --
406: end hxc_hsd_ins;