DBA Data[Home] [Help]

PACKAGE BODY: APPS.HXC_TAT_SHD

Source


1 package body hxc_tat_shd as
2 /* $Header: hxtatrhi.pkb 120.2 2005/09/23 07:03:57 rchennur noship $ */
3 -- --------------------------------------------------------------------------
4 -- |                     Private Global Definitions                         |
5 -- --------------------------------------------------------------------------
6 g_package  varchar2(33)	:= '  hxc_tat_shd.';  -- global package name
7 g_debug boolean := hr_utility.debug_enabled;
8 -- --------------------------------------------------------------------------
9 -- |---------------------------< constraint_error >-------------------------|
10 -- --------------------------------------------------------------------------
11 procedure constraint_error
12   (p_constraint_name in all_constraints.constraint_name%type
13   ) is
14 
15 l_proc 	varchar2(72) := g_package||'constraint_error';
16 
17 begin
18 
19   null;
20 
21 end constraint_error;
22 
23 -- --------------------------------------------------------------------------
24 -- |-----------------------------< api_updating >---------------------------|
25 -- --------------------------------------------------------------------------
26 function api_updating
27   (p_time_attribute_id     in number
28   ,p_object_version_number in number
29   ) return boolean is
30 
31 -- cursor selects the 'current' row from the hr schema
32 
33 cursor c_sel1 is
34   select
35      time_attribute_id
36     ,object_version_number
37     ,attribute_category
38     ,attribute1
39     ,attribute2
40     ,attribute3
41     ,attribute4
42     ,attribute5
43     ,attribute6
44     ,attribute7
45     ,attribute8
46     ,attribute9
47     ,attribute10
48     ,attribute11
49     ,attribute12
50     ,attribute13
51     ,attribute14
52     ,attribute15
53     ,attribute16
54     ,attribute17
55     ,attribute18
56     ,attribute19
57     ,attribute20
58     ,attribute21
59     ,attribute22
60     ,attribute23
61     ,attribute24
62     ,attribute25
63     ,attribute26
64     ,attribute27
65     ,attribute28
66     ,attribute29
67     ,attribute30
68     ,bld_blk_info_type_id
69     ,data_set_id
70   from  hxc_time_attributes
71   where time_attribute_id = p_time_attribute_id;
72 
73 l_fct_ret boolean;
74 
75 begin
76 
77   if (p_time_attribute_id is null and
78       p_object_version_number is null
79      ) then
80 
81     -- one of the primary key arguments is null therefore we must
82     -- set the returning function value to false
83 
84     l_fct_ret := false;
85 
86   else
87 
88     if (p_time_attribute_id
89         = hxc_tat_shd.g_old_rec.time_attribute_id and
90         p_object_version_number
91         = hxc_tat_shd.g_old_rec.object_version_number
92        ) then
93 
94       -- the g_old_rec is current therefore we must
95       -- set the returning function to true
96 
97       l_fct_ret := true;
98 
99     else
100 
101       -- select the current row into g_old_rec
102 
103       open c_sel1;
104       fetch c_sel1 into hxc_tat_shd.g_old_rec;
105 
106       if c_sel1%notfound then
107         close c_sel1;
108 
109         -- the primary key is invalid therefore we must error
110 
111         fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
112         fnd_message.raise_error;
113       end if;
114 
115       close c_sel1;
116 
117       if (p_object_version_number
118           <> hxc_tat_shd.g_old_rec.object_version_number) then
119         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
120         fnd_message.raise_error;
121       end if;
122 
123       l_fct_ret := true;
124 
125     end if;
126 
127   end if;
128 
129   return (l_fct_ret);
130 
131 end api_updating;
132 
133 -- --------------------------------------------------------------------------
134 -- |---------------------------------< lck >--------------------------------|
135 -- --------------------------------------------------------------------------
136 procedure lck
137   (p_time_attribute_id     in number
138   ,p_object_version_number in number
139   ) is
140 
141 -- cursor selects the 'current' row from the hr schema
142 
143 cursor c_sel1 is
144   select
145      time_attribute_id
146     ,object_version_number
147     ,attribute_category
148     ,attribute1
149     ,attribute2
150     ,attribute3
151     ,attribute4
152     ,attribute5
153     ,attribute6
154     ,attribute7
155     ,attribute8
156     ,attribute9
157     ,attribute10
158     ,attribute11
159     ,attribute12
160     ,attribute13
161     ,attribute14
162     ,attribute15
163     ,attribute16
164     ,attribute17
165     ,attribute18
166     ,attribute19
167     ,attribute20
168     ,attribute21
169     ,attribute22
170     ,attribute23
171     ,attribute24
172     ,attribute25
173     ,attribute26
174     ,attribute27
175     ,attribute28
176     ,attribute29
177     ,attribute30
178     ,bld_blk_info_type_id
179     ,data_set_id
180   from	hxc_time_attributes
181   where	time_attribute_id = p_time_attribute_id
182     for	update nowait;
183 
184 l_proc	varchar2(72) ;
185 
186 begin
187   g_debug :=hr_utility.debug_enabled;
188   if g_debug then
189   	l_proc := g_package||'lck';
190   	hr_utility.set_location('Entering:'||l_proc, 5);
191   end if;
192 
193   hr_api.mandatory_arg_error
194     (p_api_name           => l_proc
195     ,p_argument           => 'TIME_ATTRIBUTE_ID'
196     ,p_argument_value     => p_time_attribute_id
197     );
198 
199   open  c_sel1;
200   fetch c_sel1 into hxc_tat_shd.g_old_rec;
201 
202   if c_sel1%notfound then
203     close c_sel1;
204 
205     -- the primary key is invalid therefore we must error
206 
207     fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
208     fnd_message.raise_error;
209   end if;
210 
211   close c_sel1;
212 
213   if (p_object_version_number
214       <> hxc_tat_shd.g_old_rec.object_version_number) then
215         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
216         fnd_message.raise_error;
217   end if;
218 
219   if g_debug then
220   	hr_utility.set_location(' Leaving:'||l_proc, 10);
221   end if;
222 
223 exception
224   when hr_api.object_locked then
225     fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
226     fnd_message.set_token('TABLE_NAME', 'hxc_time_attributes');
227     fnd_message.raise_error;
228 end lck;
229 
230 -- --------------------------------------------------------------------------
231 -- |-----------------------------< convert_args >---------------------------|
232 -- --------------------------------------------------------------------------
233 function convert_args
234   (p_time_attribute_id              in number
235   ,p_object_version_number          in number
236   ,p_attribute_category             in varchar2
237   ,p_attribute1                     in varchar2
238   ,p_attribute2                     in varchar2
239   ,p_attribute3                     in varchar2
240   ,p_attribute4                     in varchar2
241   ,p_attribute5                     in varchar2
242   ,p_attribute6                     in varchar2
243   ,p_attribute7                     in varchar2
244   ,p_attribute8                     in varchar2
245   ,p_attribute9                     in varchar2
246   ,p_attribute10                    in varchar2
247   ,p_attribute11                    in varchar2
248   ,p_attribute12                    in varchar2
249   ,p_attribute13                    in varchar2
250   ,p_attribute14                    in varchar2
251   ,p_attribute15                    in varchar2
252   ,p_attribute16                    in varchar2
253   ,p_attribute17                    in varchar2
254   ,p_attribute18                    in varchar2
255   ,p_attribute19                    in varchar2
256   ,p_attribute20                    in varchar2
257   ,p_attribute21                    in varchar2
258   ,p_attribute22                    in varchar2
259   ,p_attribute23                    in varchar2
260   ,p_attribute24                    in varchar2
261   ,p_attribute25                    in varchar2
262   ,p_attribute26                    in varchar2
263   ,p_attribute27                    in varchar2
264   ,p_attribute28                    in varchar2
265   ,p_attribute29                    in varchar2
266   ,p_attribute30                    in varchar2
267   ,p_bld_blk_info_type_id           in number
268   ,p_data_set_id                    in number
269   ) return g_rec_type is
270 
271 l_rec g_rec_type;
272 
273 begin
274 
275   -- convert arguments into local l_rec structure.
276 
277   l_rec.time_attribute_id                := p_time_attribute_id;
278   l_rec.object_version_number            := p_object_version_number;
279   l_rec.attribute_category               := p_attribute_category;
280   l_rec.attribute1                       := p_attribute1;
281   l_rec.attribute2                       := p_attribute2;
282   l_rec.attribute3                       := p_attribute3;
283   l_rec.attribute4                       := p_attribute4;
284   l_rec.attribute5                       := p_attribute5;
285   l_rec.attribute6                       := p_attribute6;
286   l_rec.attribute7                       := p_attribute7;
287   l_rec.attribute8                       := p_attribute8;
288   l_rec.attribute9                       := p_attribute9;
289   l_rec.attribute10                      := p_attribute10;
290   l_rec.attribute11                      := p_attribute11;
291   l_rec.attribute12                      := p_attribute12;
292   l_rec.attribute13                      := p_attribute13;
293   l_rec.attribute14                      := p_attribute14;
294   l_rec.attribute15                      := p_attribute15;
295   l_rec.attribute16                      := p_attribute16;
296   l_rec.attribute17                      := p_attribute17;
297   l_rec.attribute18                      := p_attribute18;
298   l_rec.attribute19                      := p_attribute19;
299   l_rec.attribute20                      := p_attribute20;
300   l_rec.attribute21                      := p_attribute21;
301   l_rec.attribute22                      := p_attribute22;
302   l_rec.attribute23                      := p_attribute23;
303   l_rec.attribute24                      := p_attribute24;
304   l_rec.attribute25                      := p_attribute25;
305   l_rec.attribute26                      := p_attribute26;
306   l_rec.attribute27                      := p_attribute27;
307   l_rec.attribute28                      := p_attribute28;
308   l_rec.attribute29                      := p_attribute29;
309   l_rec.attribute30                      := p_attribute30;
310   l_rec.bld_blk_info_type_id             := p_bld_blk_info_type_id;
311   l_rec.data_set_id                      := p_data_set_id;
312 
313   -- return the plsql record structure.
314 
315   return(l_rec);
316 
317 end convert_args;
318 
319 end hxc_tat_shd;