DBA Data[Home] [Help]

PACKAGE: APPS.HR_ORU_SHD

Source


1 Package hr_oru_shd AUTHID CURRENT_USER as
2 /* $Header: hrorurhi.pkh 120.1 2005/07/15 06:03:15 bshukla noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                    Global Record Type Specification                      |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9   (organization_id                 number(15)
10   ,business_group_id               number(15)
11   ,cost_allocation_keyflex_id      number(9)
12   ,location_id                     number(15)
13   ,soft_coding_keyflex_id          number(15)
14   ,date_from                       date
15   ,name                            varchar2(240)
16   ,comments                        varchar2(2048)    -- pseudo column
17   ,date_to                         date
18   ,internal_external_flag          varchar2(30)
19   ,internal_address_line           varchar2(80)
20   ,type                            varchar2(30)
21   ,request_id                      number(15)
22   ,program_application_id          number(15)
23   ,program_id                      number(15)
24   ,program_update_date             date
25   ,attribute_category              varchar2(30)
26   ,attribute1                      varchar2(150)
27   ,attribute2                      varchar2(150)
28   ,attribute3                      varchar2(150)
29   ,attribute4                      varchar2(150)
30   ,attribute5                      varchar2(150)
31   ,attribute6                      varchar2(150)
32   ,attribute7                      varchar2(150)
33   ,attribute8                      varchar2(150)
34   ,attribute9                      varchar2(150)
35   ,attribute10                     varchar2(150)
36   ,attribute11                     varchar2(150)
37   ,attribute12                     varchar2(150)
38   ,attribute13                     varchar2(150)
39   ,attribute14                     varchar2(150)
40   ,attribute15                     varchar2(150)
41   ,attribute16                     varchar2(150)
42   ,attribute17                     varchar2(150)
43   ,attribute18                     varchar2(150)
44   ,attribute19                     varchar2(150)
45   ,attribute20                     varchar2(150)
46   --Enhancement 4040086
47   ,attribute21                     varchar2(150)
48   ,attribute22                     varchar2(150)
49   ,attribute23                     varchar2(150)
50   ,attribute24                     varchar2(150)
51   ,attribute25                     varchar2(150)
52   ,attribute26                     varchar2(150)
53   ,attribute27                     varchar2(150)
54   ,attribute28                     varchar2(150)
55   ,attribute29                     varchar2(150)
56   ,attribute30                     varchar2(150)
57   --End Enhancement 4040086
58   ,object_version_number           number(9)
59   );
60 --
61 -- ----------------------------------------------------------------------------
62 -- |           Global Definitions - Internal Development Use Only             |
63 -- ----------------------------------------------------------------------------
64 --
65 g_old_rec  g_rec_type;                            -- Global record definition
66 g_api_dml  boolean;                               -- Global api dml status
67 --
68 -- ----------------------------------------------------------------------------
69 -- |------------------------< return_api_dml_status >-------------------------|
70 -- ----------------------------------------------------------------------------
71 -- {Start Of Comments}
72 --
73 -- Description:
74 --   This function will return the current g_api_dml private global
75 --   boolean status.
76 --   The g_api_dml status determines if at the time of the function
77 --   being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
78 --   is being issued from within an api.
79 --   If the status is TRUE then a dml statement is being issued from
80 --   within this entity api.
81 --   This function is primarily to support database triggers which
82 --   need to maintain the object_version_number for non-supported
83 --   dml statements (i.e. dml statement issued outside of the api layer).
84 --
85 -- Prerequisites:
86 --   None.
87 --
88 -- In Parameters:
89 --   None.
90 --
91 -- Post Success:
92 --   Processing continues.
93 --   If the function returns a TRUE value then, dml is being executed from
94 --   within this api.
95 --
96 -- Post Failure:
97 --   None.
98 --
99 -- Access Status:
100 --   Internal Row Handler Use Only.
101 --
102 -- {End Of Comments}
103 -- ----------------------------------------------------------------------------
104 Function return_api_dml_status Return Boolean;
105 --
106 -- ----------------------------------------------------------------------------
107 -- |---------------------------< constraint_error >---------------------------|
108 -- ----------------------------------------------------------------------------
109 -- {Start Of Comments}
110 --
111 -- Description:
112 --   This procedure is called when a constraint has been violated (i.e.
113 --   The exception hr_api.check_integrity_violated,
114 --   hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
115 --   hr_api.unique_integrity_violated has been raised).
116 --   The exceptions can only be raised as follows:
117 --   1) A check constraint can only be violated during an INSERT or UPDATE
118 --      dml operation.
119 --   2) A parent integrity constraint can only be violated during an
120 --      INSERT or UPDATE dml operation.
121 --   3) A child integrity constraint can only be violated during an
122 --      DELETE dml operation.
123 --   4) A unique integrity constraint can only be violated during INSERT or
124 --      UPDATE dml operation.
125 --
126 -- Prerequisites:
127 --   1) Either hr_api.check_integrity_violated,
128 --      hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
129 --      hr_api.unique_integrity_violated has been raised with the subsequent
130 --      stripping of the constraint name from the generated error message
131 --      text.
132 --   2) Standalone validation test which corresponds with a constraint error.
133 --
134 -- In Parameter:
135 --   p_constraint_name is in upper format and is just the constraint name
136 --   (e.g. not prefixed by brackets, schema owner etc).
137 --
138 -- Post Success:
139 --   Development dependant.
140 --
141 -- Post Failure:
142 --   Developement dependant.
143 --
144 -- Developer Implementation Notes:
145 --   For each constraint being checked the hr system package failure message
146 --   has been generated as a template only. These system error messages should
147 --   be modified as required (i.e. change the system failure message to a user
148 --   friendly defined error message).
149 --
150 -- Access Status:
151 --   Internal Development Use Only.
152 --
153 -- {End Of Comments}
154 -- ----------------------------------------------------------------------------
155 Procedure constraint_error
156   (p_constraint_name in all_constraints.constraint_name%TYPE);
157 --
158 -- ----------------------------------------------------------------------------
159 -- |-----------------------------< api_updating >-----------------------------|
160 -- ----------------------------------------------------------------------------
161 --  {Start Of Comments}
162 --
163 -- Description:
164 --   This function is used to populate the g_old_rec record with the
165 --   current row from the database for the specified primary key
166 --   provided that the primary key exists and is valid and does not
167 --   already match the current g_old_rec. The function will always return
168 --   a TRUE value if the g_old_rec is populated with the current row.
169 --   A FALSE value will be returned if all of the primary key arguments
170 --   are null.
171 --
172 -- Prerequisites:
173 --   None.
174 --
175 -- In Parameters:
176 --
177 -- Post Success:
178 --   A value of TRUE will be returned indiciating that the g_old_rec
179 --   is current.
180 --   A value of FALSE will be returned if all of the primary key arguments
181 --   have a null value (this indicates that the row has not be inserted into
182 --   the Schema), and therefore could never have a corresponding row.
183 --
184 -- Post Failure:
185 --   A failure can only occur under two circumstances:
186 --   1) The primary key is invalid (i.e. a row does not exist for the
187 --      specified primary key values).
188 --   2) If an object_version_number exists but is NOT the same as the current
189 --      g_old_rec value.
190 --
191 -- Developer Implementation Notes:
192 --   None.
193 --
194 -- Access Status:
195 --   Internal Development Use Only.
196 --
197 -- {End Of Comments}
198 -- ----------------------------------------------------------------------------
199 Function api_updating
200   (p_organization_id                      in     number
201   ,p_object_version_number                in     number
202   )      Return Boolean;
203 --
204 -- ----------------------------------------------------------------------------
205 -- |---------------------------------< lck >----------------------------------|
206 -- ----------------------------------------------------------------------------
207 -- {Start of comments}
208 --
209 -- Description:
210 --   The Lck process has two main functions to perform. Firstly, the row to be
211 --   updated or deleted must be locked. The locking of the row will only be
212 --   successful if the row is not currently locked by another user.
213 --   Secondly, during the locking of the row, the row is selected into
214 --   the g_old_rec data structure which enables the current row values from the
215 --   server to be available to the api.
216 --
217 -- Prerequisites:
218 --   When attempting to call the lock the object version number (if defined)
219 --   is mandatory.
220 --
221 -- In Parameters:
222 --   The arguments to the Lck process are the primary key(s) which uniquely
223 --   identify the row and the object version number of row.
224 --
225 -- Post Success:
226 --   On successful completion of the Lck process the row to be updated or
227 --   deleted will be locked and selected into the global data structure
228 --   g_old_rec.
229 --
230 -- Post Failure:
231 --   The Lck process can fail for three reasons:
232 --   1) When attempting to lock the row the row could already be locked by
233 --      another user. This will raise the HR_Api.Object_Locked exception.
234 --   2) The row which is required to be locked doesn't exist in the HR Schema.
235 --      This error is trapped and reported using the message name
236 --      'HR_7220_INVALID_PRIMARY_KEY'.
237 --   3) The row although existing in the HR Schema has a different object
238 --      version number than the object version number specified.
239 --      This error is trapped and reported using the message name
240 --      'HR_7155_OBJECT_INVALID'.
241 --
242 -- Developer Implementation Notes:
243 --   For each primary key and the object version number arguments add a
244 --   call to hr_api.mandatory_arg_error procedure to ensure that these
245 --   argument values are not null.
246 --
247 -- Access Status:
248 --   Internal Development Use Only.
249 --
250 -- {End of comments}
251 -- ----------------------------------------------------------------------------
252 Procedure lck
253   (p_organization_id                      in     number
254   ,p_object_version_number                in     number
255   );
256 --
257 -- ----------------------------------------------------------------------------
258 -- |-----------------------------< convert_args >-----------------------------|
259 -- ----------------------------------------------------------------------------
260 -- {Start Of Comments}
261 --
262 -- Description:
263 --   This function is used to turn attribute parameters into the record
264 --   structure parameter g_rec_type.
265 --
266 -- Prerequisites:
267 --   This is a private function and can only be called from the ins or upd
268 --   attribute processes.
269 --
270 -- In Parameters:
271 --
272 -- Post Success:
273 --   A returning record structure will be returned.
274 --
275 -- Post Failure:
276 --   No direct error handling is required within this function.  Any possible
277 --   errors within this function will be a PL/SQL value error due to conversion
278 --   of datatypes or data lengths.
279 --
280 -- Developer Implementation Notes:
281 --   None.
282 --
283 -- Access Status:
284 --   Internal Row Handler Use Only.
285 --
286 -- {End Of Comments}
287 -- ----------------------------------------------------------------------------
288 Function convert_args
289   (p_organization_id                in number
290   ,p_business_group_id              in number
291   ,p_cost_allocation_keyflex_id     in number
292   ,p_location_id                    in number
293   ,p_soft_coding_keyflex_id         in number
294   ,p_date_from                      in date
295   ,p_name                           in varchar2
296   ,p_comments                       in varchar2
297   ,p_date_to                        in date
298   ,p_internal_external_flag         in varchar2
299   ,p_internal_address_line          in varchar2
300   ,p_type                           in varchar2
301   ,p_request_id                     in number
302   ,p_program_application_id         in number
303   ,p_program_id                     in number
304   ,p_program_update_date            in date
305   ,p_attribute_category             in varchar2
306   ,p_attribute1                     in varchar2
307   ,p_attribute2                     in varchar2
308   ,p_attribute3                     in varchar2
309   ,p_attribute4                     in varchar2
310   ,p_attribute5                     in varchar2
311   ,p_attribute6                     in varchar2
312   ,p_attribute7                     in varchar2
313   ,p_attribute8                     in varchar2
314   ,p_attribute9                     in varchar2
315   ,p_attribute10                    in varchar2
316   ,p_attribute11                    in varchar2
317   ,p_attribute12                    in varchar2
318   ,p_attribute13                    in varchar2
319   ,p_attribute14                    in varchar2
320   ,p_attribute15                    in varchar2
321   ,p_attribute16                    in varchar2
322   ,p_attribute17                    in varchar2
323   ,p_attribute18                    in varchar2
324   ,p_attribute19                    in varchar2
325   ,p_attribute20                    in varchar2
326   --Enhancement 4040086
327   ,p_attribute21                    in varchar2
328   ,p_attribute22                    in varchar2
329   ,p_attribute23                    in varchar2
330   ,p_attribute24                    in varchar2
331   ,p_attribute25                    in varchar2
332   ,p_attribute26                    in varchar2
333   ,p_attribute27                    in varchar2
334   ,p_attribute28                    in varchar2
335   ,p_attribute29                    in varchar2
336   ,p_attribute30                    in varchar2
337   --End Enhancement 4040086
338   ,p_object_version_number          in number
339   )
340   Return g_rec_type;
341 --
342 end hr_oru_shd;