DBA Data[Home] [Help]

PACKAGE: APPS.PER_ELC_SHD

Source


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