DBA Data[Home] [Help]

PACKAGE: APPS.PER_ZA_TRA_SHD

Source


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