1: Package Body pqh_doc_ins as
2: /* $Header: pqdocrhi.pkb 120.2 2005/09/19 14:55:19 rthiagar noship $ */
3: --
4: -- ----------------------------------------------------------------------------
5: -- | Private Global Definitions |
4: -- ----------------------------------------------------------------------------
5: -- | Private Global Definitions |
6: -- ----------------------------------------------------------------------------
7: --
8: g_package varchar2(33) := ' pqh_doc_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: --
22: --
23: Begin
24: hr_utility.set_location('Entering:'||l_proc, 10);
25: --
26: pqh_doc_ins.g_document_id_i := p_document_id;
27: --
28: hr_utility.set_location(' Leaving:'||l_proc, 20);
29: End set_base_key_value;
30: --
230: --
231: Begin
232: hr_utility.set_location('Entering:'||l_proc, 5);
233: --
234: pqh_doc_ins.dt_insert_dml
235: (p_rec => p_rec
236: ,p_effective_date => p_effective_date
237: ,p_datetrack_mode => p_datetrack_mode
238: ,p_validation_start_date => p_validation_start_date
294: Cursor C_Sel2 is
295: Select null
296: from pqh_documents_f
297: where document_id =
298: pqh_doc_ins.g_document_id_i;
299: --
300: l_proc varchar2(72) := g_package||'pre_insert';
301: l_exists varchar2(1);
302: --
302: --
303: Begin
304: hr_utility.set_location('Entering:'||l_proc, 5);
305: --
306: If (pqh_doc_ins.g_document_id_i is not null) Then
307: --
308: -- Verify registered primary key values not already in use
309: --
310: Open C_Sel2;
322: --
323: -- Use registered key values and clear globals
324: --
325: p_rec.document_id :=
326: pqh_doc_ins.g_document_id_i;
327: pqh_doc_ins.g_document_id_i := null;
328: Else
329: --
330: -- No registerd key values, so select the next sequence number
323: -- Use registered key values and clear globals
324: --
325: p_rec.document_id :=
326: pqh_doc_ins.g_document_id_i;
327: pqh_doc_ins.g_document_id_i := null;
328: Else
329: --
330: -- No registerd key values, so select the next sequence number
331: --
529: hr_utility.set_location('Entering:'||l_proc, 5);
530: --
531: -- Call the lock operation
532: --
533: pqh_doc_ins.ins_lck
534: (p_effective_date => p_effective_date
535: ,p_datetrack_mode => l_datetrack_mode
536: ,p_rec => p_rec
537: ,p_validation_start_date => l_validation_start_date
552: hr_multi_message.end_validation_set;
553: --
554: -- Call the supporting pre-insert operation
555: --
556: pqh_doc_ins.pre_insert
557: (p_rec => p_rec
558: ,p_effective_date => p_effective_date
559: ,p_datetrack_mode => l_datetrack_mode
560: ,p_validation_start_date => l_validation_start_date
562: );
563: --
564: -- Insert the row
565: --
566: pqh_doc_ins.insert_dml
567: (p_rec => p_rec
568: ,p_effective_date => p_effective_date
569: ,p_datetrack_mode => l_datetrack_mode
570: ,p_validation_start_date => l_validation_start_date
572: );
573: --
574: -- Call the supporting post-insert operation
575: --
576: pqh_doc_ins.post_insert
577: (p_rec => p_rec
578: ,p_effective_date => p_effective_date
579: ,p_datetrack_mode => l_datetrack_mode
580: ,p_validation_start_date => l_validation_start_date
639: -- Having converted the arguments into the pqh_doc_rec
640: -- plsql record structure we call the corresponding record
641: -- business process.
642: --
643: pqh_doc_ins.ins
644: (p_effective_date
645: ,l_rec
646: );
647: --
655: --
656: hr_utility.set_location(' Leaving:'||l_proc, 10);
657: End ins;
658: --
659: end pqh_doc_ins;