DBA Data[Home] [Help]

PACKAGE: APPS.PER_ECO_SHD

Source


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