DBA Data[Home] [Help]

PACKAGE: APPS.BEN_XWC_SHD

Source


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