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