[Home] [Help]
PACKAGE BODY: APPS.PER_ZA_AO_ASS_SHD
Source
1 Package Body per_za_ao_ass_shd as
2 /* $Header: pezaaash.pkb 115.2 2002/12/10 09:54:49 nsugavan noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' per_za_ao_ass_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_ass_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_ass_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_ass_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_ass_REC_EXISTS');
47 hr_utility.raise_error;
48 ElsIf (p_constraint_name = 'PER_ass_CHK_DATES') Then
49 hr_utility.set_message(801, 'HR_51853_ass_DATE_INV');
50 hr_utility.raise_error;
51 ElsIf (p_constraint_name = 'PER_QUALIFICATIONS_PK') Then
52 hr_utility.set_message(801, 'HR_51854_ass_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_area_of_assessment_id in number
70 ) is
71 --
72 -- Cursor selects the 'current' row from the HR Schema
73 --
74 Cursor C_Sel1 is
75 select
76 area_of_assessment_id,
77 assessment_id,
78 area_of_assessment,
79 assessment_result,
80 assessment_criteria
81 from
82 per_za_areas_of_assessment
83 where
84 area_of_assessment_id = p_area_of_assessment_id
85 for update nowait;
86
87 l_proc varchar2(72) := g_package||'lck';
88 --
89 Begin
90 hr_utility.set_location('Entering:'||l_proc, 5);
91 --
92 -- Add any mandatory argument checking here:
93 -- Example:
94 -- hr_api.mandatory_arg_error
95 -- (p_api_name => l_proc,
96 -- p_argument => 'object_version_number',
97 -- p_argument_value => p_object_version_number);
98 --
99 hr_api.mandatory_arg_error
100 (p_api_name => l_proc,
101 p_argument => 'area_of_assessment_id',
102 p_argument_value => p_area_of_assessment_id);
103 Open C_Sel1;
104 Fetch C_Sel1 Into g_old_rec;
105 If C_Sel1%notfound then
106 Close C_Sel1;
107 --
108 -- The primary key is invalid therefore we must error
109 --
110 hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
111 hr_utility.raise_error;
112 End If;
113 Close C_Sel1;
114 --
115 hr_utility.set_location(' Leaving:'||l_proc, 10);
116 --
117 -- We need to trap the ORA LOCK exception
118 --
119 Exception
120 When HR_Api.Object_Locked then
121 --
122 -- The object is locked therefore we need to supply a meaningful
123 -- error message.
124 --
125 hr_utility.set_message(801, 'HR_7165_OBJECT_LOCKED');
126 hr_utility.set_message_token('TABLE_NAME', 'per_za_ao_assessments');
127 hr_utility.raise_error;
128 End lck;
129 --
130 -- ----------------------------------------------------------------------------
131 -- |-----------------------------< convert_args >-----------------------------|
132 -- ----------------------------------------------------------------------------
133 Function convert_args(
134 p_area_of_assessment_id in number,
135 p_assessment_id in number,
136 p_area_of_assessment in varchar2,
137 p_assessment_result in varchar2,
138 p_assessment_criteria in varchar2
139 )
140 Return g_za_rec_type is
141 --
142 l_rec g_za_rec_type;
143 l_proc varchar2(72) := g_package||'convert_args';
144 --
145 Begin
146 --
147 hr_utility.set_location('Entering:'||l_proc, 5);
148 --
149 -- Convert arguments into local l_rec structure.
150 --
151 l_rec.area_of_assessment_id := p_area_of_assessment_id;
152 l_rec.assessment_id := p_assessment_id;
153 l_rec.area_of_assessment := p_area_of_assessment;
154 l_rec.assessment_result := p_assessment_result;
155 l_rec.assessment_criteria := p_assessment_criteria;
156
157 --
158 -- Return the plsql record structure.
159 --
160 hr_utility.set_location(' Leaving:'||l_proc, 10);
161 Return(l_rec);
162 --
163 End convert_args;
164 --
165 procedure get_new_id(p_area_of_assessment_id out nocopy number) IS
166 begin
167 select
168 PER_ZA_AREAS_OF_ASSESSMENT_S.nextval
169 into
170 p_area_of_assessment_id
171 from
172 dual;
173 --
174 exception
175 when others then
176 p_area_of_assessment_id := null;
177 --
178 end get_new_id;
179
180 end per_za_ao_ass_shd;