DBA Data[Home] [Help]

PACKAGE: APPS.OTA_TPL_SHD

Source


1 Package ota_tpl_shd AUTHID CURRENT_USER as
2 /* $Header: ottpl01t.pkh 115.0 99/07/16 00:56:02 porting ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                    Global Record Type Specification                      |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9   (
10   price_list_id                     number(9),
11   business_group_id                 number(9),
12   currency_code                     varchar2(30),
13   default_flag                      varchar2(30),
14   name                              varchar2(80),
15   object_version_number             number(9),        -- Increased length
16   price_list_type                   varchar2(30),
17   start_date                        date,
18   comments                          varchar2(2000),
19   description                       varchar2(240),
20   end_date                          date,
21   single_unit_price                 number(17,2),     -- Increased length
22   training_unit_type                varchar2(30),
23   tpl_information_category          varchar2(30),
24   tpl_information1                  varchar2(150),
25   tpl_information2                  varchar2(150),
26   tpl_information3                  varchar2(150),
27   tpl_information4                  varchar2(150),
28   tpl_information5                  varchar2(150),
29   tpl_information6                  varchar2(150),
30   tpl_information7                  varchar2(150),
31   tpl_information8                  varchar2(150),
32   tpl_information9                  varchar2(150),
33   tpl_information10                 varchar2(150),
34   tpl_information11                 varchar2(150),
35   tpl_information12                 varchar2(150),
36   tpl_information13                 varchar2(150),
37   tpl_information14                 varchar2(150),
38   tpl_information15                 varchar2(150),
39   tpl_information16                 varchar2(150),
40   tpl_information17                 varchar2(150),
41   tpl_information18                 varchar2(150),
42   tpl_information19                 varchar2(150),
43   tpl_information20                 varchar2(150)
44   );
45 --
46 -- ----------------------------------------------------------------------------
47 -- |           Global Definitions - Internal Development Use Only             |
48 -- ----------------------------------------------------------------------------
49 --
50 g_old_rec  g_rec_type;                            -- Global record definition
51 g_api_dml  boolean;                               -- Global api dml status
52 --
53 -- ----------------------------------------------------------------------------
54 -- |------------------------< return_api_dml_status >-------------------------|
55 -- ----------------------------------------------------------------------------
56 -- {Start Of Comments}
57 --
58 -- Description:
59 --   This function will return the current g_api_dml private global
60 --   boolean status.
61 --   The g_api_dml status determines if at the time of the function
62 --   being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
63 --   is being issued from within an api.
64 --   If the status is TRUE then a dml statement is being issued from
65 --   within this entity api.
66 --   This function is primarily to support database triggers which
67 --   need to maintain the object_version_number for non-supported
68 --   dml statements (i.e. dml statement issued outside of the api layer).
69 --
70 -- Pre Conditions:
71 --   None.
72 --
73 -- In Arguments:
74 --   None.
75 --
76 -- Post Success:
77 --   Processing continues.
78 --   If the function returns a TRUE value then, dml is being executed from
79 --   within this api.
80 --
81 -- Post Failure:
82 --   None.
83 --
84 -- Access Status:
85 --   Public.
86 --
87 -- {End Of Comments}
88 -- ----------------------------------------------------------------------------
89 Function return_api_dml_status Return Boolean;
90 --
91 -- ----------------------------------------------------------------------------
92 -- |---------------------------< constraint_error >---------------------------|
93 -- ----------------------------------------------------------------------------
94 -- {Start Of Comments}
95 --
96 -- Description:
97 --   This procedure is called when a constraint has been violated (i.e.
98 --   The exception hr_api.check_integrity_violated,
99 --   hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
100 --   hr_api.unique_integrity_violated has been raised).
101 --   The exceptions can only be raised as follows:
102 --   1) A check constraint can only be violated during an INSERT or UPDATE
103 --      dml operation.
104 --   2) A parent integrity constraint can only be violated during an
105 --      INSERT or UPDATE dml operation.
106 --   3) A child integrity constraint can only be violated during an
107 --      DELETE dml operation.
108 --   4) A unique integrity constraint can only be violated during INSERT or
109 --      UPDATE dml operation.
110 --
111 -- Pre Conditions:
112 --   1) Either hr_api.check_integrity_violated,
113 --      hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
114 --      hr_api.unique_integrity_violated has been raised with the subsequent
115 --      stripping of the constraint name from the generated error message
116 --      text.
117 --   2) Standalone validation test which correspond with a constraint error.
118 --
119 -- In Arguments:
120 --   p_constraint_name is in upper format and is just the constraint name
121 --   (e.g. not prefixed by brackets, schema owner etc).
122 --
123 -- Post Success:
124 --   Development dependant.
125 --
126 -- Post Failure:
127 --   Developement dependant.
128 --
129 -- Developer Implementation Notes:
130 --   For each constraint being checked the hr system package failure message
131 --   has been generated as a template only. These system error messages should
132 --   be modified as required (i.e. change the system failure message to a user
133 --   friendly defined error message).
134 --
135 -- Access Status:
136 --   Public.
137 --
138 -- {End Of Comments}
139 -- ----------------------------------------------------------------------------
140 Procedure constraint_error
141             (p_constraint_name in varchar2);
142 --
143 -- ----------------------------------------------------------------------------
144 -- |-----------------------------< api_updating >-----------------------------|
145 -- ----------------------------------------------------------------------------
146 -- {Start Of Comments}
147 --
148 -- Description:
149 --   This function is used to populate the g_old_rec record with the
150 --   current row from the database for the specified primary key
151 --   provided that the primary key exists and is valid and does not
152 --   already match the current g_old_rec. The function will always return
153 --   a TRUE value if the g_old_rec is populated with the current row.
154 --   A FALSE value will be returned if all of the primary key arguments
155 --   are null.
156 --
157 -- Pre Conditions:
158 --   None.
159 --
160 -- In Arguments:
161 --
162 -- Post Success:
163 --   A value of TRUE will be returned indiciating that the g_old_rec
164 --   is current.
165 --   A value of FALSE will be returned if all of the primary key arguments
166 --   have a null value (this indicates that the row has not be inserted into
167 --   the Schema), and therefore could never have a corresponding row.
168 --
169 -- Post Failure:
170 --   A failure can only occur under two circumstances:
171 --   1) The primary key is invalid (i.e. a row does not exist for the
172 --      specified primary key values).
173 --   2) If an object_version_number exists but is NOT the same as the current
174 --      g_old_rec value.
175 --
176 -- Developer Implementation Notes:
177 --   None.
178 --
179 -- Access Status:
180 --   Internal Development Use Only.
181 --
182 -- {End Of Comments}
183 -- ----------------------------------------------------------------------------
184 Function api_updating
185   (
186   p_price_list_id                      in number,
187   p_object_version_number              in number
188   )      Return Boolean;
189 --
190 -- ----------------------------------------------------------------------------
191 -- |---------------------------------< lck >----------------------------------|
192 -- ----------------------------------------------------------------------------
193 -- {Start Of Comments}
194 --
195 -- Description:
196 --   The Lck process has two main functions to perform. Firstly, the row to be
197 --   updated or deleted must be locked. The locking of the row will only be
198 --   successful if the row is not currently locked by another user.
199 --   Secondly, during the locking of the row, the row is selected into
200 --   the g_old_rec data structure which enables the current row values from the
201 --   server to be available to the api.
202 --
203 -- Pre Conditions:
204 --   When attempting to call the lock the object version number (if defined)
205 --   is mandatory.
206 --
207 -- In Arguments:
208 --   The arguments to the Lck process are the primary key(s) which uniquely
209 --   identify the row and the object version number of row.
210 --
211 -- Post Success:
212 --   On successful completion of the Lck process the row to be updated or
213 --   deleted will be locked and selected into the global data structure
214 --   g_old_rec.
215 --
216 -- Post Failure:
217 --   The Lck process can fail for three reasons:
218 --   1) When attempting to lock the row the row could already be locked by
219 --      another user. This will raise the HR_Api.Object_Locked exception.
220 --   2) The row which is required to be locked doesn't exist in the HR Schema.
221 --      This error is trapped and reported using the message name
222 --      'HR_7220_INVALID_PRIMARY_KEY'.
223 --   3) The row although existing in the HR Schema has a different object
224 --      version number than the object version number specified.
225 --      This error is trapped and reported using the message name
226 --      'HR_7155_OBJECT_INVALID'.
227 --
228 -- Developer Implementation Notes:
229 --   For each primary key and the object version number arguments add a
230 --   call to hr_api.mandatory_arg_error procedure to ensure that these
231 --   argument values are not null.
232 --
233 -- Access Status:
234 --   Public.
235 --
236 -- {End Of Comments}
237 -- ----------------------------------------------------------------------------
238 Procedure lck
239   (
240   p_price_list_id                      in number,
241   p_object_version_number              in number
242   );
243 --
244 -- ----------------------------------------------------------------------------
245 -- |-----------------------------< convert_args >-----------------------------|
246 -- ----------------------------------------------------------------------------
247 -- {Start Of Comments}
248 --
249 -- Description:
250 --   This function is used to turn attribute arguments into the record
251 --   structure g_rec_type.
252 --
253 -- Pre Conditions:
254 --   This is a private function and can only be called from the ins or upd
255 --   attribute processes.
256 --
257 -- In Arguments:
258 --
259 -- Post Success:
260 --   A returning record structure will be returned.
261 --
262 -- Post Failure:
263 --   No direct error handling is required within this function. Any possible
264 --   errors within this function will be a PL/SQL value error due to conversion
265 --   of datatypes or data lengths.
266 --
267 -- Developer Implementation Notes:
268 --   None.
269 --
270 -- Access Status:
271 --   Internal Development Use Only.
272 --
273 -- {End Of Comments}
274 -- ----------------------------------------------------------------------------
275 Function convert_args
276 	(
277 	p_price_list_id                 in number,
278 	p_business_group_id             in number,
279 	p_currency_code                 in varchar2,
280 	p_default_flag                  in varchar2,
281 	p_name                          in varchar2,
282 	p_object_version_number         in number,
283 	p_price_list_type               in varchar2,
284 	p_start_date                    in date,
285 	p_comments                      in varchar2,
286 	p_description                   in varchar2,
287 	p_end_date                      in date,
288 	p_single_unit_price             in number,
289 	p_training_unit_type            in varchar2,
290 	p_tpl_information_category      in varchar2,
291 	p_tpl_information1              in varchar2,
292 	p_tpl_information2              in varchar2,
293 	p_tpl_information3              in varchar2,
294 	p_tpl_information4              in varchar2,
295 	p_tpl_information5              in varchar2,
296 	p_tpl_information6              in varchar2,
297 	p_tpl_information7              in varchar2,
298 	p_tpl_information8              in varchar2,
299 	p_tpl_information9              in varchar2,
300 	p_tpl_information10             in varchar2,
301 	p_tpl_information11             in varchar2,
302 	p_tpl_information12             in varchar2,
303 	p_tpl_information13             in varchar2,
304 	p_tpl_information14             in varchar2,
305 	p_tpl_information15             in varchar2,
306 	p_tpl_information16             in varchar2,
307 	p_tpl_information17             in varchar2,
308 	p_tpl_information18             in varchar2,
309 	p_tpl_information19             in varchar2,
310 	p_tpl_information20             in varchar2
311 	)
312 	Return g_rec_type;
313 --
314 end ota_tpl_shd;