1 Package pqh_tem_shd as
2 /* $Header: pqtemrhi.pkh 120.4 2007/04/19 12:49:27 brsinha noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (
10 template_name varchar2(100),
11 short_name varchar2(30),
12 template_id number(15),
13 attribute_only_flag varchar2(10),
14 enable_flag varchar2(10),
15 create_flag varchar2(10),
16 transaction_category_id number(15),
17 under_review_flag varchar2(10),
18 object_version_number number(9),
19 freeze_status_cd varchar2(30),
20 template_type_cd varchar2(30),
21 legislation_code varchar2(30)
22 );
23 --
24 -- ----------------------------------------------------------------------------
25 -- | Global Definitions - Internal Development Use Only |
26 -- ----------------------------------------------------------------------------
27 --
28 g_old_rec g_rec_type; -- Global record definition
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 (
125 p_template_id in number,
126 p_object_version_number in number
127 ) Return Boolean;
128 --
129 -- ----------------------------------------------------------------------------
130 -- |---------------------------------< lck >----------------------------------|
131 -- ----------------------------------------------------------------------------
132 -- {Start Of Comments}
133 --
134 -- Description:
135 -- The Lck process has two main functions to perform. Firstly, the row to be
136 -- updated or deleted must be locked. The locking of the row will only be
137 -- successful if the row is not currently locked by another user.
138 -- Secondly, during the locking of the row, the row is selected into
139 -- the g_old_rec data structure which enables the current row values from the
140 -- server to be available to the api.
141 --
142 -- Prerequisites:
143 -- When attempting to call the lock the object version number (if defined)
144 -- is mandatory.
145 --
146 -- In Parameters:
147 -- The arguments to the Lck process are the primary key(s) which uniquely
148 -- identify the row and the object version number of row.
149 --
150 -- Post Success:
151 -- On successful completion of the Lck process the row to be updated or
152 -- deleted will be locked and selected into the global data structure
153 -- g_old_rec.
154 --
155 -- Post Failure:
156 -- The Lck process can fail for three reasons:
157 -- 1) When attempting to lock the row the row could already be locked by
158 -- another user. This will raise the HR_Api.Object_Locked exception.
159 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
160 -- This error is trapped and reported using the message name
161 -- 'HR_7220_INVALID_PRIMARY_KEY'.
162 -- 3) The row although existing in the HR Schema has a different object
163 -- version number than the object version number specified.
164 -- This error is trapped and reported using the message name
165 -- 'HR_7155_OBJECT_INVALID'.
166 --
167 -- Developer Implementation Notes:
168 -- For each primary key and the object version number arguments add a
169 -- call to hr_api.mandatory_arg_error procedure to ensure that these
170 -- argument values are not null.
171 --
172 -- Access Status:
173 -- Internal Development Use Only.
174 --
175 -- {End Of Comments}
176 -- ----------------------------------------------------------------------------
177 Procedure lck
178 (
179 p_template_id in number,
180 p_object_version_number in number
181 );
182 --
183 -- ----------------------------------------------------------------------------
184 -- |-----------------------------< convert_args >-----------------------------|
185 -- ----------------------------------------------------------------------------
186 -- {Start Of Comments}
187 --
188 -- Description:
189 -- This function is used to turn attribute parameters into the record
190 -- structure parameter g_rec_type.
191 --
192 -- Prerequisites:
193 -- This is a private function and can only be called from the ins or upd
194 -- attribute processes.
195 --
196 -- In Parameters:
197 --
198 -- Post Success:
199 -- A returning record structure will be returned.
200 --
201 -- Post Failure:
202 -- No direct error handling is required within this function. Any possible
203 -- errors within this function will be a PL/SQL value error due to conversion
204 -- of datatypes or data lengths.
205 --
206 -- Developer Implementation Notes:
207 -- None.
208 --
209 -- Access Status:
210 -- Internal Row Handler Use Only.
211 --
212 -- {End Of Comments}
213 -- ----------------------------------------------------------------------------
214 Function convert_args
215 (
216 p_template_name in varchar2,
217 p_short_name in varchar2,
218 p_template_id in number,
219 p_attribute_only_flag in varchar2,
220 p_enable_flag in varchar2,
221 p_create_flag in varchar2,
222 p_transaction_category_id in number,
223 p_under_review_flag in varchar2,
224 p_object_version_number in number,
225 p_freeze_status_cd in varchar2,
226 p_template_type_cd in varchar2,
227 p_legislation_code in varchar2
228 )
229 Return g_rec_type;
230 --
231 --
232 -- ----------------------------------------------------------------------------
233 -- |------------------------< LOAD_ROW >----------------------|
234 -- ----------------------------------------------------------------------------
235 --
236 procedure LOAD_ROW
237 (p_short_name in varchar2
238 ,p_template_name in varchar2
239 ,p_attribute_only_flag in varchar2
240 ,p_enable_flag in varchar2
241 ,p_create_flag in varchar2
242 ,p_tran_cat_short_name in varchar2
243 ,p_under_review_flag in varchar2
244 ,p_freeze_status_cd in varchar2
245 ,p_template_type_cd in varchar2
246 ,p_legislation_code in varchar2
247 ,p_owner in varchar2
248 ,p_last_update_date in varchar2
249
250 );
251 --
252 --
253 -- ----------------------------------------------------------------------------
254 -- |------------------------< load_seed_row >----------------------|
255 -- ----------------------------------------------------------------------------
256 --
257 procedure load_seed_row
258 (p_upload_mode in varchar2
259 ,p_short_name in varchar2
260 ,p_template_name in varchar2
261 ,p_attribute_only_flag in varchar2
262 ,p_enable_flag in varchar2
263 ,p_create_flag in varchar2
264 ,p_tran_cat_short_name in varchar2
265 ,p_under_review_flag in varchar2
266 ,p_freeze_status_cd in varchar2
267 ,p_template_type_cd in varchar2
268 ,p_legislation_code in varchar2
269 ,p_owner in varchar2
270 ,p_last_update_date in varchar2
271 );
272 --
273 -- ----------------------------------------------------------------------------
274 -- |-----------------------------< add_language >------------------------------|
275 -- ----------------------------------------------------------------------------
276 --
277 procedure add_language; -- added as a fix for bug 5484366
278 --
279 end pqh_tem_shd;