DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_RLS_SHD

Source


1 Package Body pqh_rls_shd as
2 /* $Header: pqrlsrhi.pkb 120.0.12020000.2 2013/04/12 18:48:44 pathota ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  pqh_rls_shd.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |---------------------------< constraint_error >---------------------------|
12 -- ----------------------------------------------------------------------------
13 Procedure constraint_error
14   (p_constraint_name in all_constraints.constraint_name%TYPE
15   ) Is
16 --
17   l_proc 	varchar2(72) := g_package||'constraint_error';
18 --
19 Begin
20   --
21   If (p_constraint_name = 'PQH_ROLES_PK') Then
22     fnd_message.set_name('PAY','HR_6153_ALL_PROCEDURE_FAIL');
23     fnd_message.set_token('PROCEDURE',l_proc);
24     fnd_message.set_token('STEP','5');
25     fnd_message.raise_error;
26   ElsIf (p_constraint_name = 'PQH_ROLES_UK') Then
27     fnd_message.set_name('PAY','HR_6153_ALL_PROCEDURE_FAIL');
28     fnd_message.set_token('PROCEDURE',l_proc);
29     fnd_message.set_token('STEP','10');
30     fnd_message.raise_error;
31   Else
32     fnd_message.set_name('PAY','HR_7877_API_INVALID_CONSTRAINT');
33     fnd_message.set_token('PROCEDURE',l_proc);
34     fnd_message.set_token('CONSTRAINT_NAME',p_constraint_name);
35     fnd_message.raise_error;
36   End If;
37   --
38 End constraint_error;
39 --
40 -- ----------------------------------------------------------------------------
41 -- |-----------------------------< api_updating >-----------------------------|
42 -- ----------------------------------------------------------------------------
43 Function api_updating
44   (p_role_id                              in     number
45   ,p_object_version_number                in     number
46   )
47   Return Boolean Is
48 --
49   --
50   -- Cursor selects the 'current' row from the HR Schema
51   --
52   -- mvankada
53   -- Added Developer DF Columns to the cursor C_Sel1
54   Cursor C_Sel1 is
55     select
56        role_id
57       ,role_name
58       ,role_type_cd
59       ,enable_flag
60       ,object_version_number
61       ,business_group_id
62       ,information_category
63       ,information1
64       ,information2
65       ,information3
66       ,information4
67       ,information5
68       ,information6
69       ,information7
70       ,information8
71       ,information9
72       ,information10
73       ,information11
74       ,information12
75       ,information13
76       ,information14
77       ,information15
78       ,information16
79       ,information17
80       ,information18
81       ,information19
82       ,information20
83       ,information21
84       ,information22
85       ,information23
86       ,information24
87       ,information25
88       ,information26
89       ,information27
90       ,information28
91       ,information29
92       ,information30
93     from	pqh_roles
94     where
95        role_id = p_role_id;
96 --
97   l_fct_ret	boolean;
98 --
99 Begin
100   --
101   If (
102       p_role_id is null and p_object_version_number is null
103      ) Then
104     --
105     -- One of the primary key arguments is null therefore we must
106     -- set the returning function value to false
107     --
108     l_fct_ret := false;
109   Else
110     If (
111         p_role_id
112         = pqh_rls_shd.g_old_rec.role_id and p_object_version_number
113         = pqh_rls_shd.g_old_rec.object_version_number
114        ) Then
115       --
116       -- The g_old_rec is current therefore we must
117       -- set the returning function to true
118       --
119       l_fct_ret := true;
120     Else
121       --
122       -- Select the current row into g_old_rec
123       --
124       Open C_Sel1;
125       Fetch C_Sel1 Into pqh_rls_shd.g_old_rec;
126       If C_Sel1%notfound Then
127         Close C_Sel1;
128         --
129         -- The primary key is invalid therefore we must error
130         --
131         fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
132         fnd_message.raise_error;
133       End If;
134       Close C_Sel1;
135       If (p_object_version_number
136           <> pqh_rls_shd.g_old_rec.object_version_number) Then
137         fnd_message.set_name('PAY','HR_7155_OBJECT_INVALID');
138         fnd_message.raise_error;
139       End If;
140       l_fct_ret := true;
141     End If;
142   End If;
143   Return (l_fct_ret);
144 --
145 End api_updating;
146 --
147 -- ----------------------------------------------------------------------------
148 -- |---------------------------------< lck >----------------------------------|
149 -- ----------------------------------------------------------------------------
150 Procedure lck
151   (p_role_id                              in     number
152   ,p_object_version_number                in     number
153   ) is
154 --
155 -- Cursor selects the 'current' row from the HR Schema
156 --
157 -- mvanakda
158 -- Added Developer DF Columns to the Cursor C_Sel1
159   Cursor C_Sel1 is
160     select
161        role_id
162       ,role_name
163       ,role_type_cd
164       ,enable_flag
165       ,object_version_number
166       ,business_group_id
167       ,information_category
168       ,information1
169       ,information2
170       ,information3
171       ,information4
172       ,information5
173       ,information6
174       ,information7
175       ,information8
176       ,information9
177       ,information10
178       ,information11
179       ,information12
180       ,information13
181       ,information14
182       ,information15
183       ,information16
184       ,information17
185       ,information18
186       ,information19
187       ,information20
188       ,information21
189       ,information22
190       ,information23
191       ,information24
192       ,information25
193       ,information26
194       ,information27
195       ,information28
196       ,information29
197       ,information30
198     from	pqh_roles
199     where
200     role_id = p_role_id
201     for	update nowait;
202 --
203   l_proc	varchar2(72) := g_package||'lck';
204 --
205 Begin
206   hr_utility.set_location('Entering:'||l_proc,5);
207   --
208   hr_api.mandatory_arg_error
209     (p_api_name           => l_proc
210     ,p_argument           => 'ROLE_ID'
211     ,p_argument_value     => p_role_id
212     );
213   --
214   Open  C_Sel1;
215   Fetch C_Sel1 Into pqh_rls_shd.g_old_rec;
216   If C_Sel1%notfound then
217     Close C_Sel1;
218     --
219     -- The primary key is invalid therefore we must error
220     --
221     fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
222     fnd_message.raise_error;
223   End If;
224   Close C_Sel1;
225   If (p_object_version_number
226       <> pqh_rls_shd.g_old_rec.object_version_number) Then
227         fnd_message.set_name('PAY','HR_7155_OBJECT_INVALID');
228         fnd_message.raise_error;
229   End If;
230   --
231   hr_utility.set_location(' Leaving:'||l_proc,10);
232   --
233   -- We need to trap the ORA LOCK exception
234   --
235 Exception
236   When HR_Api.Object_Locked then
237     --
238     -- The object is locked therefore we need to supply a meaningful
239     -- error message.
240     --
241     fnd_message.set_name('PAY','HR_7165_OBJECT_LOCKED');
242     fnd_message.set_token('TABLE_NAME','pqh_roles');
243     fnd_message.raise_error;
244 End lck;
245 --
246 -- ----------------------------------------------------------------------------
247 -- |-----------------------------< convert_args >-----------------------------|
248 -- ----------------------------------------------------------------------------
249 
250 -- mvankada
251 -- Added Developer DF Columns to the function convert_args
252 
253 Function convert_args
254   (p_role_id                      in number
255   ,p_role_name                    in varchar2
256   ,p_role_type_cd                 in varchar2
257   ,p_enable_flag                  in varchar2
258   ,p_object_version_number        in number
259   ,p_business_group_id            in number
260   ,p_information_category         in varchar2
261   ,p_information1                 in varchar2
262   ,p_information2                 in varchar2
263   ,p_information3                 in varchar2
264   ,p_information4	          in varchar2
265   ,p_information5                 in varchar2
266   ,p_information6	          in varchar2
267   ,p_information7                 in varchar2
268   ,p_information8	          in varchar2
269   ,p_information9                 in varchar2
270   ,p_information10	          in varchar2
271   ,p_information11                in varchar2
272   ,p_information12	          in varchar2
273   ,p_information13	          in varchar2
274   ,p_information14                in varchar2
275   ,p_information15	          in varchar2
276   ,p_information16                in varchar2
277   ,p_information17	          in varchar2
278   ,p_information18                in varchar2
279   ,p_information19	          in varchar2
280   ,p_information20                in varchar2
281   ,p_information21                in varchar2
282   ,p_information22	          in varchar2
283   ,p_information23	          in varchar2
284   ,p_information24                in varchar2
285   ,p_information25	          in varchar2
286   ,p_information26                in varchar2
287   ,p_information27	          in varchar2
288   ,p_information28                in varchar2
289   ,p_information29	          in varchar2
290   ,p_information30                in varchar2
291   )
292   Return g_rec_type is
293 --
294   l_rec   g_rec_type;
295 --
296 Begin
297   --
298   -- Convert arguments into local l_rec structure.
299   --
300     l_rec.role_id                          := p_role_id;
301     l_rec.role_name                        := p_role_name;
302     l_rec.role_type_cd                     := p_role_type_cd;
303     l_rec.enable_flag                      := p_enable_flag;
304     l_rec.object_version_number            := p_object_version_number;
305     l_rec.business_group_id                := p_business_group_id;
306 
307     -- mvankada
308     -- For DDF columns
309 
310     l_rec.information_category     := p_information_category;
311     l_rec.information1	    	   := p_information1;
312     l_rec.information2	  	   := p_information2;
313     l_rec.information3	 	   := p_information3;
314     l_rec.information4	 	   := p_information4;
315     l_rec.information5	  	   := p_information5;
316     l_rec.information6	  	   := p_information6;
317     l_rec.information7	  	   := p_information7;
318     l_rec.information8	  	   := p_information8;
319     l_rec.information9	  	   := p_information9;
320     l_rec.information10	  	   := p_information10;
321     l_rec.information11	  	   := p_information11;
322     l_rec.information12	  	   := p_information12;
323     l_rec.information13	 	   := p_information13;
324     l_rec.information14	  	   := p_information14;
325     l_rec.information15	 	   := p_information15;
326     l_rec.information16	  	   := p_information16;
327     l_rec.information17	  	   := p_information17;
328     l_rec.information18	 	   := p_information18;
329     l_rec.information19	 	   := p_information19;
330     l_rec.information20	   	   := p_information20;
331     l_rec.information21	 	   := p_information21;
332     l_rec.information22	   	   := p_information22;
333     l_rec.information23	   	   := p_information23;
334     l_rec.information24	  	   := p_information24;
335     l_rec.information25	  	   := p_information25;
336     l_rec.information26	  	   := p_information26;
337     l_rec.information27		   := p_information27;
338     l_rec.information28	  	   := p_information28;
339     l_rec.information29	  	   := p_information29;
340     l_rec.information30	  	   := p_information30;
341   --
342   -- Return the plsql record structure.
343   --
344   Return(l_rec);
345 --
346 End convert_args;
347 --
348 end pqh_rls_shd;