DBA Data[Home] [Help]

PACKAGE: APPS.GHR_PDC_SHD

Source


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