1 Package per_za_lsa_shd AUTHID CURRENT_USER as
2 /* $Header: pezalssh.pkh 115.0 2001/02/04 22:34:18 pkm ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_za_rec_type Is Record
9 (
10 AGREEMENT_ID NUMBER(9),
11 NAME VARCHAR2(80),
12 DESCRIPTION VARCHAR2(200),
13 AGREEMENT_NUMBER VARCHAR2(10),
14 PERSON_ID NUMBER(9),
15 AGREEMENT_START_DATE DATE,
16 AGREEMENT_END_DATE DATE,
17 STATUS VARCHAR2(30),
18 SETA VARCHAR2(30),
19 PROBATIONARY_END_DATE DATE,
20 TERMINATED_BY VARCHAR2(80),
21 LEARNER_TYPE VARCHAR2(30),
22 REASON_FOR_TERMINATION VARCHAR2(200),
23 ACTUAL_END_DATE DATE,
24 AGREEMENT_HARD_COPY_ID NUMBER(9),
25 LAST_UPDATE_DATE DATE,
26 LAST_UPDATED_BY NUMBER(15),
27 LAST_UPDATE_LOGIN NUMBER(15),
28 CREATED_BY NUMBER(15),
29 CREATION_DATE DATE
30 );
31 --
32 -- ----------------------------------------------------------------------------
33 -- | Global Definitions - Internal Development Use Only |
34 -- ----------------------------------------------------------------------------
35 --
36 g_old_rec g_za_rec_type; -- Global record definition
37 g_api_dml boolean; -- Global api dml status
38 --
39 -- ----------------------------------------------------------------------------
40 -- |------------------------< return_api_dml_status >-------------------------|
41 -- ----------------------------------------------------------------------------
42 -- {Start Of Comments}
43 --
44 -- Description:
45 -- This function will return the current g_api_dml private global
46 -- boolean status.
47 -- The g_api_dml status determines if at the time of the function
48 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
49 -- is being issued from within an api.
50 -- If the status is TRUE then a dml statement is being issued from
51 -- within this entity api.
52 -- This function is primarily to support database triggers which
53 -- need to maintain the object_version_number for non-supported
54 -- dml statements (i.e. dml statement issued outside of the api layer).
55 --
56 -- Pre Conditions:
57 -- None.
58 --
59 -- In Parameters:
60 -- None.
61 --
62 -- Post Success:
63 -- Processing continues.
64 -- If the function returns a TRUE value then, dml is being executed from
65 -- within this api.
66 --
67 -- Post Failure:
68 -- None.
69 --
70 -- Access Status:
71 -- Internal Table Handler Use Only.
72 --
73 -- {End Of Comments}
74 -- ----------------------------------------------------------------------------
75 Function return_api_dml_status Return Boolean;
76 --
77 -- ----------------------------------------------------------------------------
78 -- |---------------------------< constraint_error >---------------------------|
79 -- ----------------------------------------------------------------------------
80 -- {Start Of Comments}
81 --
82 -- Description:
83 -- This procedure is called when a constraint has been violated (i.e.
84 -- The exception hr_api.check_integrity_violated,
85 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
86 -- hr_api.unique_integrity_violated has been raised).
87 -- The exceptions can only be raised as follows:
88 -- 1) A check constraint can only be violated during an INSERT or UPDATE
89 -- dml operation.
90 -- 2) A parent integrity constraint can only be violated during an
91 -- INSERT or UPDATE dml operation.
92 -- 3) A child integrity constraint can only be violated during an
93 -- DELETE dml operation.
94 -- 4) A unique integrity constraint can only be violated during INSERT or
95 -- UPDATE dml operation.
96 --
97 -- Pre Conditions:
98 -- 1) Either hr_api.check_integrity_violated,
99 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
100 -- hr_api.unique_integrity_violated has been raised with the subsequent
101 -- stripping of the constraint name from the generated error message
102 -- text.
103 -- 2) Standalone validation test which corresponds with a constraint error.
104 --
105 -- In Parameter:
106 -- p_constraint_name is in upper format and is just the constraint name
107 -- (e.g. not prefixed by brackets, schema owner etc).
108 --
109 -- Post Success:
110 -- Development dependant.
111 --
112 -- Post Failure:
113 -- Developement dependant.
114 --
115 -- Developer Implementation Notes:
116 -- For each constraint being checked the hr system package failure message
117 -- has been generated as a template only. These system error messages should
118 -- be modified as required (i.e. change the system failure message to a user
119 -- friendly defined error message).
120 --
121 -- Access Status:
122 -- Internal Development Use Only.
123 --
124 -- {End Of Comments}
125 -- ----------------------------------------------------------------------------
126 Procedure constraint_error
127 (p_constraint_name in all_constraints.constraint_name%TYPE);
128 --
129 -- ----------------------------------------------------------------------------
130 -- |-----------------------------< api_updating >-----------------------------|
131 -- ----------------------------------------------------------------------------
132 -- {Start Of Comments}
133 --
134 -- Description:
135 -- This function is used to populate the g_old_rec record with the
136 -- current row from the database for the specified primary key
137 -- provided that the primary key exists and is valid and does not
138 -- already match the current g_old_rec. The function will always return
139 -- a TRUE value if the g_old_rec is populated with the current row.
140 -- A FALSE value will be returned if all of the primary key arguments
141 -- are null.
142 --
143 -- Pre Conditions:
144 -- None.
145 --
146 -- In Parameters:
147 --
148 -- Post Success:
149 -- A value of TRUE will be returned indiciating that the g_old_rec
150 -- is current.
151 -- A value of FALSE will be returned if all of the primary key arguments
152 -- have a null value (this indicates that the row has not be inserted into
153 -- the Schema), and therefore could never have a corresponding row.
154 --
155 -- Post Failure:
156 -- A failure can only occur under two circumstances:
157 -- 1) The primary key is invalid (i.e. a row does not exist for the
158 -- specified primary key values).
159 -- 2) If an object_version_number exists but is NOT the same as the current
160 -- g_old_rec value.
161 --
162 -- Developer Implementation Notes:
163 -- None.
164 --
165 -- Access Status:
166 -- Internal Development Use Only.
167 --
168 -- {End Of Comments}
169 -- ----------------------------------------------------------------------------
170 -- Function api_updating
171 -- (
172 -- p_assessment_id in number,
173 -- p_person_id in number,
174 -- p_level_id in number,
175 -- p_name_of_assessor in varchar2,
176 -- p_institution in varchar2,
177 -- p_credit in number,
178 -- p_date_of_assessment in date,
179 -- p_final_result in varchar2,
180 -- p_assessment_number in varchar2,
181 -- p_location_where_assessed in varchar2,
182 -- p_field_of_learning in varchar2
183 -- ) Return Boolean;
184 --
185 -- ----------------------------------------------------------------------------
186 -- |---------------------------------< lck >----------------------------------|
187 -- ----------------------------------------------------------------------------
188 -- {Start Of Comments}
189 --
190 -- Description:
191 -- The Lck process has two main functions to perform. Firstly, the row to be
192 -- updated or deleted must be locked. The locking of the row will only be
193 -- successful if the row is not currently locked by another user.
194 -- Secondly, during the locking of the row, the row is selected into
195 -- the g_old_rec data structure which enables the current row values from the
196 -- server to be available to the api.
197 --
198 -- Pre Conditions:
199 -- When attempting to call the lock the object version number (if defined)
200 -- is mandatory.
201 --
202 -- In Parameters:
203 -- The arguments to the Lck process are the primary key(s) which uniquely
204 -- identify the row and the object version number of row.
205 --
206 -- Post Success:
207 -- On successful completion of the Lck process the row to be updated or
208 -- deleted will be locked and selected into the global data structure
209 -- g_old_rec.
210 --
211 -- Post Failure:
212 -- The Lck process can fail for three reasons:
213 -- 1) When attempting to lock the row the row could already be locked by
214 -- another user. This will raise the HR_Api.Object_Locked exception.
215 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
216 -- This error is trapped and reported using the message name
217 -- 'HR_7220_INVALID_PRIMARY_KEY'.
218 -- 3) The row although existing in the HR Schema has a different object
219 -- version number than the object version number specified.
220 -- This error is trapped and reported using the message name
221 -- 'HR_7155_OBJECT_INVALID'.
222 --
223 -- Developer Implementation Notes:
224 -- For each primary key and the object version number arguments add a
225 -- call to hr_api.mandatory_arg_error procedure to ensure that these
226 -- argument values are not null.
227 --
228 -- Access Status:
229 -- Internal Development Use Only.
230 --
231 -- {End Of Comments}
232 -- ----------------------------------------------------------------------------
233 Procedure lck
234 (
235 p_agreement_id in number,
236 p_person_id 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 -- Pre Conditions:
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 conversion
260 -- of datatypes or data lengths.
261 --
262 -- Developer Implementation Notes:
263 -- None.
264 --
265 -- Access Status:
266 -- Internal Table Handler Use Only.
267 --
268 -- {End Of Comments}
269 -- ----------------------------------------------------------------------------
270 Function convert_args
271 (
272 p_agreement_id in number,
273 p_person_id in number,
274 p_name in varchar2,
275 p_description in varchar2,
276 p_agreement_number in varchar2,
277 p_agreement_start_date in date,
278 p_agreement_end_date in date,
279 p_status in varchar2,
280 p_seta in varchar2,
281 p_probationary_end_date in date,
282 p_terminated_by in varchar2,
283 p_learner_type in varchar2,
284 p_reason_for_termination in varchar2,
285 p_actual_end_date in date,
286 p_agreement_hard_copy_id in number
287 )
288 Return g_za_rec_type;
289 --
290 end per_za_lsa_shd ;