DBA Data[Home] [Help]

PACKAGE: APPS.BEN_XCL_SHD

Source


1 Package ben_xcl_shd AUTHID CURRENT_USER as
2 /* $Header: bexclrhi.pkh 120.0 2005/05/28 12:24:24 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                    Global Record Type Specification                      |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9   (
10   ext_chg_evt_log_id                number(15),
11   chg_evt_cd                        varchar2(30),
12   chg_eff_dt                        date,
13   chg_user_id                       number(15),
14   prmtr_01                          varchar2(90),
15   prmtr_02                          varchar2(90),
16   prmtr_03                          varchar2(90),
17   prmtr_04                          varchar2(90),
18   prmtr_05                          varchar2(90),
19   prmtr_06                          varchar2(90),
20   prmtr_07                          varchar2(90),
21   prmtr_08                          varchar2(90),
22   prmtr_09                          varchar2(90),
23   prmtr_10                          varchar2(90),
24   person_id                         number(15),
25   business_group_id                 number(15),
26   object_version_number             number(9),
27   chg_actl_dt                       date,
28   new_val1                          varchar2(600),
29   new_val2                          varchar2(600),
30   new_val3                          varchar2(600),
31   new_val4                          varchar2(600),
32   new_val5                          varchar2(600),
33   new_val6                          varchar2(600),
34   old_val1                          varchar2(600),
35   old_val2                          varchar2(600),
36   old_val3                          varchar2(600),
37   old_val4                          varchar2(600),
38   old_val5                          varchar2(600),
39   old_val6                          varchar2(600)
40   );
41 
42 
43 --
44 -- ----------------------------------------------------------------------------
45 -- |           Global Definitions - Internal Development Use Only             |
46 -- ----------------------------------------------------------------------------
47 --
48 g_old_rec  g_rec_type;                            -- Global record definition
49 g_api_dml  boolean;                               -- Global api dml status
50 --
51 -- ----------------------------------------------------------------------------
52 -- |------------------------< return_api_dml_status >-------------------------|
53 -- ----------------------------------------------------------------------------
54 -- {Start Of Comments}
55 --
56 -- Description:
57 --   This function will return the current g_api_dml private global
58 --   boolean status.
59 --   The g_api_dml status determines if at the time of the function
60 --   being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
61 --   is being issued from within an api.
62 --   If the status is TRUE then a dml statement is being issued from
63 --   within this entity api.
64 --   This function is primarily to support database triggers which
65 --   need to maintain the object_version_number for non-supported
66 --   dml statements (i.e. dml statement issued outside of the api layer).
67 --
68 -- Prerequisites:
69 --   None.
70 --
71 -- In Parameters:
72 --   None.
73 --
74 -- Post Success:
75 --   Processing continues.
76 --   If the function returns a TRUE value then, dml is being executed from
77 --   within this api.
78 --
79 -- Post Failure:
80 --   None.
81 --
82 -- Access Status:
83 --   Internal Row Handler Use Only.
84 --
85 -- {End Of Comments}
86 -- ----------------------------------------------------------------------------
87 Function return_api_dml_status Return Boolean;
88 --
89 -- ----------------------------------------------------------------------------
90 -- |---------------------------< constraint_error >---------------------------|
91 -- ----------------------------------------------------------------------------
92 -- {Start Of Comments}
93 --
94 -- Description:
95 --   This procedure is called when a constraint has been violated (i.e.
96 --   The exception hr_api.check_integrity_violated,
97 --   hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
98 --   hr_api.unique_integrity_violated has been raised).
99 --   The exceptions can only be raised as follows:
100 --   1) A check constraint can only be violated during an INSERT or UPDATE
101 --      dml operation.
102 --   2) A parent integrity constraint can only be violated during an
103 --      INSERT or UPDATE dml operation.
104 --   3) A child integrity constraint can only be violated during an
105 --      DELETE dml operation.
106 --   4) A unique integrity constraint can only be violated during INSERT or
107 --      UPDATE dml operation.
108 --
109 -- Prerequisites:
110 --   1) Either hr_api.check_integrity_violated,
111 --      hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
112 --      hr_api.unique_integrity_violated has been raised with the subsequent
113 --      stripping of the constraint name from the generated error message
114 --      text.
115 --   2) Standalone validation test which corresponds with a constraint error.
116 --
117 -- In Parameter:
118 --   p_constraint_name is in upper format and is just the constraint name
119 --   (e.g. not prefixed by brackets, schema owner etc).
120 --
121 -- Post Success:
122 --   Development dependant.
123 --
124 -- Post Failure:
125 --   Developement dependant.
126 --
127 -- Developer Implementation Notes:
128 --   For each constraint being checked the hr system package failure message
129 --   has been generated as a template only. These system error messages should
130 --   be modified as required (i.e. change the system failure message to a user
131 --   friendly defined error message).
132 --
133 -- Access Status:
134 --   Internal Development Use Only.
135 --
136 -- {End Of Comments}
137 -- ----------------------------------------------------------------------------
138 Procedure constraint_error
139             (p_constraint_name in all_constraints.constraint_name%TYPE);
140 --
141 -- ----------------------------------------------------------------------------
142 -- |-----------------------------< api_updating >-----------------------------|
143 -- ----------------------------------------------------------------------------
144 -- {Start Of Comments}
145 --
146 -- Description:
147 --   This function is used to populate the g_old_rec record with the
148 --   current row from the database for the specified primary key
149 --   provided that the primary key exists and is valid and does not
150 --   already match the current g_old_rec. The function will always return
151 --   a TRUE value if the g_old_rec is populated with the current row.
152 --   A FALSE value will be returned if all of the primary key arguments
153 --   are null.
154 --
155 -- Prerequisites:
156 --   None.
157 --
158 -- In Parameters:
159 --
160 -- Post Success:
161 --   A value of TRUE will be returned indiciating that the g_old_rec
162 --   is current.
163 --   A value of FALSE will be returned if all of the primary key arguments
164 --   have a null value (this indicates that the row has not be inserted into
165 --   the Schema), and therefore could never have a corresponding row.
166 --
167 -- Post Failure:
168 --   A failure can only occur under two circumstances:
169 --   1) The primary key is invalid (i.e. a row does not exist for the
170 --      specified primary key values).
171 --   2) If an object_version_number exists but is NOT the same as the current
172 --      g_old_rec value.
173 --
174 -- Developer Implementation Notes:
175 --   None.
176 --
177 -- Access Status:
178 --   Internal Development Use Only.
179 --
180 -- {End Of Comments}
181 -- ----------------------------------------------------------------------------
182 Function api_updating
183   (
184   p_ext_chg_evt_log_id                 in number,
185   p_object_version_number              in number
186   )      Return Boolean;
187 --
188 -- ----------------------------------------------------------------------------
189 -- |---------------------------------< lck >----------------------------------|
190 -- ----------------------------------------------------------------------------
191 -- {Start Of Comments}
192 --
193 -- Description:
194 --   The Lck process has two main functions to perform. Firstly, the row to be
195 --   updated or deleted must be locked. The locking of the row will only be
196 --   successful if the row is not currently locked by another user.
197 --   Secondly, during the locking of the row, the row is selected into
198 --   the g_old_rec data structure which enables the current row values from the
199 --   server to be available to the api.
200 --
201 -- Prerequisites:
202 --   When attempting to call the lock the object version number (if defined)
203 --   is mandatory.
204 --
205 -- In Parameters:
206 --   The arguments to the Lck process are the primary key(s) which uniquely
207 --   identify the row and the object version number of row.
208 --
209 -- Post Success:
210 --   On successful completion of the Lck process the row to be updated or
211 --   deleted will be locked and selected into the global data structure
212 --   g_old_rec.
213 --
214 -- Post Failure:
215 --   The Lck process can fail for three reasons:
216 --   1) When attempting to lock the row the row could already be locked by
217 --      another user. This will raise the HR_Api.Object_Locked exception.
218 --   2) The row which is required to be locked doesn't exist in the HR Schema.
219 --      This error is trapped and reported using the message name
220 --      'HR_7220_INVALID_PRIMARY_KEY'.
221 --   3) The row although existing in the HR Schema has a different object
222 --      version number than the object version number specified.
223 --      This error is trapped and reported using the message name
224 --      'HR_7155_OBJECT_INVALID'.
225 --
226 -- Developer Implementation Notes:
227 --   For each primary key and the object version number arguments add a
228 --   call to hr_api.mandatory_arg_error procedure to ensure that these
229 --   argument values are not null.
230 --
231 -- Access Status:
232 --   Internal Development Use Only.
233 --
234 -- {End Of Comments}
235 -- ----------------------------------------------------------------------------
236 Procedure lck
237   (
238   p_ext_chg_evt_log_id                 in number,
239   p_object_version_number              in number
240   );
241 --
242 -- ----------------------------------------------------------------------------
243 -- |-----------------------------< convert_args >-----------------------------|
244 -- ----------------------------------------------------------------------------
245 -- {Start Of Comments}
246 --
247 -- Description:
248 --   This function is used to turn attribute parameters into the record
249 --   structure parameter g_rec_type.
250 --
251 -- Prerequisites:
252 --   This is a private function and can only be called from the ins or upd
253 --   attribute processes.
254 --
255 -- In Parameters:
256 --
257 -- Post Success:
258 --   A returning record structure will be returned.
259 --
260 -- Post Failure:
261 --   No direct error handling is required within this function. Any possible
262 --   errors within this function will be a PL/SQL value error due to conversion
263 --   of datatypes or data lengths.
264 --
265 -- Developer Implementation Notes:
266 --   None.
267 --
268 -- Access Status:
269 --   Internal Row Handler Use Only.
270 --
271 -- {End Of Comments}
272 -- ----------------------------------------------------------------------------
273 Function convert_args
274 	(
275 	p_ext_chg_evt_log_id            in number,
276 	p_chg_evt_cd                    in varchar2,
277 	p_chg_eff_dt                    in date,
278 	p_chg_user_id                   in number,
279 	p_prmtr_01                      in varchar2,
280 	p_prmtr_02                      in varchar2,
281 	p_prmtr_03                      in varchar2,
282 	p_prmtr_04                      in varchar2,
283 	p_prmtr_05                      in varchar2,
284 	p_prmtr_06                      in varchar2,
285 	p_prmtr_07                      in varchar2,
286 	p_prmtr_08                      in varchar2,
287 	p_prmtr_09                      in varchar2,
288 	p_prmtr_10                      in varchar2,
289 	p_person_id                     in number,
290 	p_business_group_id             in number,
291 	p_object_version_number         in number,
292         p_chg_actl_dt                   in date,
293         p_new_val1                      in varchar2,
294         p_new_val2                      in varchar2,
295         p_new_val3                      in varchar2,
296         p_new_val4                      in varchar2,
297         p_new_val5                      in varchar2,
298         p_new_val6                      in varchar2,
299         p_old_val1                      in varchar2,
300         p_old_val2                      in varchar2,
301         p_old_val3                      in varchar2,
302         p_old_val4                      in varchar2,
303         p_old_val5                      in varchar2,
304         p_old_val6                      in varchar2
305 	)
306 	Return g_rec_type;
307 --
308 end ben_xcl_shd;