1 Package ben_cwg_shd as
2 /* $Header: becwgrhi.pkh 120.0 2005/05/28 01:30:01 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (cwb_wksht_grp_id number(15)
10 ,business_group_id number(15)
11 ,pl_id number(15)
12 ,ordr_num number(15)
13 ,wksht_grp_cd varchar2(30)
14 ,label varchar2(80)
15 ,cwg_attribute_category varchar2(30)
16 ,cwg_attribute1 varchar2(150)
17 ,cwg_attribute2 varchar2(150)
18 ,cwg_attribute3 varchar2(150)
19 ,cwg_attribute4 varchar2(150)
20 ,cwg_attribute5 varchar2(150)
21 ,cwg_attribute6 varchar2(150)
22 ,cwg_attribute7 varchar2(150)
23 ,cwg_attribute8 varchar2(150)
24 ,cwg_attribute9 varchar2(150)
25 ,cwg_attribute10 varchar2(150)
26 ,cwg_attribute11 varchar2(150)
27 ,cwg_attribute12 varchar2(150)
28 ,cwg_attribute13 varchar2(150)
29 ,cwg_attribute14 varchar2(150)
30 ,cwg_attribute15 varchar2(150)
31 ,cwg_attribute16 varchar2(150)
32 ,cwg_attribute17 varchar2(150)
33 ,cwg_attribute18 varchar2(150)
34 ,cwg_attribute19 varchar2(150)
35 ,cwg_attribute20 varchar2(150)
36 ,cwg_attribute21 varchar2(150)
37 ,cwg_attribute22 varchar2(150)
38 ,cwg_attribute23 varchar2(150)
39 ,cwg_attribute24 varchar2(150)
40 ,cwg_attribute25 varchar2(150)
41 ,cwg_attribute26 varchar2(150)
42 ,cwg_attribute27 varchar2(150)
43 ,cwg_attribute28 varchar2(150)
44 ,cwg_attribute29 varchar2(150)
45 ,cwg_attribute30 varchar2(150)
46 ,status_cd varchar2(30)
47 ,hidden_cd varchar2(30)
48 ,object_version_number number
49 );
50 --
51 -- ----------------------------------------------------------------------------
52 -- | Global Definitions - Internal Development Use Only |
53 -- ----------------------------------------------------------------------------
54 --
55 g_old_rec g_rec_type; -- Global record definition
56 -- Global table name
57 g_tab_nam constant varchar2(30) := 'BEN_CWB_WKSHT_GRP';
58 --
59 -- ----------------------------------------------------------------------------
60 -- |---------------------------< constraint_error >---------------------------|
61 -- ----------------------------------------------------------------------------
62 -- {Start Of Comments}
63 --
64 -- Description:
65 -- This procedure is called when a constraint has been violated (i.e.
66 -- The exception hr_api.check_integrity_violated,
67 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
68 -- hr_api.unique_integrity_violated has been raised).
69 -- The exceptions can only be raised as follows:
70 -- 1) A check constraint can only be violated during an INSERT or UPDATE
71 -- dml operation.
72 -- 2) A parent integrity constraint can only be violated during an
73 -- INSERT or UPDATE dml operation.
74 -- 3) A child integrity constraint can only be violated during an
75 -- DELETE dml operation.
76 -- 4) A unique integrity constraint can only be violated during INSERT or
77 -- UPDATE dml operation.
78 --
79 -- Prerequisites:
80 -- 1) Either hr_api.check_integrity_violated,
81 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
82 -- hr_api.unique_integrity_violated has been raised with the subsequent
83 -- stripping of the constraint name from the generated error message
84 -- text.
85 -- 2) Standalone validation test which corresponds with a constraint error.
86 --
87 -- In Parameter:
88 -- p_constraint_name is in upper format and is just the constraint name
89 -- (e.g. not prefixed by brackets, schema owner etc).
90 --
91 -- Post Success:
92 -- Development dependant.
93 --
94 -- Post Failure:
95 -- Developement dependant.
96 --
97 -- Developer Implementation Notes:
98 -- For each constraint being checked the hr system package failure message
99 -- has been generated as a template only. These system error messages should
100 -- be modified as required (i.e. change the system failure message to a user
101 -- friendly defined error message).
102 --
103 -- Access Status:
104 -- Internal Development Use Only.
105 --
106 -- {End Of Comments}
107 -- ----------------------------------------------------------------------------
108 Procedure constraint_error
109 (p_constraint_name in all_constraints.constraint_name%TYPE);
110 --
111 -- ----------------------------------------------------------------------------
112 -- |-----------------------------< api_updating >-----------------------------|
113 -- ----------------------------------------------------------------------------
114 -- {Start Of Comments}
115 --
116 -- Description:
117 -- This function is used to populate the g_old_rec record with the
118 -- current row from the database for the specified primary key
119 -- provided that the primary key exists and is valid and does not
120 -- already match the current g_old_rec. The function will always return
121 -- a TRUE value if the g_old_rec is populated with the current row.
122 -- A FALSE value will be returned if all of the primary key arguments
123 -- are null.
124 --
125 -- Prerequisites:
126 -- None.
127 --
128 -- In Parameters:
129 --
130 -- Post Success:
131 -- A value of TRUE will be returned indiciating that the g_old_rec
132 -- is current.
133 -- A value of FALSE will be returned if all of the primary key arguments
134 -- have a null value (this indicates that the row has not be inserted into
135 -- the Schema), and therefore could never have a corresponding row.
136 --
137 -- Post Failure:
138 -- A failure can only occur under two circumstances:
139 -- 1) The primary key is invalid (i.e. a row does not exist for the
140 -- specified primary key values).
141 -- 2) If an object_version_number exists but is NOT the same as the current
142 -- g_old_rec value.
143 --
144 -- Developer Implementation Notes:
145 -- None.
146 --
147 -- Access Status:
148 -- Internal Development Use Only.
149 --
150 -- {End Of Comments}
151 -- ----------------------------------------------------------------------------
152 Function api_updating
153 (p_cwb_wksht_grp_id in number
154 ,p_object_version_number in number
155 ) Return Boolean;
156 --
157 -- ----------------------------------------------------------------------------
158 -- |---------------------------------< lck >----------------------------------|
159 -- ----------------------------------------------------------------------------
160 -- {Start of comments}
161 --
162 -- Description:
163 -- The Lck process has two main functions to perform. Firstly, the row to be
164 -- updated or deleted must be locked. The locking of the row will only be
165 -- successful if the row is not currently locked by another user.
166 -- Secondly, during the locking of the row, the row is selected into
167 -- the g_old_rec data structure which enables the current row values from
168 -- the server to be available to the api.
169 --
170 -- Prerequisites:
171 -- When attempting to call the lock the object version number (if defined)
172 -- is mandatory.
173 --
174 -- In Parameters:
175 -- The arguments to the Lck process are the primary key(s) which uniquely
176 -- identify the row and the object version number of row.
177 --
178 -- Post Success:
179 -- On successful completion of the Lck process the row to be updated or
180 -- deleted will be locked and selected into the global data structure
181 -- g_old_rec.
182 --
183 -- Post Failure:
184 -- The Lck process can fail for three reasons:
185 -- 1) When attempting to lock the row the row could already be locked by
186 -- another user. This will raise the HR_Api.Object_Locked exception.
187 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
188 -- This error is trapped and reported using the message name
189 -- 'HR_7220_INVALID_PRIMARY_KEY'.
190 -- 3) The row although existing in the HR Schema has a different object
191 -- version number than the object version number specified.
192 -- This error is trapped and reported using the message name
193 -- 'HR_7155_OBJECT_INVALID'.
194 --
195 -- Developer Implementation Notes:
196 -- For each primary key and the object version number arguments add a
197 -- call to hr_api.mandatory_arg_error procedure to ensure that these
198 -- argument values are not null.
199 --
200 -- Access Status:
201 -- Internal Development Use Only.
202 --
203 -- {End of comments}
204 -- ----------------------------------------------------------------------------
205 Procedure lck
206 (p_cwb_wksht_grp_id in number
207 ,p_object_version_number in number
208 );
209 --
210 -- ----------------------------------------------------------------------------
211 -- |-----------------------------< convert_args >-----------------------------|
212 -- ----------------------------------------------------------------------------
213 -- {Start Of Comments}
214 --
215 -- Description:
216 -- This function is used to turn attribute parameters into the record
217 -- structure parameter g_rec_type.
218 --
219 -- Prerequisites:
220 -- This is a private function and can only be called from the ins or upd
221 -- attribute processes.
222 --
223 -- In Parameters:
224 --
225 -- Post Success:
226 -- A returning record structure will be returned.
227 --
228 -- Post Failure:
229 -- No direct error handling is required within this function. Any possible
230 -- errors within this function will be a PL/SQL value error due to
231 -- conversion of datatypes or data lengths.
232 --
233 -- Developer Implementation Notes:
234 -- None.
235 --
236 -- Access Status:
237 -- Internal Row Handler Use Only.
238 --
239 -- {End Of Comments}
240 -- ----------------------------------------------------------------------------
241 Function convert_args
242 (p_cwb_wksht_grp_id in number
243 ,p_business_group_id in number
244 ,p_pl_id in number
245 ,p_ordr_num in number
246 ,p_wksht_grp_cd in varchar2
247 ,p_label in varchar2
248 ,p_cwg_attribute_category in varchar2
249 ,p_cwg_attribute1 in varchar2
250 ,p_cwg_attribute2 in varchar2
251 ,p_cwg_attribute3 in varchar2
252 ,p_cwg_attribute4 in varchar2
253 ,p_cwg_attribute5 in varchar2
254 ,p_cwg_attribute6 in varchar2
255 ,p_cwg_attribute7 in varchar2
256 ,p_cwg_attribute8 in varchar2
257 ,p_cwg_attribute9 in varchar2
258 ,p_cwg_attribute10 in varchar2
259 ,p_cwg_attribute11 in varchar2
260 ,p_cwg_attribute12 in varchar2
261 ,p_cwg_attribute13 in varchar2
262 ,p_cwg_attribute14 in varchar2
263 ,p_cwg_attribute15 in varchar2
264 ,p_cwg_attribute16 in varchar2
265 ,p_cwg_attribute17 in varchar2
266 ,p_cwg_attribute18 in varchar2
267 ,p_cwg_attribute19 in varchar2
268 ,p_cwg_attribute20 in varchar2
269 ,p_cwg_attribute21 in varchar2
270 ,p_cwg_attribute22 in varchar2
271 ,p_cwg_attribute23 in varchar2
272 ,p_cwg_attribute24 in varchar2
273 ,p_cwg_attribute25 in varchar2
274 ,p_cwg_attribute26 in varchar2
275 ,p_cwg_attribute27 in varchar2
276 ,p_cwg_attribute28 in varchar2
277 ,p_cwg_attribute29 in varchar2
278 ,p_cwg_attribute30 in varchar2
279 ,p_status_cd in varchar2
280 ,p_hidden_cd in varchar2
281 ,p_object_version_number in number
282 )
283 Return g_rec_type;
284 --
285 end ben_cwg_shd;