DBA Data[Home] [Help]

PACKAGE: APPS.PAY_TDF_SHD

Source


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