DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_ZA_QUA_SHD

Source


1 Package Body per_za_qua_shd as
2 /* $Header: pezaqush.pkb 115.0 2001/02/04 22:35:21 pkm ship        $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  per_za_qua_shd.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------< return_api_dml_status >-------------------------|
12 -- ----------------------------------------------------------------------------
13 Function return_api_dml_status Return Boolean Is
14 --
15   l_proc 	varchar2(72) := g_package||'return_api_dml_status';
16 --
17 Begin
18   hr_utility.set_location('Entering:'||l_proc, 5);
19   --
20   Return (nvl(g_api_dml, false));
21   --
22   hr_utility.set_location(' Leaving:'||l_proc, 10);
23 End return_api_dml_status;
24 --
25 -- ----------------------------------------------------------------------------
26 -- |---------------------------< constraint_error >---------------------------|
27 -- ----------------------------------------------------------------------------
28 Procedure constraint_error
29             (p_constraint_name in all_constraints.constraint_name%TYPE) Is
30 --
31   l_proc 	varchar2(72) := g_package||'constraint_error';
32 --
33 Begin
34   hr_utility.set_location('Entering:'||l_proc, 5);
35   --
36   If (p_constraint_name = 'PER_QUALIFICATIONS_FK1') Then
37     hr_utility.set_message(801, 'HR_51850_QUA_ATT_ID_FK');
38     hr_utility.raise_error;
39   ElsIf (p_constraint_name = 'PER_QUALIFICATIONS_FK2') Then
40     hr_utility.set_message(801, 'HR_51851_QUA_QUAL_TYPE_ID_FK');
41     hr_utility.raise_error;
42   ElsIf (p_constraint_name = 'PER_QUALIFICATIONS_FK3') Then
43     hr_utility.set_message(801, 'HR_51852_QUA_BUS_GRP_ID_FK');
44     hr_utility.raise_error;
45   ElsIf (p_constraint_name = 'PER_QUALIFICATIONS_UK') Then
46     hr_utility.set_message(801,'HR_51847_QUA_REC_EXISTS');
47     hr_utility.raise_error;
48   ElsIf (p_constraint_name = 'PER_QUA_CHK_DATES') Then
49     hr_utility.set_message(801, 'HR_51853_QUA_DATE_INV');
50     hr_utility.raise_error;
51   ElsIf (p_constraint_name = 'PER_QUALIFICATIONS_PK') Then
52     hr_utility.set_message(801, 'HR_51854_QUA_QUAL_ID_PK');
53     hr_utility.raise_error;
54   Else
55     hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
56     hr_utility.set_message_token('PROCEDURE', l_proc);
57     hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
58     hr_utility.raise_error;
59   End If;
60   --
61   hr_utility.set_location(' Leaving:'||l_proc, 10);
62 End constraint_error;
63 --
64 -- ----------------------------------------------------------------------------
65 -- |---------------------------------< lck >----------------------------------|
66 -- ----------------------------------------------------------------------------
67 Procedure lck
68   (
69   p_qualification_id                   in per_subjects_taken.QUALIFICATION_ID%TYPE
70   ) is
71 --
72 -- Cursor selects the 'current' row from the HR Schema
73 --
74   Cursor C_Sel1 is
75     select
76 	    qualification_id,
77 		level_id,
78 		field_of_learning,
79 		sub_field,
80 		registration_date,
81 		registration_number
82     from
83 	    per_za_formal_qualifications
84     where
85 	    qualification_id = p_qualification_id
86     for	update nowait;
87 
88    l_proc	varchar2(72) := g_package||'lck';
89 --
90 Begin
91   hr_utility.set_location('Entering:'||l_proc, 5);
92 
93   Open  C_Sel1;
94   Fetch C_Sel1 Into g_old_rec;
95   If C_Sel1%notfound then
96     Close C_Sel1;
97     --
98     -- The primary key is invalid therefore we must error
99     --
100     hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
101     hr_utility.raise_error;
102   End If;
103   Close C_Sel1;
104 --
105   hr_utility.set_location(' Leaving:'||l_proc, 10);
106 --
107 -- We need to trap the ORA LOCK exception
108 --
109 Exception
110   When HR_Api.Object_Locked then
111     --
112     -- The object is locked therefore we need to supply a meaningful
113     -- error message.
114     --
115     hr_utility.set_message(801, 'HR_7165_OBJECT_LOCKED');
116     hr_utility.set_message_token('TABLE_NAME', 'per_qualifications');
117     hr_utility.raise_error;
118 End lck;
119 --
120 -- ----------------------------------------------------------------------------
121 -- |-----------------------------< convert_args >-----------------------------|
122 -- ----------------------------------------------------------------------------
123 Function convert_args
124 	(
125 	p_qualification_id              in number,
126 	p_level_id                      in number,
127 	p_field_of_learning             in varchar2,
128 	p_sub_field                     in varchar2,
129 	p_registration_date             in date,
130 	p_registration_number           in varchar2
131 	)
132 	Return g_za_rec_type is
133 --
134   l_rec	  g_za_rec_type;
135   l_proc  varchar2(72) := g_package||'convert_args';
136 --
137 Begin
138   --
139   hr_utility.set_location('Entering:'||l_proc, 5);
140   --
141   -- Convert arguments into local l_rec structure.
142   --
143   l_rec.qualification_id                 := p_qualification_id;
144   l_rec.level_id                         := p_level_id;
145   l_rec.field_of_learning                := p_field_of_learning;
146   l_rec.sub_field                        := p_sub_field;
147   l_rec.registration_date                := p_registration_date;
148   l_rec.registration_number              := p_registration_number;
149 
150   --
151   -- Return the plsql record structure.
152   --
153   hr_utility.set_location(' Leaving:'||l_proc, 10);
154   Return(l_rec);
155 --
156 End convert_args;
157 --
158 end per_za_qua_shd;