DBA Data[Home] [Help]

PACKAGE: APPS.BEN_XRF_SHD

Source


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