[Home] [Help]
PACKAGE BODY: APPS.IRC_IAS_SHD
Source
1 Package Body irc_ias_shd as
2 /* $Header: iriasrhi.pkb 120.5 2011/02/16 12:43:23 vmummidi noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' irc_ias_shd.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------< return_api_dml_status >-------------------------|
12 -- ----------------------------------------------------------------------------
13 Function return_api_dml_status Return Boolean Is
14 --
15 Begin
16 --
17 Return (nvl(g_api_dml, false));
18 --
19 End return_api_dml_status;
20 --
21 -- ----------------------------------------------------------------------------
22 -- |---------------------------< constraint_error >---------------------------|
23 -- ----------------------------------------------------------------------------
24 Procedure constraint_error
25 (p_constraint_name in all_constraints.constraint_name%TYPE
26 ) Is
27 --
28 l_proc varchar2(72) := g_package||'constraint_error';
29 --
30 Begin
31 --
32 If (p_constraint_name = 'IRC_ASSIGNMENT_STATUSES_PK') Then
33 fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
34 fnd_message.set_token('PROCEDURE', l_proc);
35 fnd_message.set_token('STEP','5');
36 fnd_message.raise_error;
37 Else
38 fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
39 fnd_message.set_token('PROCEDURE', l_proc);
40 fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
41 fnd_message.raise_error;
42 End If;
43 --
44 End constraint_error;
45 --
46 -- ----------------------------------------------------------------------------
47 -- |-----------------------------< api_updating >-----------------------------|
48 -- ----------------------------------------------------------------------------
49 Function api_updating
50 (p_assignment_status_id in number
51 ,p_object_version_number in number
52 )
53 Return Boolean Is
54 --
55 --
56 -- Cursor selects the 'current' row from the HR Schema
57 --
58 Cursor C_Sel1 is
59 select
60 assignment_status_id
61 ,assignment_id
62 ,status_change_reason
63 ,object_version_number
64 ,assignment_status_type_id
65 ,status_change_date
66 ,status_change_comments
67 ,status_change_by
68 from irc_assignment_statuses
69 where assignment_status_id = p_assignment_status_id;
70 --
71 l_fct_ret boolean;
72 --
73 Begin
74 --
75 If (p_assignment_status_id is null and
76 p_object_version_number is null
77 ) Then
78 --
79 -- One of the primary key arguments is null therefore we must
80 -- set the returning function value to false
81 --
82 l_fct_ret := false;
83 Else
84 If (p_assignment_status_id
85 = irc_ias_shd.g_old_rec.assignment_status_id and
86 p_object_version_number
87 = irc_ias_shd.g_old_rec.object_version_number
88 ) Then
89 --
90 -- The g_old_rec is current therefore we must
91 -- set the returning function to true
92 --
93 l_fct_ret := true;
94 Else
95 --
96 -- Select the current row into g_old_rec
97 --
98 Open C_Sel1;
99 Fetch C_Sel1 Into irc_ias_shd.g_old_rec;
100 If C_Sel1%notfound Then
101 Close C_Sel1;
102 --
103 -- The primary key is invalid therefore we must error
104 --
105 fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
106 fnd_message.raise_error;
107 End If;
108 Close C_Sel1;
109 If (p_object_version_number
110 <> irc_ias_shd.g_old_rec.object_version_number) Then
111 fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
112 fnd_message.raise_error;
113 End If;
114 l_fct_ret := true;
115 End If;
116 End If;
117 Return (l_fct_ret);
118 --
119 End api_updating;
120 --
121 -- ----------------------------------------------------------------------------
122 -- |---------------------------------< lck >----------------------------------|
123 -- ----------------------------------------------------------------------------
124 Procedure lck
125 (p_assignment_status_id in number
126 ,p_object_version_number in number
127 ) is
128 --
129 -- Cursor selects the 'current' row from the HR Schema
130 --
131 Cursor C_Sel1 is
132 select
133 assignment_status_id
134 ,assignment_id
135 ,status_change_reason
136 ,object_version_number
137 ,assignment_status_type_id
138 ,status_change_date
139 ,status_change_comments
140 ,status_change_by
141 from irc_assignment_statuses
142 where assignment_status_id = p_assignment_status_id
143 for update nowait;
144 --
145 l_proc varchar2(72) := g_package||'lck';
146 --
147 Begin
148 hr_utility.set_location('Entering:'||l_proc, 5);
149 --
150 hr_api.mandatory_arg_error
151 (p_api_name => l_proc
152 ,p_argument => 'ASSIGNMENT_STATUS_ID'
153 ,p_argument_value => p_assignment_status_id
154 );
155 hr_utility.set_location(l_proc,6);
156 hr_api.mandatory_arg_error
157 (p_api_name => l_proc
158 ,p_argument => 'OBJECT_VERSION_NUMBER'
159 ,p_argument_value => p_object_version_number
160 );
161 --
162 Open C_Sel1;
163 Fetch C_Sel1 Into irc_ias_shd.g_old_rec;
164 If C_Sel1%notfound then
165 Close C_Sel1;
166 --
167 -- The primary key is invalid therefore we must error
168 --
169 fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
170 fnd_message.raise_error;
171 End If;
172 Close C_Sel1;
173 If (p_object_version_number
174 <> irc_ias_shd.g_old_rec.object_version_number) Then
175 fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
176 fnd_message.raise_error;
177 End If;
178 --
179 hr_utility.set_location(' Leaving:'||l_proc, 10);
180 --
181 -- We need to trap the ORA LOCK exception
182 --
183 Exception
184 When HR_Api.Object_Locked then
185 --
186 -- The object is locked therefore we need to supply a meaningful
187 -- error message.
188 --
189 fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
190 fnd_message.set_token('TABLE_NAME', 'irc_assignment_statuses');
191 fnd_message.raise_error;
192 End lck;
193 --
194 -- ----------------------------------------------------------------------------
195 -- |-----------------------------< convert_args >-----------------------------|
196 -- ----------------------------------------------------------------------------
197 Function convert_args
198 (p_assignment_status_id in number
199 ,p_assignment_id in number
200 ,p_status_change_reason in varchar2
201 ,p_object_version_number in number
202 ,p_assignment_status_type_id in number
203 ,p_status_change_date in date
204 ,p_status_change_comments in varchar2
205 ,p_status_change_by in varchar2
206 )
207 Return g_rec_type is
208 --
209 l_rec g_rec_type;
210 --
211 Begin
212 --
213 -- Convert arguments into local l_rec structure.
214 --
215 l_rec.assignment_status_id := p_assignment_status_id;
216 l_rec.assignment_id := p_assignment_id;
217 l_rec.status_change_reason := p_status_change_reason;
218 l_rec.object_version_number := p_object_version_number;
219 l_rec.assignment_status_type_id := p_assignment_status_type_id;
220 l_rec.status_change_date := p_status_change_date;
221 l_rec.status_change_comments := p_status_change_comments;
222 l_rec.status_change_by := p_status_change_by;
223 --
224 -- Return the plsql record structure.
225 --
226 Return(l_rec);
227 --
228 End convert_args;
229 --
230 end irc_ias_shd;