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