DBA Data[Home] [Help]

PACKAGE: APPS.BEN_ERC_SHD

Source


1 Package ben_erc_shd as
2 /* $Header: beercrhi.pkh 120.0 2005/05/28 02:50:55 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                    Global Record Type Specification                      |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9   (
10   enrt_rt_ctfn_id                number(15),
11   enrt_ctfn_typ_cd                  varchar2(30),
12   rqd_flag                          varchar2(30),
13   enrt_rt_id            number(15),
14   business_group_id                 number(15),
15   erc_attribute_category            varchar2(30),
16   erc_attribute1                    varchar2(150),
17   erc_attribute2                    varchar2(150),
18   erc_attribute3                    varchar2(150),
19   erc_attribute4                    varchar2(150),
20   erc_attribute5                    varchar2(150),
21   erc_attribute6                    varchar2(150),
22   erc_attribute7                    varchar2(150),
23   erc_attribute8                    varchar2(150),
24   erc_attribute9                    varchar2(150),
25   erc_attribute10                   varchar2(150),
26   erc_attribute11                   varchar2(150),
27   erc_attribute12                   varchar2(150),
28   erc_attribute13                   varchar2(150),
29   erc_attribute14                   varchar2(150),
30   erc_attribute15                   varchar2(150),
31   erc_attribute16                   varchar2(150),
32   erc_attribute17                   varchar2(150),
33   erc_attribute18                   varchar2(150),
34   erc_attribute19                   varchar2(150),
35   erc_attribute20                   varchar2(150),
36   erc_attribute21                   varchar2(150),
37   erc_attribute22                   varchar2(150),
38   erc_attribute23                   varchar2(150),
39   erc_attribute24                   varchar2(150),
40   erc_attribute25                   varchar2(150),
41   erc_attribute26                   varchar2(150),
42   erc_attribute27                   varchar2(150),
43   erc_attribute28                   varchar2(150),
44   erc_attribute29                   varchar2(150),
45   erc_attribute30                   varchar2(150),
46   request_id                        number(15),
47   program_application_id            number(15),
48   program_id                        number(15),
49   program_update_date               date,
50   object_version_number             number(9)
51   );
52 --
53 -- ----------------------------------------------------------------------------
54 -- |           Global Definitions - Internal Development Use Only             |
55 -- ----------------------------------------------------------------------------
56 --
57 g_old_rec  g_rec_type;                            -- Global record definition
58 g_api_dml  boolean;                               -- Global api dml status
59 --
60 -- ----------------------------------------------------------------------------
61 -- |------------------------< return_api_dml_status >-------------------------|
62 -- ----------------------------------------------------------------------------
63 -- {Start Of Comments}
64 --
65 -- Description:
66 --   This function will return the current g_api_dml private global
67 --   boolean status.
68 --   The g_api_dml status determines if at the time of the function
69 --   being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
70 --   is being issued from within an api.
71 --   If the status is TRUE then a dml statement is being issued from
72 --   within this entity api.
73 --   This function is primarily to support database triggers which
74 --   need to maintain the object_version_number for non-supported
75 --   dml statements (i.e. dml statement issued outside of the api layer).
76 --
77 -- Prerequisites:
78 --   None.
79 --
80 -- In Parameters:
81 --   None.
82 --
83 -- Post Success:
84 --   Processing continues.
85 --   If the function returns a TRUE value then, dml is being executed from
86 --   within this api.
87 --
88 -- Post Failure:
89 --   None.
90 --
91 -- Access Status:
92 --   Internal Row Handler Use Only.
93 --
94 -- {End Of Comments}
95 -- ----------------------------------------------------------------------------
96 Function return_api_dml_status Return Boolean;
97 --
98 -- ----------------------------------------------------------------------------
99 -- |---------------------------< constraint_error >---------------------------|
100 -- ----------------------------------------------------------------------------
101 -- {Start Of Comments}
102 --
103 -- Description:
104 --   This procedure is called when a constraint has been violated (i.e.
105 --   The exception hr_api.check_integrity_violated,
106 --   hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
107 --   hr_api.unique_integrity_violated has been raised).
108 --   The exceptions can only be raised as follows:
109 --   1) A check constraint can only be violated during an INSERT or UPDATE
110 --      dml operation.
111 --   2) A parent integrity constraint can only be violated during an
112 --      INSERT or UPDATE dml operation.
113 --   3) A child integrity constraint can only be violated during an
114 --      DELETE dml operation.
115 --   4) A unique integrity constraint can only be violated during INSERT or
116 --      UPDATE dml operation.
117 --
118 -- Prerequisites:
119 --   1) Either hr_api.check_integrity_violated,
120 --      hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
121 --      hr_api.unique_integrity_violated has been raised with the subsequent
122 --      stripping of the constraint name from the generated error message
123 --      text.
124 --   2) Standalone validation test which corresponds with a constraint error.
125 --
126 -- In Parameter:
127 --   p_constraint_name is in upper format and is just the constraint name
128 --   (e.g. not prefixed by brackets, schema owner etc).
129 --
130 -- Post Success:
131 --   Development dependant.
132 --
133 -- Post Failure:
134 --   Developement dependant.
135 --
136 -- Developer Implementation Notes:
137 --   For each constraint being checked the hr system package failure message
138 --   has been generated as a template only. These system error messages should
139 --   be modified as required (i.e. change the system failure message to a user
140 --   friendly defined error message).
141 --
142 -- Access Status:
143 --   Internal Development Use Only.
144 --
145 -- {End Of Comments}
146 -- ----------------------------------------------------------------------------
147 Procedure constraint_error
148             (p_constraint_name in all_constraints.constraint_name%TYPE);
149 --
150 -- ----------------------------------------------------------------------------
151 -- |-----------------------------< api_updating >-----------------------------|
152 -- ----------------------------------------------------------------------------
153 -- {Start Of Comments}
154 --
155 -- Description:
156 --   This function is used to populate the g_old_rec record with the
157 --   current row from the database for the specified primary key
158 --   provided that the primary key exists and is valid and does not
159 --   already match the current g_old_rec. The function will always return
160 --   a TRUE value if the g_old_rec is populated with the current row.
161 --   A FALSE value will be returned if all of the primary key arguments
162 --   are null.
163 --
164 -- Prerequisites:
165 --   None.
166 --
167 -- In Parameters:
168 --
169 -- Post Success:
170 --   A value of TRUE will be returned indiciating that the g_old_rec
171 --   is current.
172 --   A value of FALSE will be returned if all of the primary key arguments
173 --   have a null value (this indicates that the row has not be inserted into
174 --   the Schema), and therefore could never have a corresponding row.
175 --
176 -- Post Failure:
177 --   A failure can only occur under two circumstances:
178 --   1) The primary key is invalid (i.e. a row does not exist for the
179 --      specified primary key values).
180 --   2) If an object_version_number exists but is NOT the same as the current
181 --      g_old_rec value.
182 --
183 -- Developer Implementation Notes:
184 --   None.
185 --
186 -- Access Status:
187 --   Internal Development Use Only.
188 --
189 -- {End Of Comments}
190 -- ----------------------------------------------------------------------------
191 Function api_updating
192   (
193   p_enrt_rt_ctfn_id                 in number,
194   p_object_version_number              in number
195   )      Return Boolean;
196 --
197 -- ----------------------------------------------------------------------------
198 -- |---------------------------------< lck >----------------------------------|
199 -- ----------------------------------------------------------------------------
200 -- {Start Of Comments}
201 --
202 -- Description:
203 --   The Lck process has two main functions to perform. Firstly, the row to be
204 --   updated or deleted must be locked. The locking of the row will only be
205 --   successful if the row is not currently locked by another user.
206 --   Secondly, during the locking of the row, the row is selected into
207 --   the g_old_rec data structure which enables the current row values from the
208 --   server to be available to the api.
209 --
210 -- Prerequisites:
211 --   When attempting to call the lock the object version number (if defined)
212 --   is mandatory.
213 --
214 -- In Parameters:
215 --   The arguments to the Lck process are the primary key(s) which uniquely
216 --   identify the row and the object version number of row.
217 --
218 -- Post Success:
219 --   On successful completion of the Lck process the row to be updated or
220 --   deleted will be locked and selected into the global data structure
221 --   g_old_rec.
222 --
223 -- Post Failure:
224 --   The Lck process can fail for three reasons:
225 --   1) When attempting to lock the row the row could already be locked by
226 --      another user. This will raise the HR_Api.Object_Locked exception.
227 --   2) The row which is required to be locked doesn't exist in the HR Schema.
228 --      This error is trapped and reported using the message name
229 --      'HR_7220_INVALID_PRIMARY_KEY'.
230 --   3) The row although existing in the HR Schema has a different object
231 --      version number than the object version number specified.
232 --      This error is trapped and reported using the message name
233 --      'HR_7155_OBJECT_INVALID'.
234 --
235 -- Developer Implementation Notes:
236 --   For each primary key and the object version number arguments add a
237 --   call to hr_api.mandatory_arg_error procedure to ensure that these
238 --   argument values are not null.
239 --
240 -- Access Status:
241 --   Internal Development Use Only.
242 --
243 -- {End Of Comments}
244 -- ----------------------------------------------------------------------------
245 Procedure lck
246   (
247   p_enrt_rt_ctfn_id                 in number,
248   p_object_version_number              in number
249   );
250 --
251 -- ----------------------------------------------------------------------------
252 -- |-----------------------------< convert_args >-----------------------------|
253 -- ----------------------------------------------------------------------------
254 -- {Start Of Comments}
255 --
256 -- Description:
257 --   This function is used to turn attribute parameters into the record
258 --   structure parameter g_rec_type.
259 --
260 -- Prerequisites:
261 --   This is a private function and can only be called from the ins or upd
262 --   attribute processes.
263 --
264 -- In Parameters:
265 --
266 -- Post Success:
267 --   A returning record structure will be returned.
268 --
269 -- Post Failure:
270 --   No direct error handling is required within this function. Any possible
271 --   errors within this function will be a PL/SQL value error due to conversion
272 --   of datatypes or data lengths.
273 --
274 -- Developer Implementation Notes:
275 --   None.
276 --
277 -- Access Status:
278 --   Internal Row Handler Use Only.
279 --
280 -- {End Of Comments}
281 -- ----------------------------------------------------------------------------
282 Function convert_args
283 	(
284 	p_enrt_rt_ctfn_id               in number,
285 	p_enrt_ctfn_typ_cd              in varchar2,
286 	p_rqd_flag                      in varchar2,
287 	p_enrt_rt_id                    in number,
288 	p_business_group_id             in number,
289 	p_erc_attribute_category        in varchar2,
290 	p_erc_attribute1                in varchar2,
291 	p_erc_attribute2                in varchar2,
292 	p_erc_attribute3                in varchar2,
293 	p_erc_attribute4                in varchar2,
294 	p_erc_attribute5                in varchar2,
295 	p_erc_attribute6                in varchar2,
296 	p_erc_attribute7                in varchar2,
297 	p_erc_attribute8                in varchar2,
298 	p_erc_attribute9                in varchar2,
299 	p_erc_attribute10               in varchar2,
300 	p_erc_attribute11               in varchar2,
301 	p_erc_attribute12               in varchar2,
302 	p_erc_attribute13               in varchar2,
303 	p_erc_attribute14               in varchar2,
304 	p_erc_attribute15               in varchar2,
305 	p_erc_attribute16               in varchar2,
306 	p_erc_attribute17               in varchar2,
307 	p_erc_attribute18               in varchar2,
308 	p_erc_attribute19               in varchar2,
309 	p_erc_attribute20               in varchar2,
310 	p_erc_attribute21               in varchar2,
311 	p_erc_attribute22               in varchar2,
312 	p_erc_attribute23               in varchar2,
313 	p_erc_attribute24               in varchar2,
314 	p_erc_attribute25               in varchar2,
315 	p_erc_attribute26               in varchar2,
316 	p_erc_attribute27               in varchar2,
317 	p_erc_attribute28               in varchar2,
318 	p_erc_attribute29               in varchar2,
319 	p_erc_attribute30               in varchar2,
320 	p_request_id                    in number,
321 	p_program_application_id        in number,
322 	p_program_id                    in number,
323 	p_program_update_date           in date,
324 	p_object_version_number         in number
325 	)
326 	Return g_rec_type;
327 --
328 end ben_erc_shd;