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