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