DBA Data[Home] [Help]

PACKAGE: APPS.PER_ORS_SHD

Source


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