1 Package per_qat_shd AUTHID CURRENT_USER as
2 /* $Header: peqatrhi.pkh 120.0 2005/05/31 16:07:16 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (qualification_id number(15)
10 ,language varchar2(9) -- Increased length
11 ,source_lang varchar2(9) -- Increased length
12 ,title varchar2(120)
13 ,group_ranking varchar2(100)
14 ,license_restrictions varchar2(255)
15 ,awarding_body varchar2(100)
16 ,grade_attained varchar2(100)
17 ,reimbursement_arrangements varchar2(2000)
18 ,training_completed_units varchar2(100)
19 ,membership_category varchar2(80)
20 );
21 --
22 -- ----------------------------------------------------------------------------
23 -- | Global Definitions - Internal Development Use Only |
24 -- ----------------------------------------------------------------------------
25 --
26 g_old_rec g_rec_type; -- Global record definition
27 -- Global table name
28 g_tab_nam constant varchar2(30) := 'PER_QUALIFICATIONS_TL';
29 --
30 -- ----------------------------------------------------------------------------
31 -- |---------------------------< constraint_error >---------------------------|
32 -- ----------------------------------------------------------------------------
33 -- {Start Of Comments}
34 --
35 -- Description:
36 -- This procedure is called when a constraint has been violated (i.e.
37 -- The exception hr_api.check_integrity_violated,
38 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
39 -- hr_api.unique_integrity_violated has been raised).
40 -- The exceptions can only be raised as follows:
41 -- 1) A check constraint can only be violated during an INSERT or UPDATE
42 -- dml operation.
43 -- 2) A parent integrity constraint can only be violated during an
44 -- INSERT or UPDATE dml operation.
45 -- 3) A child integrity constraint can only be violated during an
46 -- DELETE dml operation.
47 -- 4) A unique integrity constraint can only be violated during INSERT or
48 -- UPDATE dml operation.
49 --
50 -- Prerequisites:
51 -- 1) Either hr_api.check_integrity_violated,
52 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
53 -- hr_api.unique_integrity_violated has been raised with the subsequent
54 -- stripping of the constraint name from the generated error message
55 -- text.
56 -- 2) Standalone validation test which corresponds with a constraint error.
57 --
58 -- In Parameter:
59 -- p_constraint_name is in upper format and is just the constraint name
60 -- (e.g. not prefixed by brackets, schema owner etc).
61 --
62 -- Post Success:
63 -- Development dependant.
64 --
65 -- Post Failure:
66 -- Developement dependant.
67 --
68 -- Developer Implementation Notes:
69 -- For each constraint being checked the hr system package failure message
70 -- has been generated as a template only. These system error messages should
71 -- be modified as required (i.e. change the system failure message to a user
72 -- friendly defined error message).
73 --
74 -- Access Status:
75 -- Internal Development Use Only.
76 --
77 -- {End Of Comments}
78 -- ----------------------------------------------------------------------------
79 Procedure constraint_error
80 (p_constraint_name in all_constraints.constraint_name%TYPE);
81 --
82 -- ----------------------------------------------------------------------------
83 -- |-----------------------------< api_updating >-----------------------------|
84 -- ----------------------------------------------------------------------------
85 -- {Start Of Comments}
86 --
87 -- Description:
88 -- This function is used to populate the g_old_rec record with the
89 -- current row from the database for the specified primary key
90 -- provided that the primary key exists and is valid and does not
91 -- already match the current g_old_rec. The function will always return
92 -- a TRUE value if the g_old_rec is populated with the current row.
93 -- A FALSE value will be returned if all of the primary key arguments
94 -- are null.
95 --
96 -- Prerequisites:
97 -- None.
98 --
99 -- In Parameters:
100 --
101 -- Post Success:
102 -- A value of TRUE will be returned indiciating that the g_old_rec
103 -- is current.
104 -- A value of FALSE will be returned if all of the primary key arguments
105 -- have a null value (this indicates that the row has not be inserted into
106 -- the Schema), and therefore could never have a corresponding row.
107 --
108 -- Post Failure:
109 -- A failure can only occur under two circumstances:
110 -- 1) The primary key is invalid (i.e. a row does not exist for the
111 -- specified primary key values).
112 -- 2) If an object_version_number exists but is NOT the same as the current
113 -- g_old_rec value.
114 --
115 -- Developer Implementation Notes:
116 -- None.
117 --
118 -- Access Status:
119 -- Internal Development Use Only.
120 --
121 -- {End Of Comments}
122 -- ----------------------------------------------------------------------------
123 Function api_updating
124 (p_qualification_id in number
125 ,p_language in varchar2
126 ) Return Boolean;
127 --
128 -- ----------------------------------------------------------------------------
129 -- |---------------------------------< lck >----------------------------------|
130 -- ----------------------------------------------------------------------------
131 -- {Start of comments}
132 --
133 -- Description:
134 -- The Lck process has two main functions to perform. Firstly, the row to be
135 -- updated or deleted must be locked. The locking of the row will only be
136 -- successful if the row is not currently locked by another user.
137 -- Secondly, during the locking of the row, the row is selected into
138 -- the g_old_rec data structure which enables the current row values from
139 -- the server to be available to the api.
140 --
141 -- Prerequisites:
142 -- When attempting to call the lock the object version number (if defined)
143 -- is mandatory.
144 --
145 -- In Parameters:
146 -- The arguments to the Lck process are the primary key(s) which uniquely
147 -- identify the row and the object version number of row.
148 --
149 -- Post Success:
150 -- On successful completion of the Lck process the row to be updated or
151 -- deleted will be locked and selected into the global data structure
152 -- g_old_rec.
153 --
154 -- Post Failure:
155 -- The Lck process can fail for three reasons:
156 -- 1) When attempting to lock the row the row could already be locked by
157 -- another user. This will raise the HR_Api.Object_Locked exception.
158 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
159 -- This error is trapped and reported using the message name
160 -- 'HR_7220_INVALID_PRIMARY_KEY'.
161 -- 3) The row although existing in the HR Schema has a different object
162 -- version number than the object version number specified.
163 -- This error is trapped and reported using the message name
164 -- 'HR_7155_OBJECT_INVALID'.
165 --
166 -- Developer Implementation Notes:
167 -- For each primary key and the object version number arguments add a
168 -- call to hr_api.mandatory_arg_error procedure to ensure that these
169 -- argument values are not null.
170 --
171 -- Access Status:
172 -- Internal Development Use Only.
173 --
174 -- {End of comments}
175 -- ----------------------------------------------------------------------------
176 Procedure lck
177 (p_qualification_id in number
178 ,p_language in varchar2
179 );
180 --
181 -- ----------------------------------------------------------------------------
182 -- |----------------------------< add_language >------------------------------|
183 -- ----------------------------------------------------------------------------
184 -- {Start of Comments}
185 --
186 -- Description:
187 -- Maintains the _TL table. Ensures there is a translation for every
188 -- installed language, removes any orphaned translation rows and
189 -- corrects and translations which have got out of synchronisation.
190 --
191 -- Pre-requisites:
192 --
193 -- In Parameters:
194 --
195 -- Post Success:
196 -- A translation row exists for every installed language.
197 --
198 -- Post Failure:
199 -- Maintenance is aborted.
200 --
201 -- Developer Implementation Notes:
202 -- None.
203 --
204 -- Access Status:
205 -- Internal Development Use Only.
206 --
207 -- {End of Comments}
208 -- ----------------------------------------------------------------------------
209 Procedure add_language;
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_qualification_id in number
244 ,p_language in varchar2
245 ,p_source_lang in varchar2
246 ,p_title in varchar2
247 ,p_group_ranking in varchar2
248 ,p_license_restrictions in varchar2
249 ,p_awarding_body in varchar2
250 ,p_grade_attained in varchar2
251 ,p_reimbursement_arrangements in varchar2
252 ,p_training_completed_units in varchar2
253 ,p_membership_category in varchar2
254 )
255 Return g_rec_type;
256 --
257 end per_qat_shd;