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