1 Package hr_ctx_shd as
2 /* $Header: hrctxrhi.pkh 120.0 2005/05/30 23:30:41 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (context_id number(15)
10 ,view_name varchar2(30)
11 ,param_1 varchar2(2000)
12 ,param_2 varchar2(2000)
13 ,param_3 varchar2(2000)
14 ,param_4 varchar2(2000)
15 ,param_5 varchar2(2000)
16 ,param_6 varchar2(2000)
17 ,param_7 varchar2(2000)
18 ,param_8 varchar2(2000)
19 ,param_9 varchar2(2000)
20 ,param_10 varchar2(2000)
21 ,param_11 varchar2(2000)
22 ,param_12 varchar2(2000)
23 ,param_13 varchar2(2000)
24 ,param_14 varchar2(2000)
25 ,param_15 varchar2(2000)
26 ,param_16 varchar2(2000)
27 ,param_17 varchar2(2000)
28 ,param_18 varchar2(2000)
29 ,param_19 varchar2(2000)
30 ,param_20 varchar2(2000)
31 ,param_21 varchar2(2000)
32 ,param_22 varchar2(2000)
33 ,param_23 varchar2(2000)
34 ,param_24 varchar2(2000)
35 ,param_25 varchar2(2000)
36 ,param_26 varchar2(2000)
37 ,param_27 varchar2(2000)
38 ,param_28 varchar2(2000)
39 ,param_29 varchar2(2000)
40 ,param_30 varchar2(2000)
41 ,object_version_number number(9)
42 );
43 --
44 -- ----------------------------------------------------------------------------
45 -- | Global Definitions - Internal Development Use Only |
46 -- ----------------------------------------------------------------------------
47 --
48 g_old_rec g_rec_type; -- Global record definition
49 -- Global table name
50 g_tab_nam constant varchar2(30) := 'HR_KI_CONTEXTS';
51 --
52 -- ----------------------------------------------------------------------------
53 -- |---------------------------< constraint_error >---------------------------|
54 -- ----------------------------------------------------------------------------
55 -- {Start Of Comments}
56 --
57 -- Description:
58 -- This procedure is called when a constraint has been violated (i.e.
59 -- The exception hr_api.check_integrity_violated,
60 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
61 -- hr_api.unique_integrity_violated has been raised).
62 -- The exceptions can only be raised as follows:
63 -- 1) A check constraint can only be violated during an INSERT or UPDATE
64 -- dml operation.
65 -- 2) A parent integrity constraint can only be violated during an
66 -- INSERT or UPDATE dml operation.
67 -- 3) A child integrity constraint can only be violated during an
68 -- DELETE dml operation.
69 -- 4) A unique integrity constraint can only be violated during INSERT or
70 -- UPDATE dml operation.
71 --
72 -- Prerequisites:
73 -- 1) Either hr_api.check_integrity_violated,
74 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
75 -- hr_api.unique_integrity_violated has been raised with the subsequent
76 -- stripping of the constraint name from the generated error message
77 -- text.
78 -- 2) Standalone validation test which corresponds with a constraint error.
79 --
80 -- In Parameter:
81 -- p_constraint_name is in upper format and is just the constraint name
82 -- (e.g. not prefixed by brackets, schema owner etc).
83 --
84 -- Post Success:
85 -- Development dependant.
86 --
87 -- Post Failure:
88 -- Developement dependant.
89 --
90 -- Developer Implementation Notes:
91 -- For each constraint being checked the hr system package failure message
92 -- has been generated as a template only. These system error messages should
93 -- be modified as required (i.e. change the system failure message to a user
94 -- friendly defined error message).
95 --
96 -- Access Status:
97 -- Internal Development Use Only.
98 --
99 -- {End Of Comments}
100 -- ----------------------------------------------------------------------------
101 Procedure constraint_error
102 (p_constraint_name in all_constraints.constraint_name%TYPE);
103 --
104 -- ----------------------------------------------------------------------------
105 -- |-----------------------------< api_updating >-----------------------------|
106 -- ----------------------------------------------------------------------------
107 -- {Start Of Comments}
108 --
109 -- Description:
110 -- This function is used to populate the g_old_rec record with the
111 -- current row from the database for the specified primary key
112 -- provided that the primary key exists and is valid and does not
113 -- already match the current g_old_rec. The function will always return
114 -- a TRUE value if the g_old_rec is populated with the current row.
115 -- A FALSE value will be returned if all of the primary key arguments
116 -- are null.
117 --
118 -- Prerequisites:
119 -- None.
120 --
121 -- In Parameters:
122 --
123 -- Post Success:
124 -- A value of TRUE will be returned indiciating that the g_old_rec
125 -- is current.
126 -- A value of FALSE will be returned if all of the primary key arguments
127 -- have a null value (this indicates that the row has not be inserted into
128 -- the Schema), and therefore could never have a corresponding row.
129 --
130 -- Post Failure:
131 -- A failure can only occur under two circumstances:
132 -- 1) The primary key is invalid (i.e. a row does not exist for the
133 -- specified primary key values).
134 -- 2) If an object_version_number exists but is NOT the same as the current
135 -- g_old_rec value.
136 --
137 -- Developer Implementation Notes:
138 -- None.
139 --
140 -- Access Status:
141 -- Internal Development Use Only.
142 --
143 -- {End Of Comments}
144 -- ----------------------------------------------------------------------------
145 Function api_updating
146 (p_context_id in number
147 ,p_object_version_number in number
148 ) Return Boolean;
149 --
150 -- ----------------------------------------------------------------------------
151 -- |---------------------------------< lck >----------------------------------|
152 -- ----------------------------------------------------------------------------
153 -- {Start of comments}
154 --
155 -- Description:
156 -- The Lck process has two main functions to perform. Firstly, the row to be
157 -- updated or deleted must be locked. The locking of the row will only be
158 -- successful if the row is not currently locked by another user.
159 -- Secondly, during the locking of the row, the row is selected into
160 -- the g_old_rec data structure which enables the current row values from
161 -- the server to be available to the api.
162 --
163 -- Prerequisites:
164 -- When attempting to call the lock the object version number (if defined)
165 -- is mandatory.
166 --
167 -- In Parameters:
168 -- The arguments to the Lck process are the primary key(s) which uniquely
169 -- identify the row and the object version number of row.
170 --
171 -- Post Success:
172 -- On successful completion of the Lck process the row to be updated or
173 -- deleted will be locked and selected into the global data structure
174 -- g_old_rec.
175 --
176 -- Post Failure:
177 -- The Lck process can fail for three reasons:
178 -- 1) When attempting to lock the row the row could already be locked by
179 -- another user. This will raise the HR_Api.Object_Locked exception.
180 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
181 -- This error is trapped and reported using the message name
182 -- 'HR_7220_INVALID_PRIMARY_KEY'.
183 -- 3) The row although existing in the HR Schema has a different object
184 -- version number than the object version number specified.
185 -- This error is trapped and reported using the message name
186 -- 'HR_7155_OBJECT_INVALID'.
187 --
188 -- Developer Implementation Notes:
189 -- For each primary key and the object version number arguments add a
190 -- call to hr_api.mandatory_arg_error procedure to ensure that these
191 -- argument values are not null.
192 --
193 -- Access Status:
194 -- Internal Development Use Only.
195 --
196 -- {End of comments}
197 -- ----------------------------------------------------------------------------
198 Procedure lck
199 (p_context_id in number
200 ,p_object_version_number in number
201 );
202 --
203 -- ----------------------------------------------------------------------------
204 -- |-----------------------------< convert_args >-----------------------------|
205 -- ----------------------------------------------------------------------------
206 -- {Start Of Comments}
207 --
208 -- Description:
209 -- This function is used to turn attribute parameters into the record
210 -- structure parameter g_rec_type.
211 --
212 -- Prerequisites:
213 -- This is a private function and can only be called from the ins or upd
214 -- attribute processes.
215 --
216 -- In Parameters:
217 --
218 -- Post Success:
219 -- A returning record structure will be returned.
220 --
221 -- Post Failure:
222 -- No direct error handling is required within this function. Any possible
223 -- errors within this function will be a PL/SQL value error due to
224 -- conversion of datatypes or data lengths.
225 --
226 -- Developer Implementation Notes:
227 -- None.
228 --
229 -- Access Status:
230 -- Internal Row Handler Use Only.
231 --
232 -- {End Of Comments}
233 -- ----------------------------------------------------------------------------
234 Function convert_args
235 (p_context_id in number
236 ,p_view_name in varchar2
237 ,p_param_1 in varchar2
238 ,p_param_2 in varchar2
239 ,p_param_3 in varchar2
240 ,p_param_4 in varchar2
241 ,p_param_5 in varchar2
242 ,p_param_6 in varchar2
243 ,p_param_7 in varchar2
244 ,p_param_8 in varchar2
245 ,p_param_9 in varchar2
246 ,p_param_10 in varchar2
247 ,p_param_11 in varchar2
248 ,p_param_12 in varchar2
249 ,p_param_13 in varchar2
250 ,p_param_14 in varchar2
251 ,p_param_15 in varchar2
252 ,p_param_16 in varchar2
253 ,p_param_17 in varchar2
254 ,p_param_18 in varchar2
255 ,p_param_19 in varchar2
256 ,p_param_20 in varchar2
257 ,p_param_21 in varchar2
258 ,p_param_22 in varchar2
259 ,p_param_23 in varchar2
260 ,p_param_24 in varchar2
261 ,p_param_25 in varchar2
262 ,p_param_26 in varchar2
263 ,p_param_27 in varchar2
264 ,p_param_28 in varchar2
265 ,p_param_29 in varchar2
266 ,p_param_30 in varchar2
267 ,p_object_version_number in number
268 )
269 Return g_rec_type;
270 --
271 end hr_ctx_shd;