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