1: Package Body ota_fns_ins as
2: /* $Header: otfnsrhi.pkb 120.1 2005/07/18 05:29 aabalakr noship $ */
3: --
4: -- ----------------------------------------------------------------------------
5: -- | Private Global Definitions |
4: -- ----------------------------------------------------------------------------
5: -- | Private Global Definitions |
6: -- ----------------------------------------------------------------------------
7: --
8: g_package varchar2(33) := ' ota_fns_ins.'; -- Global package name
9: --
10: -- The following global variables are only to be used by
11: -- the set_base_key_value and pre_insert procedures.
12: --
26: --
27: Begin
28: hr_utility.set_location('Entering:'||l_proc, 10);
29: --
30: ota_fns_ins.g_forum_id_i := p_forum_id;
31: ota_fns_ins.g_person_id_i := p_person_id;
32: ota_fns_ins.g_contact_id_i := p_contact_id;
33: --
34: hr_utility.set_location(' Leaving:'||l_proc, 20);
27: Begin
28: hr_utility.set_location('Entering:'||l_proc, 10);
29: --
30: ota_fns_ins.g_forum_id_i := p_forum_id;
31: ota_fns_ins.g_person_id_i := p_person_id;
32: ota_fns_ins.g_contact_id_i := p_contact_id;
33: --
34: hr_utility.set_location(' Leaving:'||l_proc, 20);
35: End set_base_key_value;
28: hr_utility.set_location('Entering:'||l_proc, 10);
29: --
30: ota_fns_ins.g_forum_id_i := p_forum_id;
31: ota_fns_ins.g_person_id_i := p_person_id;
32: ota_fns_ins.g_contact_id_i := p_contact_id;
33: --
34: hr_utility.set_location(' Leaving:'||l_proc, 20);
35: End set_base_key_value;
36: --
177: Cursor C_Sel2 is
178: Select null
179: from ota_frm_notif_subscribers
180: where forum_id =
181: ota_fns_ins.g_forum_id_i
182: or person_id =
183: ota_fns_ins.g_person_id_i
184: or contact_id =
185: ota_fns_ins.g_contact_id_i;
179: from ota_frm_notif_subscribers
180: where forum_id =
181: ota_fns_ins.g_forum_id_i
182: or person_id =
183: ota_fns_ins.g_person_id_i
184: or contact_id =
185: ota_fns_ins.g_contact_id_i;
186: */
187: --
181: ota_fns_ins.g_forum_id_i
182: or person_id =
183: ota_fns_ins.g_person_id_i
184: or contact_id =
185: ota_fns_ins.g_contact_id_i;
186: */
187: --
188: l_proc varchar2(72) := g_package||'pre_insert';
189: l_exists varchar2(1);
191: Begin
192: hr_utility.set_location('Entering:'||l_proc, 5);
193: --
194: /*
195: If (ota_fns_ins.g_forum_id_i is not null or
196: ota_fns_ins.g_person_id_i is not null or
197: ota_fns_ins.g_contact_id_i is not null) Then
198: --
199: -- Verify registered primary key values not already in use
192: hr_utility.set_location('Entering:'||l_proc, 5);
193: --
194: /*
195: If (ota_fns_ins.g_forum_id_i is not null or
196: ota_fns_ins.g_person_id_i is not null or
197: ota_fns_ins.g_contact_id_i is not null) Then
198: --
199: -- Verify registered primary key values not already in use
200: --
193: --
194: /*
195: If (ota_fns_ins.g_forum_id_i is not null or
196: ota_fns_ins.g_person_id_i is not null or
197: ota_fns_ins.g_contact_id_i is not null) Then
198: --
199: -- Verify registered primary key values not already in use
200: --
201: Open C_Sel2;
213: --
214: -- Use registered key values and clear globals
215: --
216: p_rec.forum_id :=
217: ota_fns_ins.g_forum_id_i;
218: ota_fns_ins.g_forum_id_i := null;
219: p_rec.person_id :=
220: ota_fns_ins.g_person_id_i;
221: ota_fns_ins.g_person_id_i := null;
214: -- Use registered key values and clear globals
215: --
216: p_rec.forum_id :=
217: ota_fns_ins.g_forum_id_i;
218: ota_fns_ins.g_forum_id_i := null;
219: p_rec.person_id :=
220: ota_fns_ins.g_person_id_i;
221: ota_fns_ins.g_person_id_i := null;
222: p_rec.contact_id :=
216: p_rec.forum_id :=
217: ota_fns_ins.g_forum_id_i;
218: ota_fns_ins.g_forum_id_i := null;
219: p_rec.person_id :=
220: ota_fns_ins.g_person_id_i;
221: ota_fns_ins.g_person_id_i := null;
222: p_rec.contact_id :=
223: ota_fns_ins.g_contact_id_i;
224: ota_fns_ins.g_contact_id_i := null;
217: ota_fns_ins.g_forum_id_i;
218: ota_fns_ins.g_forum_id_i := null;
219: p_rec.person_id :=
220: ota_fns_ins.g_person_id_i;
221: ota_fns_ins.g_person_id_i := null;
222: p_rec.contact_id :=
223: ota_fns_ins.g_contact_id_i;
224: ota_fns_ins.g_contact_id_i := null;
225: Else
219: p_rec.person_id :=
220: ota_fns_ins.g_person_id_i;
221: ota_fns_ins.g_person_id_i := null;
222: p_rec.contact_id :=
223: ota_fns_ins.g_contact_id_i;
224: ota_fns_ins.g_contact_id_i := null;
225: Else
226: --
227: -- No registerd key values, so select the next sequence number
220: ota_fns_ins.g_person_id_i;
221: ota_fns_ins.g_person_id_i := null;
222: p_rec.contact_id :=
223: ota_fns_ins.g_contact_id_i;
224: ota_fns_ins.g_contact_id_i := null;
225: Else
226: --
227: -- No registerd key values, so select the next sequence number
228: --
332: /*p_rec.forum_id := null;
333: p_rec.person_id := null;
334: p_rec.contact_id := null;*/
335:
336: ota_fns_ins.set_base_key_value( p_forum_id => l_forum_id
337: ,p_person_id => l_person_id
338: ,p_contact_id => l_contact_id
339: );
340:
352: hr_multi_message.end_validation_set;
353: --
354: -- Call the supporting pre-insert operation
355: --
356: ota_fns_ins.pre_insert(p_rec);
357: --
358: -- Insert the row
359: --
360: ota_fns_ins.insert_dml(p_rec);
356: ota_fns_ins.pre_insert(p_rec);
357: --
358: -- Insert the row
359: --
360: ota_fns_ins.insert_dml(p_rec);
361: --
362: -- Call the supporting post-insert operation
363: --
364: ota_fns_ins.post_insert
360: ota_fns_ins.insert_dml(p_rec);
361: --
362: -- Call the supporting post-insert operation
363: --
364: ota_fns_ins.post_insert
365: (p_effective_date
366: ,p_rec
367: );
368: --
410: --
411: -- Having converted the arguments into the ota_fns_rec
412: -- plsql record structure we call the corresponding record business process.
413: --
414: ota_fns_ins.ins
415: (p_effective_date
416: ,l_rec
417: );
418: --
426: --
427: hr_utility.set_location(' Leaving:'||l_proc, 10);
428: End ins;
429: --
430: end ota_fns_ins;