DBA Data[Home] [Help]

PACKAGE: APPS.BEN_XCR_SHD

Source


1 Package ben_xcr_shd AUTHID CURRENT_USER as
2 /* $Header: bexcrrhi.pkh 120.0 2005/05/28 12:25:51 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                    Global Record Type Specification                      |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9   (
10   ext_crit_prfl_id                  number(15),
11   name                              varchar2(600),
12   business_group_id                 number(15),
13   legislation_code                  varchar2(30),
14   xcr_attribute_category            varchar2(30),
15   xcr_attribute1                    varchar2(150),
16   xcr_attribute2                    varchar2(150),
17   xcr_attribute3                    varchar2(150),
18   xcr_attribute4                    varchar2(150),
19   xcr_attribute5                    varchar2(150),
20   xcr_attribute6                    varchar2(150),
21   xcr_attribute7                    varchar2(150),
22   xcr_attribute8                    varchar2(150),
23   xcr_attribute9                    varchar2(150),
24   xcr_attribute10                   varchar2(150),
25   xcr_attribute11                   varchar2(150),
26   xcr_attribute12                   varchar2(150),
27   xcr_attribute13                   varchar2(150),
28   xcr_attribute14                   varchar2(150),
29   xcr_attribute15                   varchar2(150),
30   xcr_attribute16                   varchar2(150),
31   xcr_attribute17                   varchar2(150),
32   xcr_attribute18                   varchar2(150),
33   xcr_attribute19                   varchar2(150),
34   xcr_attribute20                   varchar2(150),
35   xcr_attribute21                   varchar2(150),
36   xcr_attribute22                   varchar2(150),
37   xcr_attribute23                   varchar2(150),
38   xcr_attribute24                   varchar2(150),
39   xcr_attribute25                   varchar2(150),
40   xcr_attribute26                   varchar2(150),
41   xcr_attribute27                   varchar2(150),
42   xcr_attribute28                   varchar2(150),
43   xcr_attribute29                   varchar2(150),
44   xcr_attribute30                   varchar2(150),
45   ext_global_flag                   varchar2(30),
46   last_update_date                  date,
47   creation_date                     date,
48   last_updated_by                   number(15),
49   last_update_login                 number(15),
50   created_by                        number(15),
51   object_version_number             number(9)
52   );
53 
54 
55 
56 --
57 -- ----------------------------------------------------------------------------
58 -- |           Global Definitions - Internal Development Use Only             |
59 -- ----------------------------------------------------------------------------
60 --
61 g_old_rec  g_rec_type;                            -- Global record definition
62 g_api_dml  boolean;                               -- Global api dml status
63 --
64 -- ----------------------------------------------------------------------------
65 -- |------------------------< return_api_dml_status >-------------------------|
66 -- ----------------------------------------------------------------------------
67 -- {Start Of Comments}
68 --
69 -- Description:
70 --   This function will return the current g_api_dml private global
71 --   boolean status.
72 --   The g_api_dml status determines if at the time of the function
73 --   being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
74 --   is being issued from within an api.
75 --   If the status is TRUE then a dml statement is being issued from
76 --   within this entity api.
77 --   This function is primarily to support database triggers which
78 --   need to maintain the object_version_number for non-supported
79 --   dml statements (i.e. dml statement issued outside of the api layer).
80 --
81 -- Prerequisites:
82 --   None.
83 --
84 -- In Parameters:
85 --   None.
86 --
87 -- Post Success:
88 --   Processing continues.
89 --   If the function returns a TRUE value then, dml is being executed from
90 --   within this api.
91 --
92 -- Post Failure:
93 --   None.
94 --
95 -- Access Status:
96 --   Internal Row Handler Use Only.
97 --
98 -- {End Of Comments}
99 -- ----------------------------------------------------------------------------
100 Function return_api_dml_status Return Boolean;
101 --
102 -- ----------------------------------------------------------------------------
103 -- |---------------------------< constraint_error >---------------------------|
104 -- ----------------------------------------------------------------------------
105 -- {Start Of Comments}
106 --
107 -- Description:
108 --   This procedure is called when a constraint has been violated (i.e.
109 --   The exception hr_api.check_integrity_violated,
110 --   hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
111 --   hr_api.unique_integrity_violated has been raised).
112 --   The exceptions can only be raised as follows:
113 --   1) A check constraint can only be violated during an INSERT or UPDATE
114 --      dml operation.
115 --   2) A parent integrity constraint can only be violated during an
116 --      INSERT or UPDATE dml operation.
117 --   3) A child integrity constraint can only be violated during an
118 --      DELETE dml operation.
119 --   4) A unique integrity constraint can only be violated during INSERT or
120 --      UPDATE dml operation.
121 --
122 -- Prerequisites:
123 --   1) Either hr_api.check_integrity_violated,
124 --      hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
125 --      hr_api.unique_integrity_violated has been raised with the subsequent
126 --      stripping of the constraint name from the generated error message
127 --      text.
128 --   2) Standalone validation test which corresponds with a constraint error.
129 --
130 -- In Parameter:
131 --   p_constraint_name is in upper format and is just the constraint name
132 --   (e.g. not prefixed by brackets, schema owner etc).
133 --
134 -- Post Success:
135 --   Development dependant.
136 --
137 -- Post Failure:
138 --   Developement dependant.
139 --
140 -- Developer Implementation Notes:
141 --   For each constraint being checked the hr system package failure message
142 --   has been generated as a template only. These system error messages should
143 --   be modified as required (i.e. change the system failure message to a user
144 --   friendly defined error message).
145 --
146 -- Access Status:
147 --   Internal Development Use Only.
148 --
149 -- {End Of Comments}
150 -- ----------------------------------------------------------------------------
151 Procedure constraint_error
152             (p_constraint_name in all_constraints.constraint_name%TYPE);
153 --
154 -- ----------------------------------------------------------------------------
155 -- |-----------------------------< api_updating >-----------------------------|
156 -- ----------------------------------------------------------------------------
157 -- {Start Of Comments}
158 --
159 -- Description:
160 --   This function is used to populate the g_old_rec record with the
161 --   current row from the database for the specified primary key
162 --   provided that the primary key exists and is valid and does not
163 --   already match the current g_old_rec. The function will always return
164 --   a TRUE value if the g_old_rec is populated with the current row.
165 --   A FALSE value will be returned if all of the primary key arguments
166 --   are null.
167 --
168 -- Prerequisites:
169 --   None.
170 --
171 -- In Parameters:
172 --
173 -- Post Success:
174 --   A value of TRUE will be returned indiciating that the g_old_rec
175 --   is current.
176 --   A value of FALSE will be returned if all of the primary key arguments
177 --   have a null value (this indicates that the row has not be inserted into
178 --   the Schema), and therefore could never have a corresponding row.
179 --
180 -- Post Failure:
181 --   A failure can only occur under two circumstances:
182 --   1) The primary key is invalid (i.e. a row does not exist for the
183 --      specified primary key values).
184 --   2) If an object_version_number exists but is NOT the same as the current
185 --      g_old_rec value.
186 --
187 -- Developer Implementation Notes:
188 --   None.
189 --
190 -- Access Status:
191 --   Internal Development Use Only.
192 --
193 -- {End Of Comments}
194 -- ----------------------------------------------------------------------------
195 Function api_updating
196   (
197   p_ext_crit_prfl_id                   in number,
198   p_object_version_number              in number
199   )      Return Boolean;
200 --
201 -- ----------------------------------------------------------------------------
202 -- |---------------------------------< lck >----------------------------------|
203 -- ----------------------------------------------------------------------------
204 -- {Start Of Comments}
205 --
206 -- Description:
207 --   The Lck process has two main functions to perform. Firstly, the row to be
208 --   updated or deleted must be locked. The locking of the row will only be
209 --   successful if the row is not currently locked by another user.
210 --   Secondly, during the locking of the row, the row is selected into
211 --   the g_old_rec data structure which enables the current row values from the
212 --   server to be available to the api.
213 --
214 -- Prerequisites:
215 --   When attempting to call the lock the object version number (if defined)
216 --   is mandatory.
217 --
218 -- In Parameters:
219 --   The arguments to the Lck process are the primary key(s) which uniquely
220 --   identify the row and the object version number of row.
221 --
222 -- Post Success:
223 --   On successful completion of the Lck process the row to be updated or
224 --   deleted will be locked and selected into the global data structure
225 --   g_old_rec.
226 --
227 -- Post Failure:
228 --   The Lck process can fail for three reasons:
229 --   1) When attempting to lock the row the row could already be locked by
230 --      another user. This will raise the HR_Api.Object_Locked exception.
231 --   2) The row which is required to be locked doesn't exist in the HR Schema.
232 --      This error is trapped and reported using the message name
233 --      'HR_7220_INVALID_PRIMARY_KEY'.
234 --   3) The row although existing in the HR Schema has a different object
235 --      version number than the object version number specified.
236 --      This error is trapped and reported using the message name
237 --      'HR_7155_OBJECT_INVALID'.
238 --
239 -- Developer Implementation Notes:
240 --   For each primary key and the object version number arguments add a
241 --   call to hr_api.mandatory_arg_error procedure to ensure that these
242 --   argument values are not null.
243 --
244 -- Access Status:
245 --   Internal Development Use Only.
246 --
247 -- {End Of Comments}
248 -- ----------------------------------------------------------------------------
249 Procedure lck
250   (
251   p_ext_crit_prfl_id                   in number,
252   p_object_version_number              in number
253   );
254 --
255 -- ----------------------------------------------------------------------------
256 -- |-----------------------------< convert_args >-----------------------------|
257 -- ----------------------------------------------------------------------------
258 -- {Start Of Comments}
259 --
260 -- Description:
261 --   This function is used to turn attribute parameters into the record
262 --   structure parameter g_rec_type.
263 --
264 -- Prerequisites:
265 --   This is a private function and can only be called from the ins or upd
266 --   attribute processes.
267 --
268 -- In Parameters:
269 --
270 -- Post Success:
271 --   A returning record structure will be returned.
272 --
273 -- Post Failure:
274 --   No direct error handling is required within this function. Any possible
275 --   errors within this function will be a PL/SQL value error due to conversion
276 --   of datatypes or data lengths.
277 --
278 -- Developer Implementation Notes:
279 --   None.
280 --
281 -- Access Status:
282 --   Internal Row Handler Use Only.
283 --
284 -- {End Of Comments}
285 -- ----------------------------------------------------------------------------
286 Function convert_args
287 	(
288 	p_ext_crit_prfl_id              in number,
289 	p_name                          in varchar2,
290 	p_business_group_id             in number,
291         p_legislation_code              in varchar2,
292 	p_xcr_attribute_category        in varchar2,
293 	p_xcr_attribute1                in varchar2,
294 	p_xcr_attribute2                in varchar2,
295 	p_xcr_attribute3                in varchar2,
296 	p_xcr_attribute4                in varchar2,
297 	p_xcr_attribute5                in varchar2,
298 	p_xcr_attribute6                in varchar2,
299 	p_xcr_attribute7                in varchar2,
300 	p_xcr_attribute8                in varchar2,
301 	p_xcr_attribute9                in varchar2,
302 	p_xcr_attribute10               in varchar2,
303 	p_xcr_attribute11               in varchar2,
304 	p_xcr_attribute12               in varchar2,
305 	p_xcr_attribute13               in varchar2,
306 	p_xcr_attribute14               in varchar2,
307 	p_xcr_attribute15               in varchar2,
308 	p_xcr_attribute16               in varchar2,
309 	p_xcr_attribute17               in varchar2,
310 	p_xcr_attribute18               in varchar2,
311 	p_xcr_attribute19               in varchar2,
312 	p_xcr_attribute20               in varchar2,
313 	p_xcr_attribute21               in varchar2,
314 	p_xcr_attribute22               in varchar2,
315 	p_xcr_attribute23               in varchar2,
316 	p_xcr_attribute24               in varchar2,
317 	p_xcr_attribute25               in varchar2,
318 	p_xcr_attribute26               in varchar2,
319 	p_xcr_attribute27               in varchar2,
320 	p_xcr_attribute28               in varchar2,
321 	p_xcr_attribute29               in varchar2,
322 	p_xcr_attribute30               in varchar2,
323 	p_ext_global_flag               in varchar2,
324         p_last_update_date              in date,
325         p_creation_date                 in date,
326         p_last_updated_by               in number,
327         p_last_update_login             in number,
328         p_created_by                    in number,
329 	p_object_version_number         in number
330 	)
331 	Return g_rec_type;
332 --
333 end ben_xcr_shd;