DBA Data[Home] [Help]

PACKAGE: APPS.PQH_BVR_SHD

Source


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