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