DBA Data[Home] [Help]

PACKAGE: APPS.BEN_XID_SHD

Source


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