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