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