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