DBA Data[Home] [Help]

PACKAGE: APPS.BEN_PCP_SHD

Source


1 Package ben_pcp_shd as
2 /* $Header: bepcprhi.pkh 120.0 2005/05/28 10:14:07 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                    Global Record Type Specification                      |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9   (pl_pcp_id                       number(15)
10   ,pl_id                           number(15)
11   ,business_group_id               number(15)
12   ,pcp_strt_dt_cd                  varchar2(30)
13   ,pcp_dsgn_cd                     varchar2(30)
14   ,pcp_dpnt_dsgn_cd                varchar2(30)
15   ,pcp_rpstry_flag                 varchar2(30)
16   ,pcp_can_keep_flag               varchar2(30)
17   ,pcp_radius                      number
18   ,pcp_radius_uom                  varchar2(30)
19   ,pcp_radius_warn_flag            varchar2(30)
20   ,pcp_num_chgs                    number
21   ,pcp_num_chgs_uom                varchar2(30)
22   ,pcp_attribute_category          varchar2(30)
23   ,pcp_attribute1                  varchar2(150)
24   ,pcp_attribute2                  varchar2(150)
25   ,pcp_attribute3                  varchar2(150)
26   ,pcp_attribute4                  varchar2(150)
27   ,pcp_attribute5                  varchar2(150)
28   ,pcp_attribute6                  varchar2(150)
29   ,pcp_attribute7                  varchar2(150)
30   ,pcp_attribute8                  varchar2(150)
31   ,pcp_attribute9                  varchar2(150)
32   ,pcp_attribute10                 varchar2(150)
33   ,pcp_attribute11                 varchar2(150)
34   ,pcp_attribute12                 varchar2(150)
35   ,pcp_attribute13                 varchar2(150)
36   ,pcp_attribute14                 varchar2(150)
37   ,pcp_attribute15                 varchar2(150)
38   ,pcp_attribute16                 varchar2(150)
39   ,pcp_attribute17                 varchar2(150)
40   ,pcp_attribute18                 varchar2(150)
41   ,pcp_attribute19                 varchar2(150)
42   ,pcp_attribute20                 varchar2(150)
43   ,pcp_attribute21                 varchar2(150)
44   ,pcp_attribute22                 varchar2(150)
45   ,pcp_attribute23                 varchar2(150)
46   ,pcp_attribute24                 varchar2(150)
47   ,pcp_attribute25                 varchar2(150)
48   ,pcp_attribute26                 varchar2(150)
49   ,pcp_attribute27                 varchar2(150)
50   ,pcp_attribute28                 varchar2(150)
51   ,pcp_attribute29                 varchar2(150)
52   ,pcp_attribute30                 varchar2(150)
53   ,object_version_number           number(9)
54   );
55 --
56 -- ----------------------------------------------------------------------------
57 -- |           Global Definitions - Internal Development Use Only             |
58 -- ----------------------------------------------------------------------------
59 --
60 g_old_rec  g_rec_type;                            -- Global record definition
61 g_api_dml  boolean;                               -- Global api dml status
62 --
63 -- ----------------------------------------------------------------------------
64 -- |------------------------< return_api_dml_status >-------------------------|
65 -- ----------------------------------------------------------------------------
66 -- {Start Of Comments}
67 --
68 -- Description:
69 --   This function will return the current g_api_dml private global
70 --   boolean status.
71 --   The g_api_dml status determines if at the time of the function
72 --   being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
73 --   is being issued from within an api.
74 --   If the status is TRUE then a dml statement is being issued from
75 --   within this entity api.
76 --   This function is primarily to support database triggers which
77 --   need to maintain the object_version_number for non-supported
78 --   dml statements (i.e. dml statement issued outside of the api layer).
79 --
80 -- Prerequisites:
81 --   None.
82 --
83 -- In Parameters:
84 --   None.
85 --
86 -- Post Success:
87 --   Processing continues.
88 --   If the function returns a TRUE value then, dml is being executed from
89 --   within this api.
90 --
91 -- Post Failure:
92 --   None.
93 --
94 -- Access Status:
95 --   Internal Row Handler Use Only.
96 --
97 -- {End Of Comments}
98 -- ----------------------------------------------------------------------------
99 Function return_api_dml_status Return Boolean;
100 --
101 -- ----------------------------------------------------------------------------
102 -- |---------------------------< constraint_error >---------------------------|
103 -- ----------------------------------------------------------------------------
104 -- {Start Of Comments}
105 --
106 -- Description:
107 --   This procedure is called when a constraint has been violated (i.e.
108 --   The exception hr_api.check_integrity_violated,
109 --   hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
110 --   hr_api.unique_integrity_violated has been raised).
111 --   The exceptions can only be raised as follows:
112 --   1) A check constraint can only be violated during an INSERT or UPDATE
113 --      dml operation.
114 --   2) A parent integrity constraint can only be violated during an
115 --      INSERT or UPDATE dml operation.
116 --   3) A child integrity constraint can only be violated during an
117 --      DELETE dml operation.
118 --   4) A unique integrity constraint can only be violated during INSERT or
119 --      UPDATE dml operation.
120 --
121 -- Prerequisites:
122 --   1) Either hr_api.check_integrity_violated,
123 --      hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
124 --      hr_api.unique_integrity_violated has been raised with the subsequent
125 --      stripping of the constraint name from the generated error message
126 --      text.
127 --   2) Standalone validation test which corresponds with a constraint error.
128 --
129 -- In Parameter:
130 --   p_constraint_name is in upper format and is just the constraint name
131 --   (e.g. not prefixed by brackets, schema owner etc).
132 --
133 -- Post Success:
134 --   Development dependant.
135 --
136 -- Post Failure:
137 --   Developement dependant.
138 --
139 -- Developer Implementation Notes:
140 --   For each constraint being checked the hr system package failure message
141 --   has been generated as a template only. These system error messages should
142 --   be modified as required (i.e. change the system failure message to a user
143 --   friendly defined error message).
144 --
145 -- Access Status:
146 --   Internal Development Use Only.
147 --
148 -- {End Of Comments}
149 -- ----------------------------------------------------------------------------
150 Procedure constraint_error
151   (p_constraint_name in all_constraints.constraint_name%TYPE);
152 --
153 -- ----------------------------------------------------------------------------
154 -- |-----------------------------< api_updating >-----------------------------|
155 -- ----------------------------------------------------------------------------
156 --  {Start Of Comments}
157 --
158 -- Description:
159 --   This function is used to populate the g_old_rec record with the
160 --   current row from the database for the specified primary key
161 --   provided that the primary key exists and is valid and does not
162 --   already match the current g_old_rec. The function will always return
163 --   a TRUE value if the g_old_rec is populated with the current row.
164 --   A FALSE value will be returned if all of the primary key arguments
165 --   are null.
166 --
167 -- Prerequisites:
168 --   None.
169 --
170 -- In Parameters:
171 --
172 -- Post Success:
173 --   A value of TRUE will be returned indiciating that the g_old_rec
174 --   is current.
175 --   A value of FALSE will be returned if all of the primary key arguments
176 --   have a null value (this indicates that the row has not be inserted into
177 --   the Schema), and therefore could never have a corresponding row.
178 --
179 -- Post Failure:
180 --   A failure can only occur under two circumstances:
181 --   1) The primary key is invalid (i.e. a row does not exist for the
182 --      specified primary key values).
183 --   2) If an object_version_number exists but is NOT the same as the current
184 --      g_old_rec value.
185 --
186 -- Developer Implementation Notes:
187 --   None.
188 --
189 -- Access Status:
190 --   Internal Development Use Only.
191 --
192 -- {End Of Comments}
193 -- ----------------------------------------------------------------------------
194 Function api_updating
195   (p_pl_pcp_id                            in     number
196   ,p_object_version_number                in     number
197   )      Return Boolean;
198 --
199 -- ----------------------------------------------------------------------------
200 -- |---------------------------------< lck >----------------------------------|
201 -- ----------------------------------------------------------------------------
202 -- {Start of comments}
203 --
204 -- Description:
205 --   The Lck process has two main functions to perform. Firstly, the row to be
206 --   updated or deleted must be locked. The locking of the row will only be
207 --   successful if the row is not currently locked by another user.
208 --   Secondly, during the locking of the row, the row is selected into
209 --   the g_old_rec data structure which enables the current row values from the
210 --   server to be available to the api.
211 --
212 -- Prerequisites:
213 --   When attempting to call the lock the object version number (if defined)
214 --   is mandatory.
215 --
216 -- In Parameters:
217 --   The arguments to the Lck process are the primary key(s) which uniquely
218 --   identify the row and the object version number of row.
219 --
220 -- Post Success:
221 --   On successful completion of the Lck process the row to be updated or
222 --   deleted will be locked and selected into the global data structure
223 --   g_old_rec.
224 --
225 -- Post Failure:
226 --   The Lck process can fail for three reasons:
227 --   1) When attempting to lock the row the row could already be locked by
228 --      another user. This will raise the HR_Api.Object_Locked exception.
229 --   2) The row which is required to be locked doesn't exist in the HR Schema.
230 --      This error is trapped and reported using the message name
231 --      'HR_7220_INVALID_PRIMARY_KEY'.
232 --   3) The row although existing in the HR Schema has a different object
233 --      version number than the object version number specified.
234 --      This error is trapped and reported using the message name
235 --      'HR_7155_OBJECT_INVALID'.
236 --
237 -- Developer Implementation Notes:
238 --   For each primary key and the object version number arguments add a
239 --   call to hr_api.mandatory_arg_error procedure to ensure that these
240 --   argument values are not null.
241 --
242 -- Access Status:
243 --   Internal Development Use Only.
244 --
245 -- {End of comments}
246 -- ----------------------------------------------------------------------------
247 Procedure lck
248   (p_pl_pcp_id                            in     number
249   ,p_object_version_number                in     number
250   );
251 --
252 -- ----------------------------------------------------------------------------
253 -- |-----------------------------< convert_args >-----------------------------|
254 -- ----------------------------------------------------------------------------
255 -- {Start Of Comments}
256 --
257 -- Description:
258 --   This function is used to turn attribute parameters into the record
259 --   structure parameter g_rec_type.
260 --
261 -- Prerequisites:
262 --   This is a private function and can only be called from the ins or upd
263 --   attribute processes.
264 --
265 -- In Parameters:
266 --
267 -- Post Success:
268 --   A returning record structure will be returned.
269 --
270 -- Post Failure:
271 --   No direct error handling is required within this function.  Any possible
272 --   errors within this function will be a PL/SQL value error due to conversion
273 --   of datatypes or data lengths.
274 --
275 -- Developer Implementation Notes:
276 --   None.
277 --
278 -- Access Status:
279 --   Internal Row Handler Use Only.
280 --
281 -- {End Of Comments}
282 -- ----------------------------------------------------------------------------
283 Function convert_args
284   (p_pl_pcp_id                      in number
285   ,p_pl_id                          in number
286   ,p_business_group_id              in number
287   ,p_pcp_strt_dt_cd                 in varchar2
288   ,p_pcp_dsgn_cd                    in varchar2
289   ,p_pcp_dpnt_dsgn_cd               in varchar2
290   ,p_pcp_rpstry_flag                in varchar2
291   ,p_pcp_can_keep_flag              in varchar2
292   ,p_pcp_radius                     in number
293   ,p_pcp_radius_uom                 in varchar2
294   ,p_pcp_radius_warn_flag           in varchar2
295   ,p_pcp_num_chgs                   in number
296   ,p_pcp_num_chgs_uom               in varchar2
297   ,p_pcp_attribute_category         in varchar2
298   ,p_pcp_attribute1                 in varchar2
299   ,p_pcp_attribute2                 in varchar2
300   ,p_pcp_attribute3                 in varchar2
301   ,p_pcp_attribute4                 in varchar2
302   ,p_pcp_attribute5                 in varchar2
303   ,p_pcp_attribute6                 in varchar2
304   ,p_pcp_attribute7                 in varchar2
305   ,p_pcp_attribute8                 in varchar2
306   ,p_pcp_attribute9                 in varchar2
307   ,p_pcp_attribute10                in varchar2
308   ,p_pcp_attribute11                in varchar2
309   ,p_pcp_attribute12                in varchar2
310   ,p_pcp_attribute13                in varchar2
311   ,p_pcp_attribute14                in varchar2
312   ,p_pcp_attribute15                in varchar2
313   ,p_pcp_attribute16                in varchar2
314   ,p_pcp_attribute17                in varchar2
315   ,p_pcp_attribute18                in varchar2
316   ,p_pcp_attribute19                in varchar2
317   ,p_pcp_attribute20                in varchar2
318   ,p_pcp_attribute21                in varchar2
319   ,p_pcp_attribute22                in varchar2
320   ,p_pcp_attribute23                in varchar2
321   ,p_pcp_attribute24                in varchar2
322   ,p_pcp_attribute25                in varchar2
323   ,p_pcp_attribute26                in varchar2
324   ,p_pcp_attribute27                in varchar2
325   ,p_pcp_attribute28                in varchar2
326   ,p_pcp_attribute29                in varchar2
327   ,p_pcp_attribute30                in varchar2
328   ,p_object_version_number          in number
329   )
330   Return g_rec_type;
331 --
332 end ben_pcp_shd;