DBA Data[Home] [Help]

PACKAGE: APPS.PER_SUC_SHD

Source


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