DBA Data[Home] [Help]

PACKAGE: APPS.PQH_BEL_SHD

Source


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