DBA Data[Home] [Help]

PACKAGE: APPS.PER_GRS_SHD

Source


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