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